0
$\begingroup$

I mean what for the window FIR filter the filtered signal is truncated at the end because impulse response of the filter is symmetric. For example the code from here (in python) (lowpass FIR filter) gives the next results:

color meanings:

blue - input signal
green - shifted filtered signal
red arrow - the end of the filtered signal

enter image description here

The red arrow shows where the filtered signal is ended. How can I implement the zero - phase or nearly zero - phase filter so what the filtered signal would end at the same point in time as the original one? The end of the filtered signal is of most significance.

Thanks.

$\endgroup$
0
$\begingroup$

You can either gather more data at the end than you need for output, or zero pad past the end of your data with at least half the length of your zero-phase filter.

If you can’t get data past the “ends”, and don’t like the artifacts from zero-padding, then you might try other reasonable assumptions (circularity, continuity, etc.) depending on your model.

$\endgroup$
  • $\begingroup$ Thank you, but this is not the option. I should have the end of the filtered signal. I need something like half-window filtering. $\endgroup$ – user38481 Feb 9 at 2:24
  • $\begingroup$ A half window filter would either not be zero phase (thus the ends would be filtered differently/distorted compared to the rest), or would be the same as adding (zero or other) padding to the ends. $\endgroup$ – hotpaw2 Feb 9 at 4:10
  • $\begingroup$ Maybe a minimal phase filter then? I do not think padding the signal is a sound idea - too mach of distortion. $\endgroup$ – user38481 Feb 9 at 4:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.