# Bandpass overshoots at the beginning and end of signal: why?

The picture below shows the original data in the upper figure and the filtered data in the figure below. The filter applied to the original data is a simple bandpass implementation:

$H(z) = \frac{0.2 + 0.1z^{-1} - 0.1z^{-3} - 0.2z^{-4}}{1-0.98z^{-1}}$ (Relative Spectral Processing Filter)

As you can see, at the beginning of the data and at the end the filtered signal overshoots / undershoots sharply.

So far I experimented with a) adding random noise to the original signal and b) removing leading / trailing zeros but those are just my own ideas without any reference for a thesis. So my question is:

How would this problem be handled in digital signal processing?

+++++++++++

If you're interested: Removing leading / trailing zeros reduced the problem (original overshoot is ~40, now it's around 12 which is still the highest value in the filtered signal) and adding random noise reduced the problem even further but the signal is noisy now (which is a unfavorable tradeoff, isn't it?)

## 2 Answers

Well what you see is the transient response of your filter. Your signal looks a bit a like a step signal at the beginning. At the end, you have a negative step, thus you will get another transient that will be the opposite of your first transient.

Plot the step response of your filter and compare the results.

Then ask yourself why does it respond that way?

• Well I understand that the transient response is what makes the filter behave that way but what can I do about it?
– Alon
Jun 13, 2018 at 15:10
• Depends, is this an offline application? Real-time? Will you often have "varying" quasi-DC ? Do you really need a bandpass? Why not simply use a low-pass filter with the same cut-off frequency as your bandpass. ?
– Ben
Jun 14, 2018 at 18:22

A non-rectangular window might reduce the transient response between your data and your zero padding.

Another thing you might try is to pad with the average magnitude of your data instead of zeros.