参考的信号课设

上传人:第*** 文档编号:38883677 上传时间:2018-05-09 格式:DOC 页数:8 大小:63.50KB
返回 下载 相关 举报
参考的信号课设_第1页
第1页 / 共8页
参考的信号课设_第2页
第2页 / 共8页
参考的信号课设_第3页
第3页 / 共8页
参考的信号课设_第4页
第4页 / 共8页
参考的信号课设_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《参考的信号课设》由会员分享,可在线阅读,更多相关《参考的信号课设(8页珍藏版)》请在金锄头文库上搜索。

1、正弦信号正弦信号%绘制连续时间信号的时域波形 t=0:0.001:0.2;y=cos(2*pi*10*t);subplot(211);plot(t,y);xlabel(t 单位:s,Fontsize,8);title(连续时间信号f(t) cos(20*pi*t);%绘制抽样后的时域信号 subplot(212);plot(t,y,b:);hold on;t2=cos(2*pi*10*t2);stem(t2,y2,filled);xlabel(t 单位:s,Fontsize,8);title(抽样信号 fs(t); hold off;图形00.020.040.060.080.10.120.14

2、0.160.180.2-1-0.500.51t 位 位 位 s位 位 位 位 位 位 f(t) cos(20*pi*t)00.020.040.060.080.10.120.140.160.180.2-1-0.500.51周期矩形脉冲信号周期矩形脉冲信号%绘制周期方波信号 t=0:0.01:100;y=square(t);subplot(311);plot(t,y);axis(0,10,-3,3);title(周期方波信号);%绘制抽样后的方波信号 subplot(312);plot(t,y,b:);hold on;t2=0:1/100:0.01;y2=square(t2);stem(t2,y2

3、);axis(0,10,-3,3);title(抽样信号 fs(t); hold off;图形012345678910-202位 位 位 位 位 位012345678910-202位 位 位 位 fs(t)f1=3,2,1,1,1,2;k1=-3:2;f2=0:5;k2=-1:4;f1=3,2,1,1,1,2;k1=-3:2;f2=0:5;k2=-1:4;k=min(min(k1),min(k2):max(max(max(k1),max(k2);s1=zeros(1,length(k);s2=s1;i1=find(k=min(k1)n=0:1:N-1;x=randn(1,n);k=0:1:N-

4、1;y=x*(exp(-j*pi/N).(n*k);subplot(3,1,1);stem(n,x,filled);title();subplot(3,1,2);stem(k,abs(y);title();subplot(3,1,3);stem(k,angle(y);title();混叠%绘制连续时间信号的时域波形 t=0:0.001:40;y=cos(2/3*pi*t);subplot(121);plot(t,y);axis(0 6 -1.1 1.1)xlabel(t 单位:s,Fontsize,8);title(连续时间信号f(t); line(0 6,0 0,color,0 0 0);%

5、绘制频谱 N=300;W=2*pi*10;k=-N:N;w=-k*W/N;Y=0.01*y*exp(-j*t*w);Y=abs(Y);subplot(122);plot(w/pi,Y);axis(-2.5,2.5,0,pi*7+0.2);title(连续信号频谱);xlabel(omega 单位:pi);%采样 display(please input the value of sample period);Ts=input(Ts=);%绘制采样后时域信号 subplot(121);plot(t,y,b:);hold on;t2=0:Ts:40;y2=cos(2/3*pi*t2);stem(t

6、2,y2);axis(0 6 -1.1 1.1);xlabel(t 单位:s,Fontsize,8); title(fs(t);hold off;%绘制采样后时域信号频谱 Y2=Ts*y2*exp (-j*t2*w);Y2=1/Ts*abs(Y2);subplot(122);plot(w/pi,Y,b:);xlabel(omega 单位:pi);title(采样后频谱); hold on;plot(w/pi,Y2,r);axis(-2.5,2.5,0,pi10);hold off;整数倍抽取t=0:0.00021:1;x=cos(2*pi*30*t);y=decimate(x,4);subpl

7、ot(121);stem(x(1:120),axis(0 120 -2 2);title(元信号); subplot(122);stem(y(1:30);title(后信号);050100-2-1.5-1-0.500.511.52位 位 位0102030-1-0.8-0.6-0.4-0.200.20.40.60.81位 位 位 位 位泄露 n1=input(n1=);n2=input(n2=);n3=n1:n2;k1=length(n3);x1=zeros(1,k);x1(1,-n1+1)=1;subplot(511)x2=ones(1,k1);x2(1,1:n2)=0;subplot(512

8、);stem(n3,x2,filled);title(窗函数); N=20;n=-5:1:N-1;x=sin(n*pi/8)*x2;k=-5:1:N-1;y=x*(exp(-j*2*pi/N).(n*k);subplot(5,1,3);stem(n,x,filled);title();subplot(5,1,4);stem(k,abs(y);title();subplot(5,1,5);stem(k,angle(y);title();a=0:20;b=zeros(1,5),ones(1,8),zeros(1,8);stem(a,b);title( );N=20;n=0:1:N-1;x=sin(

9、n*pi/8)*b;k=0:1:N-1;y=x*(exp(-j*2*pi/N).(n*k);subplot(3,1,1);stem(n,x,filled);title();subplot(3,1,2);stem(k,abs(y);title();subplot(3,1,3);stem(k,angle(y);title();N=20;n=0:1:N-1;b=zeros(1,5),ones(1,8),zeros(1,7);subplot(4,1,1);stem(b);title( );x=sin(n*pi/8)*b;k=0:1:N-1;y=x*(exp(-j*2*pi/N).(n*k);subpl

10、ot(4,1,2);stem(n,x,filled);title();subplot(4,1,3);stem(k,abs(y);title();subplot(4,1,4);stem(k,angle(y);title();均值 离散%正弦 n=-20:20;x=sin(pi/6*n+pi/12);stem(n,x,filled);title();%均值 a=mean(x);ezplot(a);hold on;%方差 b=std(x);%标准差 c=b2;连续 t=0:0.001:0.2;y=cos(2*pi*10*t);subplot(111);plot(t,y);xlabel(t 单位:s,Fontsize,8); title(f(t) cos(20*pi*t);%均值 a=mean(y);%方差 b=std(y);%标准差 c=b2;fs=10;t=0:1/fs:2*pi;x=3;plot(t,x);fs=10;t=0:1/fs:2*pi;x=cos(pi/6*t);plot(t,x);-0.5-0.4-0.3-0.2-0.100.10.20.30.40.500.511.522.533.544.55N=8

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号