- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am implementing a filter (2nd order) in Quartus Stratix II device running at 500KHz. I simulated the design using ModelSim. My Target hardware consists of stratix II device. Input stimulus is sine wave of desired frequency. Inputs coefficients decide the cutoff frequency. Expected result is attenuation of sine wave at cut-off freq. Design works fine in RTL as well as Gate level simulation. 1) However, when programmed on target hardware, it fails completly and has output has no attenuation at lower frequencies (100Hz) and wrong beaviour at higher frequencies. 2) I see that fast/slow model results in timing analyses show failures linked to my design. It indicated a different (40MHz) clock domain in the from/to section of the report. 40MHz is used for other sections and I don't use 40 Mhz for this piece of design. ------------------------------------------------------- Please suggest me how to go ahead from gate level simulation to on board running. I am kind of stuck, unable to proceed further. Is there any settings that i need to check. Thanks in advance. Best Regards, VVPLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will need to consider Sinc envelope of your DAC (if low pass filter). This means low freq will not be attenuated but those near Nyquist will. i.e. there is inherent low pass filter in every DAC unless it has internal/external inverse sinc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks. True.
I am implementing a second order filter. I have 2 input freq, 2 betas which decide the my coefficients (b1,b2,b3,a2,a3) for the filter. This means that we can based on the frequencies and the betas, i should be able to attenuate the desired frequency. This happens and works till gate level simulation but fails on board. I have means to provide input and observe the output also. Please suggest.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should add the effect of DAC sinc as follows:
edit: Amp_out = Amp*sin(x)/x; where x = pi*f/Fs e.g. at .5 of fs you get extra attenuation of .64 or -3.9dB at freq > Nyquist which shouldn't be allowed you get much higher attenuations. Can you tell me what is the response required and that obtained at those two freq.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry I should have said A=A*sin(pi*f/Fs)/(pi*f/Fs) and at .5 the Amp drops by -3.9 dB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apologies, typo error
Not 100 mhz cut-off freq, instead 100 hz. Thanks.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What are values for your filter coeffs (a,b) and what is your actual sampling frequency?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please find the info as follows: The sampling freq = 500 KHz. -- coefficients for 100 Hz coeff_b1 <= x"3FFE25B1"; coeff_b2 <= x"800424A3"; coeff_b3 <= x"3FFDBC4B"; coeff_a2 <= x"800424A3"; coeff_a3 <= x"3FFBE1FD"; Thanks.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
your figures don't match up.
your sine input is at normalised freq of 10/1000,000 and this will be 10/1000,000 of 100Khz = 1 Hz. your filter has a very narrow stopband at .6082 of FN i.e. at 30KHz. it has no attenuation at 1 Hz. so you need to present better setup figures. this is my conversion of hex, I hope I am right: a = 1.0e+009 * -2.147212125000000 -3.221495299000000 b = 1.0e+009 * -3.221346895000000 -2.147212125000000 -3.221373877000000 edit: sorry , i did not enter a1 = 1 so bear with me until tomorrow...- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks.
The values of coefficients for 100 Hz are as follows: True a1=1. Formulasb10.999886916919553b2-1.999747125328010b30.999861787346121a2-1.999747125328010a30.999748704265674 The filter is expected to attenuate the sine wave only at cut-off freq of 100 Hz. I can confirm it happening in RTL & Gate level simulation. It fails on board ? Please advice.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I entered Matlab:
a = [1.000000000000000, -1.999747125328010, 0.999748704265674]; >> b b = [ 0.999886916919553, -1.999747125328010, 0.999861787346121]; >> fvtool(b,a) or use freqz(b,a) I get a notch filter. its notch occurs at .001 of Fs 100000 = 100 Hz and this matches your description. However the attenuation is -.008db = .9991 As to your hex values it gives a completely different filter if I convert it on the basis of 2's complement...you need to check that- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. Great. But it should attenuate at 100 Hz till -10 dB, i believe.
Fs = 500 KHz in my case. I forgot to mention it. To convert the folating numbers to decimal, I need to decide on the bits size. For 30 bits => (float value)*2^30 => results in coefficients that i have mentioned. It is okay in Gate level simulation, but fails on board. Please advice.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had another doubt, is it a big concern and may be a reason for failing on board??
2) I see that fast/slow model results in timing analyses show failures linked to my design. It indicated a different (40MHz) clock domain in the from/to section of the report. 40MHz is used for other sections and I don't use 40 Mhz for this piece of design. Please advice.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Before you move to timing issues, you must realize your filter attenautes by .9991, almost nothing. So if you are happy with simulation then there is something wrong in your implementation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am sorry, i did not get ur point.
I see attenuation in gate level simulation for various amplitudes and various cut-off freq's. If Amp = A, then output = 10% (A), as desired at cut-off freq. Is this not Okay & sufficient to say filter works at gate level? For coefficients calc: float * 2^30 = decimal value, converting this to hex will give my coefficients as mentioned. Kindly suggest..- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The filter coeffs that you gave me and then I entered them in Matlab indicate a notch at 100Hz but of -.008dB. If Simualtion then is telling you 10% attenuation then simulation result must be wrong because it is meant to be implementation only of filter model.
I changed Floating data from hex to decimal then added -2^32 but I feel my conversion is wrong as it applies to 2's complement but this is not the issue now. The main issue is how do you get 10% attenuation when the model says .9991 is expected- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks.
I dont have matlab to check it, but i can give coeff for 1KHz as follows: FormulasDEC=FLOAT*2^30DEC2HEXb10.99887049061930010725290233FED7E7Eb2-1.997332269893000-2144619195802BB546b30.99861948853470010722595113FE961B7a2-1.997332269893000-2144619195802BB546a30.99748997915399910710467103FD6E035 please check this also. I will try to find out matlab to check the same.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
pls find only float value for simplicity
b10.998870490619300b2-1.997332269893000b30.998619488534700a2-1.997332269893000a30.997489979153999- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I entered:
a = [1.000000000000000, -1.997332269893000, 0.997489979153000] b = [0.998870490619300, -1.997332269893000, 0.998619488534700] and I got -12dB attenuation at .002 of 100000 = 200Hz -12dB means A is lowered to .25- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello kaz,
I requested a friend of mine to plot the response for the filter. Please find the attached picture which looks correct. >> a = [1.000000000000000, -1.999747125328010, 0.999748704265674]; >> b = [ 0.999886916919553, -1.999747125328010, 0.999861787346121]; fvtool(b,a) It looks like 100 Hz 20 dB. Please have a look and advice.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that looks ok. It is interesting that there is this difference. It could be something went wrong with my typing or observation. I will check that again on Tuesday due to easter holidays in the UK.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page