LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zero phase filtering

Solved!
Go to solution

Hello everyone , 

I'm trying to filter a signal with the VI Zero phase using a normalized set of reverse and forward coefficient that I already calculated using Matlab , but I'm getting Nan as Outputs. 

I already checked my inputs to be sure not to have any Nan in it. 

The zero phase VI seems to work well with other set of coefficients.

 

0 Kudos
Message 1 of 5
(3,315 Views)
Solution
Accepted by topic author AaAymane

Hi Aa,

 

thanks for attaching a VI with some default data!

 

It often helps to plot the data and to limit the amount of data:

check.png

The larger you set the "length" of the input data the larger get the resulting values (0.7m and 2.8m). At around length >=2100 the results become so large you only see NaNs… (Because you reach the max value for DBL datatype!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(3,294 Views)

Hi GerdW, 

 

Thanks for the solution. 

Yet I still find it weird how the outputs reach such large values. With the same coefficients using matlab I get another result completly different ! That's why i didn't check the magnitude of the outputs.

Those coefficients correspond to an 8th order lowpass butterworth filter at 0.35hz taking the frequency sampling as 20hz.

Do you know why such large values appear using this VI ? 

 

Thank you again for your help .

0 Kudos
Message 3 of 5
(3,264 Views)

Hi Aa,

 

your coefficient values look "unusual" to me…

 

Have you read the LabVIEW help for the ZeroPhase filter and have you played with the example VI, which is linked to at the bottom of the help?

Have you tried to generate coefficients as suggested in the LabVIEW help?

 

I did:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(3,247 Views)

Hi GerdW, 

 

Yes I did read LabVIEW Help for the Zerophase filter. I already tried your proposition.

The VI attached shows the error between labview's zero phase filtering and the target.

I think I will try the  Mathscript function y = filter_zerophase(b, a, x).

 

Thanks for your help

 

0 Kudos
Message 5 of 5
(3,170 Views)