07-24-2015 09:29 AM
I am trying to create a Parks-McClellan differentiator in LabView.
I am using the Math/Optimization/FIR Optimization.vi example as a starting point.
However, changing the filter type to Differentiator from Multiband to Differentiator gives an error. The Hilbert type also gives an error.
Any ideas/tips on how to properly use the Differentiator option of the Parks-McClellan FIR block?
Solved! Go to Solution.
07-27-2015 09:32 AM
Using Parks-McClellan.vi with the differential mode you only need to know that if your # of taps is an odd number the value of Higher Freq in the last band must be less than half of sampling frequency (fs). For example if you have the higher frec like 20 KHz the sample rate must be less than 10 KHz. And remember that the Multiband when # of taps is an even number the Amplitude of the last band at of sampling freq (fs) must be 0. If you changed the mode you need to change other inputs as I told you previously.
Regards good look
07-29-2015 09:48 AM
I have both tried using an even number of taps with fs/2 and an odd number of taps with fs/2-delta for the top frequency.
Neither approach worked.
Can Parks-McClellan handle multiple bands? From the help files it looks like it can.
For example, if F={f1,f2,f3,f4,f5,f6}, Af12 = 0, Af34=2, Af56=0, should give a bandpass between f3 and f4, with a diferentiator characteristic, and 0 amplitude elsewhere.
I have ensured that f6=fs/2 if Ntaps even, f6<fs/2if Ntaps odd.
07-29-2015 09:50 AM
I have also tried passing only one band to the differentiator, s.t.
f1=0
f2=fs/2 (Ntaps even)
f2<fs/2 (Ntaps odd)
It still gives an error.
07-30-2015 12:43 PM
What error code are you getting? And what values are you inputing into the band parameters?
Thanks,
Michael
NI Applications Engineering
07-30-2015 01:51 PM
I am getting error code: 20031 - Filter Cannot be designed with the specified values.
I've tried:
fs=1
Amplitude={0,2,0}
F={(0,0.1),(0.2,0.3),(0.4,0.5)}
Weights={1,1,1}
Ntaps=10
I tried moving the corner frequencies around to no effect.
Also tried:
fs=1
Amplitude={2}
F={(0,0.5)}
Weights={1}
Ntaps=10
07-30-2015 05:52 PM - edited 07-30-2015 05:56 PM
As you can see from the screenshot, in LV 2014, the last two settings that you tried didn't give any error. Here, I have used #taps = 40, but 10 also works.
08-04-2015 03:02 PM
Thank you very much, that does work. I must have been providing the settings in an innapropriate way.
Do you have any insight on why increasing the number of taps would cause an Error?
It seems more taps would simply create a more precise filter.