03-26-2012 05:28 AM
How many samples does the pt-by-pt filter need to function? How does it work? Or how can I measure the lag caused by a pt-by-pt filter? I don't understand how it can filter in real-time.
Thanks
Graham
03-27-2012 04:50 AM
Hey Graham
Im going to use the butterworth ptbypt vi as a reference for this. Are you aware that you can open these vi's up to see how they work? The butterworth from what I can work out has a few shift registers that values need to filter through before a value is passed out.
In this example then there will be a lag created by this that is measurable by benchmarking the sub vi using tick count. Have you come across doing this before?
In regards to the number of samples needed, In this example there are 5 shift registers involved in the averaging code so I assume 5 samples are needed.
Hope this helps
03-28-2012 03:09 PM
Graham,
Any filter has a delay associated with it. The delay is a function of the bandwidth, filter type, and filter order. One way to measure the delay of a software filter is to feed it an array with zero elements followed by a continuous sinusoidal signal with a frequency in the pass band of the filter. Look at the output and observe the point where it becomes nonzero. The difference between the number of zero elements at the beginning of the data set and the number in the output is the delay. The transient response is show by the output signal varying in some manner before settling to a steady state signal. The steady state output signal compared to the input signal will show any phase shift or passband attenuation.
The way the pt-by-pt VIs work in "real time" is that after the delay and transient portions have passed, each time a new input sample is received the VI generates a new output sample. The output sample is still delayed, the same as in a hardware filter.
Lynn