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'])
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Explore similar technical troubleshooting questions and verified MATLAB solutions: