LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does filter change the amplitude of the signal

I am using the function filter in signal analysis in Express to filt a MZI signal which is similar to sine wave with frequency of 10MHz. But after applying the filter, I found the amplitude of the signal is changed (please see attached image). Can anyone explain that? Is there phase shift using that filter function? If the parameters are set up in that filter and the filter is put in a for loop, will the filter be built every time each time the loop run even it is the same filter or Labview remember it and just buid it once?
0 Kudos
Message 1 of 4
(5,773 Views)

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 

Message 2 of 4
(5,758 Views)

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!

0 Kudos
Message 3 of 4
(5,702 Views)

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 

0 Kudos
Message 4 of 4
(5,678 Views)