0
$\begingroup$

I designed an FIR highpass filter which is causing a phase shift to the output. The output signal is also not stable (?) on start. Are these normal or am I doing something wrong? If these are normal, what causes these? (Attached is a diagram showing the input in blue and the output in red).enter image description here Thanks.

$\endgroup$
2
1
$\begingroup$

This is perfectly normal. At the beginning you see the transient effect because the signal suddenly starts and the filter was at rest before (zero initial condition). A causal filter will always add some phase shift to your signal. This phase shift is usually frequency dependent, but for a linear phase FIR filter the resulting delay is independent of frequency.

If $H(e^{j\omega})$ is the frequency response of the filter and $\phi(\omega)=\arg\{H(e^{j\omega})\}$ is its phase response, then the phase shift experienced by a sinusoid with frequency $\omega_0$ is simply $\phi(\omega_0)$, i.e. the corresponding time delay equals $-\phi(\omega_0)/\omega_0$.

$\endgroup$
2
  • $\begingroup$ Matt - The phase shift is linear with respect frequency and therefore not independent of frequency $\endgroup$ – David May 13 '15 at 17:26
  • $\begingroup$ @David: You're right, I meant the delay. Will edit it ... thanks. $\endgroup$ – Matt L. May 13 '15 at 17:31
0
$\begingroup$

A digital filter always has a delayed output. Think of the FIR filter as a shift register. At each time instant, all samples are shifted; one new sample enters the filter and the last sample is discarded. This introduces a delay as the the samples propagate through the filter. The important property of a (linear phase) FIR filter is that all frequencies are delayed by the same amount.

What you're seeing at the beginning of the output is normal and is also related to the structure of the FIR filter. At the start, the shift register is loaded with zeros. This produces a "transient" response. As more and more samples enter the filter, the output becomes more meaningful. Usually, you should wait until the filter is at least half full before evaluating its output.

$\endgroup$
6
  • $\begingroup$ Thanks for the replies. Are there ways to improve the phase shift and the transient effect? $\endgroup$ – dritech May 13 '15 at 15:50
  • $\begingroup$ What do you mean by 'improve'? If you want to reduce the length of the transient effect, then you need to reduce the order of the filter, but this will also reduce its effectiveness. Note, however, that in most applications the delay and the transient effect are not a problem. $\endgroup$ – MBaz May 13 '15 at 15:53
  • $\begingroup$ @dritech: Not in real-time processing. With offline-processing you're of course free to do what you like, such as throw away the first samples (transient), and shift the output to align with the input. $\endgroup$ – Matt L. May 13 '15 at 15:53
  • $\begingroup$ Also, can the filter affect the signal amplitude in any way? $\endgroup$ – dritech May 13 '15 at 15:58
  • $\begingroup$ @dritech, of course, that's the whole point of the filter. The output's amplitude depends on the input's frequency. $\endgroup$ – MBaz May 13 '15 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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