What are the advantages to using direct form 2 in a software implementation of a filter? There must be some because it is not as straight forward to implement as direct form 1 and is represented by a less intuitive difference equation. Any disadvantages?
I have read that there are numerical differences between these two when precision is finite (e.g. when writing a software filter) but I am not sure what these are. Can someone explain them?
Many thanks.
why use direct form 2?
-
- KVRAF
- 1538 posts since 14 May, 2004 from Europe
Have a look here:
http://www.musicdsp.org/archive.php?classid=3#174
If you compare it:
you obviously only have to save two state variables.
Both do have 5 multiplications and 4 additions/substractions
Actually it is the transposed direct form II. The non-transposed has the disadvantege, that poles are located on the input side. Then it might happen that you will get an internal overflow.
The transposed form exchanges input and output and then you will get the zeroes at the input.
Generally you can say:
a) An Addition/Substraction will change the internal decimal places by max. 1 bit.
b) multiplication will change the internal decimal places by 2M
c) copying a state variable will truncate the internal decimal places from 2M to M (length of the mantissa)->Quantisation noise
If you now compare direct form I with the transposed direct form II with the states above by modeling the noise sources, you will see that the SNR of Direct form I is 6dB lower.
(purly translated from the diploma thesis of Rainer Thaden, http://www.akustik.rwth-aachen.de/~rain ... om_rth.pdf)
For more information you might want to have a look at: Performance of Cascade and Parallel IIR Filters (W. Chen, J. Audio Eng. Soc., Vol. 44, No. 3, 1996 March)
Happy filtering,
Christian
http://www.musicdsp.org/archive.php?classid=3#174
If you compare it:
Code: Select all
out = a0*in + a1*h0 + a2*h1 - b1*h2 - b2*h3;
h1 = h0;
h0 = in;
h3 = h2;
h2 = out;
becomes
out = a0*in + d0;
d0 = a1*in - b1*out + d1;
d1 = a2*in - b2*out;
Both do have 5 multiplications and 4 additions/substractions
Actually it is the transposed direct form II. The non-transposed has the disadvantege, that poles are located on the input side. Then it might happen that you will get an internal overflow.
The transposed form exchanges input and output and then you will get the zeroes at the input.
Generally you can say:
a) An Addition/Substraction will change the internal decimal places by max. 1 bit.
b) multiplication will change the internal decimal places by 2M
c) copying a state variable will truncate the internal decimal places from 2M to M (length of the mantissa)->Quantisation noise
If you now compare direct form I with the transposed direct form II with the states above by modeling the noise sources, you will see that the SNR of Direct form I is 6dB lower.
(purly translated from the diploma thesis of Rainer Thaden, http://www.akustik.rwth-aachen.de/~rain ... om_rth.pdf)
For more information you might want to have a look at: Performance of Cascade and Parallel IIR Filters (W. Chen, J. Audio Eng. Soc., Vol. 44, No. 3, 1996 March)
Happy filtering,
Christian