09-30-2008 01:29 PM
09-30-2008 02:23 PM
sophia 2008,
I can only guess since it is impossible to tell what frequency the original signal contains from the graph.
1. The first part of the signal is outside the bandwidth of the filter. (If so, the filter is working.)
2. All filters have some time delay and an initial transient when the signal is first applied. (The three little ripples are shifted to the right about 5E-6.)
3. The filter bandwidth is pretty narrow so some ringing is to be expected. (The tapered tail at the end)
I have not looked at the filter Express VI, but in general Express VIs are not optimized for use in loops or code which needs to be efficient in time or memory. You can open the front panel of the VI an then the block diagram to look at the code.
Lynn
10-02-2008 11:33 PM
Lynn,
Thank you for your help! Since I see phase shift when I use filter function in Express, do you know what function that I can use to filter with no phase shift just like the filtfilt function in Matlab? Thank you!
10-03-2008 07:30 AM
Most filters have some phase shift and it often varies with frequency. One way to compensate for phase shift is to follow your bandpass filter with an allpass filter. The bandpass filter controls the amplitude as a function of frequency and adds phase shift. The all pass filter has constant amplitude over frequency but varying phase. After specifying the bandpass filter the all pass filter is designed to have the opposite phase shift over frequency as the bandpass filter, thereby canceling the overall phase shift. Most books on filters have a section on allpass filters.
I do not recall whether LV has an allpass filter VI, but the transfer function from a book could be implemented in LV.
Lynn