LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Fourier filter problem: attenuation at the end of signal

I'm using Labwindows/CVI 9.0 and the functions WindFIR_Filter and ConvolveEX for my Fourier filter.  All I want to do is take a signal into the program, filter out high frequencies (60Hz+) in the frequency domain, and then reconstruct the signal in the time domain with the high frequencies filtered out.  The problem, I think, is with my implementation because I lose data at the end of a signal that is a non-integer number of cycles and ends away from 0.

 

Here's an image to make this more clear. 

endpoint_attenuation.png

The red line is the raw data, the black the filtered data. At the end of the graph, the black/filtered data is attenuating to 0, while in the red/raw data this does not occur, so it is clearly an artifact. Is this an artifact I can get rid of? I thought this was a problem with my window choice, but I've already tried changing window types and filter sizes, and the results are very similar despite all the combinations I've tried.

 

Description of the filtering approach:

1) Call WindFIR_Filter to create a filter window of 513 points.

2) Call ConvolveEx to convolve window filter with raw data (512 points) in Frequency domain.

3) Resulting convolved waveform is 1024 points, return the relevant part of the convolved waveform by excising points 0-255, and 768-1023.

 

Any thoughts on how to avoid this gradual attenuation back to 0 in the final 14-15 points?

0 Kudos
Message 1 of 3
(3,833 Views)

Obscura,

 

You noted that you tried a number of window types and filter sizes.  Does that include changing the number of coefficients on the WindFIR_Filter function?  If you increase the number of coefficients, you may come up with a more accurate filter.

 

If that doesn't help, it'd be great if you could post your dataset.  That way, I could try different filtering methods to see if  I could get one that seems to match a little closer to your data.

Eric B.
National Instruments
0 Kudos
Message 2 of 3
(3,808 Views)

Yup, when I said filter sizes, I meant the number of coefficients.

 

But I fixed the problem by padding the beginning and end of the signal with repeats of the first and last data points. I think because of the window, losing a bit of information at the beginning and end of the signal is inevitable.

0 Kudos
Message 3 of 3
(3,775 Views)