Why do I receive different results when comparing a digital filter designed using the BUTTER and BILINEAR functions in the Signal Processing Toolbox? Using the following specifications: Fs = 172800; Fc = 70000; where "Fs" represents the sampling frequency and "Fc" represents the cutoff frequency, I created a digital filter in two different ways: 1. Using the BUTTER function. [B ,A] = butter(4,Fc/(Fs/2)); 2. Using the BILINEAR function to convert the analog filter designed using the BUTTER function into a digital filter through a bilinear transformation. [Bs,As] = butter(4,Fc*2*pi,'s'); [Bz,Az] = bilinear(Bs,As,Fs); I then used the FVTOOL function to compute the magnitude response and compared the two results: fvtool(B,A,Bz,Az); Notice that the results of the two magnitude responses are not the same even though I am using the same specifications.
Prashant Kumar answered .
2025-11-20
Wc = tan(pi/2*Fc/(Fs/2)); % Analog prewarped freq. rad/second
[Bs,As] = butter(4,Wc,'s');
Now the issue is what sampling frequency (Fs) to use with BILINEAR. In the prewarping method used to compute "Wc", we implicitly used the bilinear transformation that is most commonly seen in the literature:
s=(1-z^(-1))/(1+z^(-1)).
In the BILINEAR function documentation, the following transformation is used:
s = 2*Fs*(z-1)/(z+1)
s = 2*Fs*(1-z^(-1))/(1+z^(-1)).
[Bz,Az] = bilinear(Bs,As,.5);
fvtool(B,A,Bz,Az);
Note that if you are uncomfortable with using a different "Fs" for the bilinear transformation, you could use the same "Fs" throughout if you take that into account when prewarping as follows:
Wc = 2*Fs*tan(pi/2*Fc/(Fs/2)); [Bs,As] = butter(4,Wc,'s'); [Bz,Az] = bilinear(Bs,As,Fs); [B ,A] = butter(4,Fc/(Fs/2)); fvtool(B,A,Bz,Az);
A similar discussion can be found in the documentation by typing the following command in MATLAB 7.0.4 (R14SP2):
web([docroot,'/toolbox/signal/filter15.html'])