%Task2. M1=0.001;B1=0.1;K1=1. M2=0.001;B2=0.01;K2=1. M3

Added on - Sep 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 1 of 2 pages
%Task2M1=0.001;B1=0.1;K1=1M2=0.001;B2=0.01;K2=1M3=0.001;B3=0.001;K3=1H1=tf([1],[M1 B1 K1])H2=tf([1],[M2 B2 K2])H3=tf([1],[M3 B3 K3])f=0:0.1:100;%Frequancy in Hzw=2*pi*f;%Frequancy in rad/sG1=freqresp(H1,w);Test1=G1(1,1,:)mag_H1=20*log10(abs(Test1(:)));ph_H1=unwrap(angle(Test1(:)));G2=freqresp(H2,w);Test2=G2(1,1,:)mag_H2=20*log10(abs(Test2(:)));ph_H2=unwrap(angle(Test2(:)));G3=freqresp(H3,w);Test3=G3(1,1,:)mag_H3=20*log10(abs(Test3(:)));ph_H3=unwrap(angle(Test3(:)));figure()subplot(2,1,1)plot(mag_H1,'red')holdonplot(mag_H2,'blue')holdonplot(mag_H3,'black')title('Magnitude for H1,H2,H3')subplot(2,1,2)plot(ph_H1,'red')holdonplot(ph_H2,'blue')holdonplot(ph_H3,'black')title('Phase Response for H1,H2,H3')%task3t=[0:1/20000:10]A=1;f1=1;x1=A*sin(2*pi*f1*t);f2=3;x2=A*sin(2*pi*f2*t);f3=5;x3=A*sin(2*pi*f3*t);figure()subplot(3,1,1)lsim(H3,x1,t)
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access