From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView Parks-McClellan FIR Differentiator

Solved!
Go to solution

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?

 

0 Kudos
Message 1 of 8
(5,817 Views)

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

0 Kudos
Message 2 of 8
(5,762 Views)

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.

 

 

0 Kudos
Message 3 of 8
(5,740 Views)

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.

 

0 Kudos
Message 4 of 8
(5,739 Views)

What error code are you getting? And what values are you inputing into the band parameters?

 

Thanks,

 

Michael

NI Applications Engineering

 

0 Kudos
Message 5 of 8
(5,715 Views)

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

 

0 Kudos
Message 6 of 8
(5,709 Views)
Solution
Accepted by danstiurcaFC

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.

differentiator_PM.png

 

BR
Message 7 of 8
(5,695 Views)

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.

0 Kudos
Message 8 of 8
(5,625 Views)