1
$\begingroup$

In order to get a better feel for phase response and how it applies across the field of dsp, I'm looking for example scenarios where a filter's phase response is a concern and where it is not.

Take for example the attached figure I've made. The graph compares an analog RC low-pass filter (S) with both its digital IIR conversion (RC) and the Exponential Moving Average (EMA). It is based on a samplerate of 16 khz. I'm including both the phase and magnitude responses, as it seems quite evident that only having one would tell only half the story.

The EMA's phase response notably deviates from both RC filters at 1/80 of the Nyquist rate, or in this case ~100Hz.

When and why might this phase response be an issue, and when not? I ask to better understand how to consider phase response when implementing filters.

While audio is a notable interest of mine, I'd like to be shown examples across the dsp field, mundane or elaborate and everything in between, is welcome.

Phase response of an Analog RC Filter (s) compared with its digital conversion (RC) and EMA filter. Graphed at a samplerate of 16khz. The cutoff frequency was specified at 50 Hz.

Magnitude response of an Analog RC Filter (s) compared with its digital conversion (RC) and EMA filter. Graphed at a samplerate of 16khz. The cutoff frequency was specified at 50 Hz.

P.S. not to be off topic, but any tips to improve my graphs would also be welcome in comments.

$\endgroup$
1
  • $\begingroup$ The company I used to work for started removing FIR filters as they introduce pre-echo artefacts. When the signals kind of look like impulse responses an FIR filter might not be the best kind of filter. Other signal processing techniques can be more appropriate to extract the data (IIR filters, cross-correlation, etc.) $\endgroup$
    – Ben
    Commented Mar 18, 2023 at 20:23

2 Answers 2

2
$\begingroup$

Divide the filter's frequency response in two parts: a passband (the portion of the input that should be present in the output), and a stopband (the portion of the input that should be rejected).

In general, a filter must not distort the signal in the passband. This requires a flat magnitude response, and (relevant to your question) a linear phase response.

What happens outside the passband is not of much concern. Signals in the stopband may be distorted by the filter, since they are much attenuated at the output and not of interest.

In practice, filters have a transition band between passband and stopband; what happens here depends on your specific requirements. A compromise must be made between filter complexity, delay, stopband flatness, width of the transition band, phase linearity, etcetera.

Also in practice, some applications can tolerate some amount of phase distortion, which allows some leeway in the design of the filter (for example, using IIR instead of FIR filters). Audio is such a case, since the human ear is somewhat insensitive to phase.

These are just some general considerations that hopefully will point you in the right direction.

$\endgroup$
3
  • 2
    $\begingroup$ Mega Baz answers bazz's question. :-) $\endgroup$
    – Peter K.
    Commented Mar 18, 2023 at 18:12
  • $\begingroup$ I hadn't even noticed! ;-D $\endgroup$
    – MBaz
    Commented Mar 18, 2023 at 18:54
  • $\begingroup$ I love that, hahaha! :D $\endgroup$
    – bazz
    Commented Mar 18, 2023 at 19:47
2
$\begingroup$

One audio example: The human ear is quite insensitive to monaural phase but quite very sensitive to interaural phase.

Let's make a stereo signal by simply duplicating a mono signal. If you apply a (reasonable) allpass filter to both channels and play it back via headphones the original and the filtered one will sound the same. If you apply the filter to only one channel, it will sound very different from the original.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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