In my previous question I've designed analog butterworth filter (poles own calculated). But now I would like to transform it to digital domain. I'm using bilinear transformation but not all is clear for me. Please look at my script below:
clc, clear all, close all; %ANALOG BUTTERWORTH FILTER DESING %https://engineering.purdue.edu/~ee538/AnalogFilterDesigns.pdf %Butterworth LP with -3dB at fc and N order and G gain wc = 1000; %cut off frequency N = 2; %filter order G = 1; %filter gain %analog filter design with prewarped frequency %poles and zeros %frequency normalizing and prewarping wc = 2*tan(wc/2); %poles searching for k = 0:N-1 sk(k+1) = wc*exp(j*(pi/2))*exp(j*(2*k+1)*(pi/(2*N))); end [NUM,DEN] = zp2tf(,sk,G); b0 = DEN(end)*G %gain normalization Hs = tf(b0,DEN) figure(); freqs(b0,DEN) title('lowpass filter with pre-warped frequency visualization') figure(); plot(sk./10^2, 'x') xlim([-10,10]); title('Poles placement in s-plane') %continuous to digital conversion [NUMD,DEND] = bilinear(b0,DEN,1); fvtool(NUMD,DEND)
I'm sure that is not what I want, because I have nowhere applied frequency sampling that is interesting me. I'm not also sure if I've done prewarping well.