I am reading a text book and I wanted to use Matlab to get the same answer as they deerived it in the text. The answer that the Matlab displayed is not the same as the text, please this is the question, my code with result and the expected result from the text. The problem is getting the same Transfer function as it is. Note: Also den2=poles of the TF
Ouestion: Using Bilinear Transformation obtain the transfer function H(z) of the TF below assuming cutt off frequency of 150Hz and sampling frequency of 1.28khz
Transfer function:
1
-----------------
s^2 + 1.414 s + 1
Expected Results:
0.0878 z^2 + 0.1756 z + 0.0878
----------------
z^2 - 1.0048 z + 0.3591
My Code:
fsamp = 1280
%%%%%%Normalize and Prewarp%%%%%%
% Determine the normalized angular
wd=linspace(0,pi,100);
wp1 = 2* pi * ffc / fsamp
% Prewarp the digital edge frequencies
wpa1 = tan (wp1 / 2.0)
[numd, dend] = bilinear (1,den2,fsamp,wpa1);
H3=tf(numd,dend,0.5)
H3=tf(numd,dend,0.5,'variable','z^-1')
my Results:
wpa1 =
0.3857
Transfer function:
0.288 z^2 + 0.576 z + 0.288
---------------------------
z^2 - 2.828 z + 2.98
Sampling time: 0.5
Transfer function:
0.288 + 0.576 z^-1 + 0.288 z^-2
-------------------------------
1 - 2.828 z^-1 + 2.98 z^-2
Any help! Many thanks!
Ouestion: Using Bilinear Transformation obtain the transfer function H(z) of the TF below assuming cutt off frequency of 150Hz and sampling frequency of 1.28khz
Transfer function:
1
-----------------
s^2 + 1.414 s + 1
Expected Results:
0.0878 z^2 + 0.1756 z + 0.0878
----------------
z^2 - 1.0048 z + 0.3591
My Code:
fsamp = 1280
%%%%%%Normalize and Prewarp%%%%%%
% Determine the normalized angular
wd=linspace(0,pi,100);
wp1 = 2* pi * ffc / fsamp
% Prewarp the digital edge frequencies
wpa1 = tan (wp1 / 2.0)
[numd, dend] = bilinear (1,den2,fsamp,wpa1);
H3=tf(numd,dend,0.5)
H3=tf(numd,dend,0.5,'variable','z^-1')
my Results:
wpa1 =
0.3857
Transfer function:
0.288 z^2 + 0.576 z + 0.288
---------------------------
z^2 - 2.828 z + 2.98
Sampling time: 0.5
Transfer function:
0.288 + 0.576 z^-1 + 0.288 z^-2
-------------------------------
1 - 2.828 z^-1 + 2.98 z^-2
Any help! Many thanks!