LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Applied Matlab Filter

Good afternoon everyone.
I do not have much experience with Labview and I'm having trouble converting a code I developed into Matlab in Labview. The Matlab code lines are the following:

 

order = 1;
filtCutOff = 0.6;
[b, a] = butter(order, (2*filtCutOff)/(1/samplePeriod), 'high');
FiltSignal = filtfilt(b, a, Signal);

 

I don't know the type of filters that I must apply.
Can somebody help me

Thanks since now.

Greetings.

0 Kudos
Message 1 of 4
(2,925 Views)

so there might be some ppl knowing matlab,

but since this is labview, you are asking for help, you might be so good to explain what these matlab functions do, as in their signatures as well as their outputs.

 

also have you searched labview for 'butterworth' or 'zero phase'?

 

and regarding your math, you might use  "2*cutoff*samplePeriod"


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 2 of 4
(2,896 Views)

Thank you for your answer. 

About the explanation of the Matlab functions do:

Butter is the calculus of the coheficients Butter filter. 

Filtfilt is a Zero-phase forward and reverse digital IIR filtering.

My principal problem, is that the program done in Matlab and in Labview don't produce the same results and I don't know if I am translate correctly the program. 

0 Kudos
Message 3 of 4
(2,881 Views)

You do appear to have a filter that appears to be a Butterworth Filter -- of course, with a picture of your VI, we can't easily verify that you have the right function.  Do you know how to make a LabVIEW Snippet, a .PNG that we can paste into a LabVIEW Block Diagram and get it to turn into code?  [Or you could attach your VI, itself ...].

 

So the main issue is that the MatLab routine implements a "phase-less" Filter by taking the data, running it through the Filter, then reversing it, running it through again and averaging the results.  You should read up about this technique to be sure you understand it and what it means.  [Such filters cannot be realized with "real" components as it requires being able to predict the future, and we don't yet have the appropriate Capacitors and Resistors to do this ...].

 

Bob Schor

0 Kudos
Message 4 of 4
(2,865 Views)