PDA

View Full Version : Using freqz and bilinear matlab


rusty009
Nov3-11, 07:33 PM
I have made my analogue butterworth filter in matlab and am converting it to digital using bilinear with this code,


[num,den] = butter(n,wc,'s');
[numd,dend]=bilinear(num,den,Fs)
% Compute and plot the frequency response
omega = [0: 100: 12000*pi];
h = freqz(numd,dend,omega);
plot (omega/(2*pi),20*log10(abs(h)));
xlabel('Frequency, Hz'); ylabel('Gain, dB');


n and wc have been defined but I am getting a reall weird result and I don't know why, think it is because of omega, can anyone help ?