⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c.m

📁 输入脉冲序列
💻 M
字号:
%default T = 1;

w=logspace(1,2,40);
s= tf('s');
h1 = (1/(s+1));
h1a=((1/5)/s+1/5);
h1b = (5/(s+5));

h2 = (1/(s+1))^2;
h2a = ((1/5)/(s+1/5))^2;
h2b = (5/(s+5))^2;

h5 = (1/(s+1))^5;
h5a = ((1/5)/(s+1/5))^5;
h5b = (5/(s+5))^5;

h10 = (1/(s+1))^10;
h10a=((1/5)/(s+1/5))^10;
h10b=(5/(s+5))^10;

t=0:0.01:100;
x1=rectpuls(t)+rectpuls(t-1)-rectpuls(t-2)+rectpuls(t-3)+rectpuls(t-4);
x2=rectpuls(t)-rectpuls(t-1)+rectpuls(t-2)-rectpuls(t-3)+rectpuls(t-4);
y1=lsim(h1,x1,t);
y2=lsim(h1a,x1,t);
y3=lsim(h1b,x1,t);
y4=lsim(h2,x1,t);
y5=lsim(h2a,x1,t);
y6=lsim(h2b,x1,t);
y7=lsim(h5,x1,t);
y8=lsim(h5a,x1,t);
y9=lsim(h5b,x1,t);
y10=lsim(h10,x1,t);
y11=lsim(h10a,x1,t);
y12=lsim(h10b,x1,t);

figure;
subplot(4,1,1),plot(t,x1);
subplot(4,1,2),plot(t,y1);title('input = 11011, N = 1, RC = 1');
subplot(4,1,3),plot(t,y2);title('input = 11011, N = 1, RC = 5');
subplot(4,1,4),plot(t,y3);title('input = 11011, N = 1, RC = 1/5');

figure;
subplot(4,1,1),plot(t,x1);
subplot(4,1,2),plot(t,y4);title('input = 11011, N = 2, RC = 1');
subplot(4,1,3),plot(t,y5);title('input = 11011, N = 2, RC = 5');
subplot(4,1,4),plot(t,y6);title('input = 11011, N = 2, RC = 1/5');

figure;
subplot(4,1,1),plot(t,x1);
subplot(4,1,2),plot(t,y7);title('input = 11011, N = 5, RC = 1');
subplot(4,1,3),plot(t,y8);title('input = 11011, N = 5, RC = 5');
subplot(4,1,4),plot(t,y9);title('input = 11011, N = 5, RC = 1/5');

figure;
subplot(4,1,1),plot(t,x1);
subplot(4,1,2),plot(t,y10);title('input = 11011, N = 10, RC = 1');
subplot(4,1,3),plot(t,y11);title('input = 11011, N = 10, RC = 5');
subplot(4,1,4),plot(t,y12);title('input = 11011, N = 10, RC = 1/5');

y13=lsim(h1,x2,t);
y14=lsim(h1a,x2,t);
y15=lsim(h1b,x2,t);
y16=lsim(h2,x2,t);
y17=lsim(h2a,x2,t);
y18=lsim(h2b,x2,t);
y19=lsim(h5,x2,t);
y20=lsim(h5a,x2,t);
y21=lsim(h5b,x2,t);
y22=lsim(h10,x2,t);
y23=lsim(h10a,x2,t);
y24=lsim(h10b,x2,t);

figure;
subplot(4,1,1),plot(t,x2);
subplot(4,1,2),plot(t,y13);title('input = 10101, N = 1, RC = 1');
subplot(4,1,3),plot(t,y14);title('input = 10101, N = 1, RC = 1/5');
subplot(4,1,4),plot(t,y15);title('input = 10101, N = 1, RC = 5');

figure;
subplot(4,1,1),plot(t,x2);
subplot(4,1,2),plot(t,y16);title('input = 10101, N = 2, RC = 1');
subplot(4,1,3),plot(t,y17);title('input = 10101, N = 2, RC = 1/5');
subplot(4,1,4),plot(t,y18);title('input = 10101, N = 2, RC = 5');

figure;
subplot(4,1,1),plot(t,x2);
subplot(4,1,2),plot(t,y19);title('input = 10101, N = 5, RC = 1');
subplot(4,1,3),plot(t,y20);title('input = 10101, N = 5, RC = 1/5');
subplot(4,1,4),plot(t,y21);title('input = 10101, N = 5, RC = 5');

figure;
subplot(4,1,1),plot(t,x2);
subplot(4,1,2),plot(t,y22);title('input = 10101, N = 10, RC = 1');
subplot(4,1,3),plot(t,y23);title('input = 10101, N = 10, RC = 1/5');
subplot(4,1,4),plot(t,y24);title('input = 10101, N = 10, RC = 5');

figure;
idealh=1*s/s;
idealy = lsim(idealh,x2,t);
plot(t,idealy);title('ideal channel');






⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -