Computing group delay directly

3 Ansichten (letzte 30 Tage)
Jackson Peacock
Jackson Peacock am 14 Mär. 2013
Kommentiert: SAM Arani am 12 Mai 2021
In an attempt to better understand group delay, I tried writing simple code to compute it based directly on it's definition, rather than using the existing grpdelay function (with it's fancy efficient DFT based algorithm). My results weren't even close to those found with grpdelay, and I'm trying to figure where I went wrong.
Group delay is defined as the (negative) derivative of phase response, so given the filter coefficients a & b, and sampling rate fs I tried approximating the derivative like so:
[h f] = freqz(b, a, N, fs);
g1 = -diff(unwrap(arg(h)))./diff(f)/(2*pi);
Since arg(h) has units of radians and f has units of Hz, I would expect this to give the group delay in seconds, at each of the frequencies in f. To get the same using built-in matlab commands, I computed
g2 = grpdelay(b, a, f, fs)/fs;
The results of these two are not at all similar. What am I doing wrong?
  1 Kommentar
SAM Arani
SAM Arani am 12 Mai 2021
I happen to have same problem, Have you find the problem yet?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by