LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Fir filter in Labview

Hi guys,

     I generated two singals, their frequencies are 1HZ and 10HZ. The amplitude of the two signals is 1 . Now I want to remove the 10HZ signal, and I choose the FIR Windowed Filter PtByPt.vi .The result was not so ideally, the assigned value of the filtered signal should be 1, but it wasn't . What's wrong ?  Can you help  me? Thanks in advance.signal  before filtersignal before filtersignal  after filtersignal after filter

 

 

  

 

0 Kudos
Message 1 of 5
(3,628 Views)

Hi Tinafan,

 

What's wrong ?

Something in your VI…

(Hint: Why does the time scale/ x axis change by filtering the signal?)

 

 Can you help  me?

Not as long as you don't attach your VI…

 

Best regards,
GerdW


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

UdpRevLV.vi  is my main vi,  used to receive datas from MFC.  

 

The X scale is signal's  period.  ((Hint: Why does the time scale/ x axis change by filtering the signal?) I don't understand your hint)

 

The correct result is : Filtered signal' amplitude  should be 1, at least  close to 1.  But  mine is not 1.

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

I'm not familiar with the data you're getting, but try different values for the low cutoff. Surely this should be between 1-10, not 0.0002? Is the sample rate correct at 10000? These probably have the most impact on the filtered data.

 

Also, you can replace all your logic for the valid data with an "Add Array Elements" function, the output of which you can just wire to your case structure.

 

Also, it looks like you are trying to process all the data 4 bytes at a time, however you request a new data packet each time via UDP. Is this what you want to do?

 

Should you have a stop button for the loop condition? Instead of wiring a false constant to it?

Ian
LabVIEW since 2012
0 Kudos
Message 4 of 5
(3,593 Views)

I have changed the values of the low cutoff.  And the situation seems turned correct. What is the mean of low cutoff? Or what's the relationship with  sample rate? I set the low cutoff frequency equal to 0.0002,  because I see it as normalized frequency .(2 divided by 10000,  that is my reason.)

 

My sample rate is 10000,  I am sure.  I use a timer send datas to  my VI  every 10ms one time,  every time send 100 numbers. 

Thank u for your attention ,I will add a stop button in my while loop.

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