I studying effects of digital filters group delay (IIR). In Matlab there is a function grpdelay which allows for particular frequency get a value of delay in samples
But after filter applying and comparing of pictures there are diffent results. In rude words if I expect 50 samples delay under grpdelay analysis, in fact I see 100 samples, If I expect 30, I see 70 and so on. What I doing wrong? I use simple sin processed gauss window for example
clear; close all; t = 0:0.008:600; x = sin( 2 * pi * t * 1.3 ) .* gausswin(length(t) )'; x = [ zeros(1, 1000) x zeros(1, 1000) ]; fs = 125; fc_low = 0.5; fc_high = 3; order = 4; [b,a] = butter(order, [ fc_low/(fs/2), fc_high/(fs/2) ] ); y = filter(b, a, x); plot(x) hold on; plot(y) legend('orig', 'filtered') figure; grpdelay(b, a, 512, fs);
below there is example of theoretical and model misfitting
So, the result is that Matlab function
grpdelay gives not accurate results or I have errors in calculation/interpretation ?