Hello,
I’m trying to understand LabVIEW filters and the application of point by point filter and a nom PtByPt filter.I attached an example where I applied two Butterworth filters (one is a PtByPt and another isn’t) to the same signal. My problem is, the filtered results should be the same and in this example they aren’t. Can anyone, please tell me what is wrong in my code?
here is a small but important change ![]()
Make yourself familar on how numerical filter work.ALL filters have some kind of memory , if not every single value represent just a DC value ![]()
The pt by pt filters are nice if you want a pt. by pt update of a value while you have a not so fast samplerate.
Hi Henrik,
can't backsave to 7.0, so here is a picture. Basically i wrapped the ptbypt filter with a loop and swapped it with the index.
The difference is in the range of e-17
uups a bug in vi snippet? the input cluster for the sine waveform should be filled with your values....
Thanks alot for your reply, It works very well. ![]()
Risul wrote:Thanks alot for your reply, It works very well.
But still, why I can’t apply the PtByPt filter to a single value as I did in my first example??
See my first answer.
Dear Henrik_Volkers,
I am wondering about choosing the sampling rate (fs) and the cutoff frequency (fc) of the Butterworth filter (one is normal and the other is a point by point mode). Could you please see the Figure below (I modified your program)?
For the normal filter, I choose fs = 1000Hz, fc = 10Hz.
For the PtbyPt filter, I choose fs = 1Hz and fc = 0.01Hz. Here I consider one point of the input of the filter will create one point of the output of the filter. So the fs of the filter must be one calculation per loop at the time T= 1/sampling rate of the input signal (the filter is in the FOR LOOP).
--> It means that the sampling rate of the Butterworth filter is 1Hz at each the time T = 1/1000Hz (1000Hz = sampling rate of the input signal). Of course, for 1Hz of sampling rate of the filter I choose fc = 0.01(Hz). It corresponds fc/fs = 0.01/1 = 10/1000.
The simulation results in two cases are the same.
So, fc = 0.01(Hz) and fs = 1Hz for the PtbyPt filter at the time T = 1/1000Hz are correct in principle, aren't they?
Thank you.
Dong
Hey, you found out that for numerical filters the ratio of fc/fs is the important fact
In numeric signal processing you often normalize fs to 1
,
in that case both filters behave the same (for the numerical array).. even if in your vi the filter artifact at the beginning looks different, but that's because of different filter init conditiotions in your vi (loop) .. should be the same in the first run ![]()
Dear Henrik_Volkers,
Thank you very much for your replying.
At each time kT (T = 1/sampling rate of the input signal, k is an integer), can I say the sampling rate of the Butterworth (Point by point mode) is 1Hz and its cut off frequency is 0.01Hz for the situation one calculation per loop in the FOR LOOP? Is my saying correct?
Of course, the ratio fc/fs is very important.
Thanks.
Dong
Sorry. I didn't get what you wan to say/achieve...
Some basic lectures on digital signal processing/digital filter design are always a good idea if you deal with data aquisition ![]()
(mine are about 30a ago
)