# Calculate the time delay introduced by group delay for IIR-Filters

First of all, let me show what I mean by a simple example of an FIR-Filter:

I designed an FIR-Filter with a constant group delay of 323 samples and my sampling rate is 500 Hz. Now I can calculate the time delay by this filter with 323/(500 Hz) = 0.646s.

An IIR notch filter has a frequency dependent group delay and I am interested in the time delay around 50 Hz.

We know the group delay is around 2.5 samples at 50 Hz and we sample with 500 Hz. Can I do the same calculation as before? This means the time delay for 50 Hz is 2.5 samples/500 Hz = 5ms.

I am not sure but I think the correct calculation is with fs/2, that means it's 2.5/250 = 10ms.

## 2 Answers

If you want to compute the delay experienced by a sine wave at a given frequency $$\omega_0$$, then it's not the group delay but the phase delay that you need to consider. In the case of linear phase FIR filters the phase delay and the group delay are identical, but in the general case they aren't.

The phase delay is defined by

$$\tau_p(\omega)=-\frac{\phi(\omega)}{\omega}\tag{1}$$

where $$\phi(\omega)$$ is the frequency dependent (unwrapped) phase of the system's frequency response. Clearly, if $$\phi(\omega)=c\cdot \omega$$ with some constant $$c$$, then the phase delay $$(1)$$ equals the negative derivative of the phase, i.e., group delay and phase delay are equal.

Of course, the (de-)normalization by the sampling frequency is always done in the same way. If $$\omega$$ is normalized, then you get the phase delay in samples, otherwise in seconds.

EDIT:

The response of an LTI system with frequency response $$H(\omega)=M(\omega)e^{j\phi(\omega)}$$ to a sinusoidal input signal $$x(t)=A\sin(\omega_0t+\theta)$$ is given by

\begin{align}y(t)&=AM(\omega_0)\sin(\omega_0t+\theta+\phi(\omega_0))\\&=AM(\omega_0)\sin\left[\omega_0\left(t+\frac{\phi(\omega_0)}{\omega_0}\right)+\theta\right]\end{align}\tag{2}

So the delay experienced by $$x(t)$$ is given by $$\tau_p(\omega_0)$$ as defined in $$(1)$$.

• Matt, are you saying that the group delay solution at a specific frequency cannot be used to predict the relative phase between the input and output for a sinusoidal input at that frequency? Apr 1, 2020 at 15:51
• @DanBoschen: Yes, the phase shift of a sinusoid is given by the phase delay at that frequency, not by the group delay. Of course, there are cases where phase delay and group delay are equal, but in general it's the phase delay that predicts the delay of a sinusoid. Apr 1, 2020 at 16:53
• I'd be interested in seeing a case where the phases were not equal. Of course the group delay is not the actual time delay since it can be leading or lagging at any particular frequency, but I was under the impression that as far as a phase shift, it would always match. Apr 1, 2020 at 16:55
• @DanBoschen: I'm not sure if there is a misunderstanding here, but check out my edited answer. The delay of a sinusoid is always given by the phase delay, and generally not by the group delay (unless of course group delay and phase delay are the same, as is the case for type I and type III linear phase FIR filters). Apr 2, 2020 at 10:50
• Yes thank you very helpful. I now see that it couldn't necessarily match. Apr 2, 2020 at 12:07

If you know the group delay in sample periods, yes, division by the sample rate is how you convert samples to time. It really doesn't matter what kind of sample-measured time you apply that to: that's an inherent property of sampling, not of group delays or group delays of linear-phase filters.

I don't know where your fs/2 calculation comes from, but it's wrong.

• Thank you thats helpful. I was thinking of fs/2 because iam using MATLAB to plot my group delay. They are refering to the nyquist frequency i think. But iam not sure mabye i mix things up. Apr 2, 2020 at 20:23