DSPRelated.com
Forums

Group Delay Calculation Question

Started by j26 February 3, 2011
I implemented a very simple function in Java to calculate the group delay
of a single pole or zero (negate the result and add to sum if zero):

public double getGroupDelay(double radius, double theta, double omega)
{
double num1 = 1-radius * Math.cos(omega - theta);
double den1 = 1 - 2 * radius * Math.cos(omega - theta) + radius * radius;
return (num1 / den1) - 1;
}

This result now agrees Octave grpdelay function for my simple example: 

1/(z - 0.5).  

However, notice that I had to add a -1 offset to the function above.  Can
anyone explain the offset or is my function above wrong?  The pole / zero
is entered in polar coordinates parameterized as radius and theta.
In the frequency domain, phase delay is defined as (phi)/(omega), where (phi) is the phase shift of a signal at frequency (omega) through a network. Similarly, group delay -- which exists only when the curve of (phi) vs. (omega) is relatively flat -- is d(phi)/d(omega), or the slope of that relatively flat part. Whatever domain you choose for defining group delay, it must be consistent with the frequency-domain definition.

Jerry
>In the frequency domain, phase delay is defined as (phi)/(omega), where
(ph=
>i) is the phase shift of a signal at frequency (omega) through a network.
S=
>imilarly, group delay -- which exists only when the curve of (phi) vs.
(ome=
>ga) is relatively flat -- is d(phi)/d(omega), or the slope of that
relative=
>ly flat part. Whatever domain you choose for defining group delay, it must
=
>be consistent with the frequency-domain definition. > >Jerry >
Humm...I may have been misguided in my original question. What would be the best way to measure passband lag of a low-pass filter? I'm actually thinking that phase delay would provide a better measurement. Group delay simply gives the change in phase across frequency (derivative of phase / frequency). It sounds more relevant to measuring distortion than time-domain lag. I realize that minimizing lag (minimizing phase) vs. smoothing (shrinking passband) are competing objectives.
>In the frequency domain, phase delay is defined as (phi)/(omega), where
(ph>i) is the phase shift of a signal at frequency (omega) through a network. S>imilarly, group delay -- which exists only when the curve of (phi) vs. (ome>ga) is relatively flat -- is d(phi)/d(omega), or the slope of that relative>ly flat part. Whatever domain you choose for defining group delay, it must
>be consistent with the frequency-domain definition. > >Jerry >
Humm...I may have been misguided in my original question. What would be the best way to measure passband lag of a low-pass filter? I'm actually thinking that phase delay would provide a better measurement. Group delay simply gives the change in phase across frequency (derivative of phase / frequency). It sounds more relevant to measuring distortion than time-domain lag. I realize that minimizing lag (minimizing phase) vs. smoothing (shrinking passband) are competing objectives.
j26 <ptd26@n_o_s_p_a_m.live.com> wrote:
(snip)

> Humm...I may have been misguided in my original question. What would be > the best way to measure passband lag of a low-pass filter? I'm actually > thinking that phase delay would provide a better measurement. Group delay > simply gives the change in phase across frequency (derivative of phase / > frequency). It sounds more relevant to measuring distortion than > time-domain lag. I realize that minimizing lag (minimizing phase) vs. > smoothing (shrinking passband) are competing objectives.
Well, in optics, for example, group delay gives the delay to modulations of the carrier. If you think in terms of AM and sidebands, which is pretty much also true for amplitude modulated light except that the carrier frequency is much higher, you don't care much at all about phase velocity (the velocity of wave crests), but you do about group velocity, the velocity of the modulation envelope through the medium. In linear media they are equal, but often not equal in non-linear media. If you have, say, a block of transparent material, the delay through it is the thickness divided by the appropriate velocity. So, phase delay and group delay come from phase velocity and group velocity. -- glen
Thanks for the responses, I think I know better now what I'm trying to
ask:

Say I have a discrete time filter defined by poles and zeros.  I start
feeding in a sinusoid of one frequency at time t = 0.  How do I determine
the time lag of the signal on the output?  Assume that I'm measuring from
first crest of input to first crest of output.  I'm looking for an
analytical formula to calculate this based on pole and zero positions.  I
know how I could simulate it.  I was thinking group delay was the formula
that I need, but maybe not.
Thanks for the responses, I think I know better now what I'm trying to
ask:

Say I have a discrete time filter defined by poles and zeros.  I start
feeding in a sinusoid of one frequency at time t = 0.  How do I determine
the time lag of the signal on the output?  Assume that I'm measuring from
first crest of input to first crest of output.  I'm looking for an
analytical formula to calculate this based on pole and zero positions.  I
know how I could simulate it.  I was thinking group delay was the formula
that I need, but maybe not.
>Thanks for the responses, I think I know better now what I'm trying to >ask: > >Say I have a discrete time filter defined by poles and zeros. I start >feeding in a sinusoid of one frequency at time t = 0. How do I determine >the time lag of the signal on the output? Assume that I'm measuring from >first crest of input to first crest of output. I'm looking for an >analytical formula to calculate this based on pole and zero positions. I >know how I could simulate it. I was thinking group delay was the formula >that I need, but maybe not. >
Correction: should have stated sample lag instead of time lag since this is a discrete time case.
>Thanks for the responses, I think I know better now what I'm trying to >ask: > >Say I have a discrete time filter defined by poles and zeros. I start >feeding in a sinusoid of one frequency at time t = 0. How do I determine >the time lag of the signal on the output? Assume that I'm measuring from >first crest of input to first crest of output. I'm looking for an >analytical formula to calculate this based on pole and zero positions. I >know how I could simulate it. I was thinking group delay was the formula >that I need, but maybe not. >
Correction: should have stated sample lag instead of time lag since this is a discrete time case.
On Feb 3, 5:00&#4294967295;pm, "j26" <ptd26@n_o_s_p_a_m.live.com> wrote:
> > Humm...I may have been misguided in my original question. &#4294967295;What would be > the best way to measure passband lag of a low-pass filter? &#4294967295;I'm actually > thinking that phase delay would provide a better measurement. &#4294967295;Group delay > simply gives the change in phase across frequency (derivative of phase / > frequency). &#4294967295;It sounds more relevant to measuring distortion than > time-domain lag. &#4294967295;I realize that minimizing lag (minimizing phase) vs. > smoothing (shrinking passband) are competing objectives.
just so you can get the terms straight, i might recommend looking at the wikipedia article: http://en.wikipedia.org/wiki/Group_delay_and_phase_delay r b-j