2
$\begingroup$

I have a doubt regarding the total delay in terms of taps for cascade filters.

Imagine that I have an SOS IIR Filter (2 delays) and an FIR filter of 10 taps (10 delays) and another of 20 taps (20 delays). The total delay of the group is 20 + 10 + 2=32 delays or is it the maximum of all of the as the sample does travel along the net.

I guess, if my rationale is not wrong, that the steady state response of the whole net is reached at the sum of all of them as you need to have stable output from first stage, then second stage and then third stage.

$\endgroup$
1
  • 1
    $\begingroup$ In my opinion, the "total delay" of the cascade of a bunch of linear, time-invariant filters, whether they be IIR or FIR, is simply the sum of the delays of each filter in the series, however that delay is defined. Total Group Delay is the sum of the individual group delays of each filter. Total Phase Delay is the sum of the individual phase delays of each filter. If the IIR filters are designed to maximize the phase linearity and if the FIR filters are symmetric about the mid-sample of the FIR impulse response, this overall total delay will be roughly constant for most frequencies. $\endgroup$ Oct 5, 2023 at 17:26

2 Answers 2

1
$\begingroup$

The throughput, like Marcus said, is $1$, since for each input sample there’s an output sample (unless you’re doing block processing, which I’m assuming you’re not).

As far as group delay, it is the sum of the individual group delays for each filter (if they're LTI!)

Here's an example:

enter image description here


Matlab code to reproduce:

N1 = 10;
N2 = 20; 
h1 = fir1(N1, 0.8); % FIR1
h2 = fir1(N2, 0.2); % FIR2
[b,a] = butter(4, [0.4, 0.6], 'bandpass'); % IIR

imp = [1, zeros(1, 500)]; % Impulse
    
% impulse response of the cascade
out = filter(h1, 1, imp);
out = filter(h2, 1, out);
out = filter(b, a, out);

% individual group delays
[g1, w] = grpdelay(h1,1);
g2 = grpdelay(h2,1);
g3 = grpdelay(b,a);

% group delay of the impulse response
gout_imp = grpdelay(out,1);

% sum of individual group delays
gout_sum = g1+g2+g3;

figure
hold on
plot(w/pi, g1)
plot(w/pi, g2)
plot(w/pi, g3)
plot(w/pi, gout_imp, 'linewidth', 2)
plot(w/pi, gout_sum, 'linewidth', 2, 'linestyle','--')
legend('FIR1', 'FIR2', 'IIR', 'cascade', 'sum of individual group delays')
grid on
ylim([0 35])
xlim([5e-3, 1])
xlabel('normalized freq (\times\pi rad/sample)')
ylabel('Group delay (samples)')
$\endgroup$
3
$\begingroup$

No, this is not correct. The actual delay that you describe depends on the signal component's frequency and on the actual filters implemented using these delays! The technical term you need to research here is group delay.

Also, nothing says this system with IIRs even has a steady-state response. Hint: if you give an impulse to a system that is IIR, then that system will have Infinite Impulse Response. There's no point at which the system will be "done" handling the effects of that single non-zero sample that you inserted in an endless stream of zeros.

$\endgroup$
10
  • 1
    $\begingroup$ What I have described might be the sample delay? or how that is called $\endgroup$ Oct 5, 2023 at 11:23
  • 1
    $\begingroup$ you described group delay, as far as I understand your question, and misunderstood it! think about this: in your SOS IIR, your sample gets "fed back". So, how long does it take to travel through that? Right, it takes anywhere from 2 delays to infinity. It doesn't necessarily produce any "first output" after 2 delays, either, because it might cancel with the 2 samples after it. That's the thing – you need to look at the frequencies of your signal and at the group delay at that frequency. $\endgroup$ Oct 5, 2023 at 11:27
  • 1
    $\begingroup$ Right, that's clear. Great. Then, the "system" delays, or the number of taps the filter needs to fill the buffer, does it have a name for it? $\endgroup$ Oct 5, 2023 at 11:47
  • 1
    $\begingroup$ do you mean throughput? That'd be 1, because your filters consume one sample each iteration, I'd say, and one sample comes out per iteration. Honestly, bit confused by what you want to describe – does this have to do with your assumption of a steady-state response? $\endgroup$ Oct 5, 2023 at 11:59
  • 1
    $\begingroup$ Let me elaborate on that. the filters have a length in taps. For example, for the filter of 10 taps, it takes 10 samples to fill the buffer. Is that ammount of time for filling the buffers connected to any measure, metric or terminology? $\endgroup$ Oct 5, 2023 at 14:14

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.