《四川大学信号与系统实验报告》由会员分享,可在线阅读,更多相关《四川大学信号与系统实验报告(15页珍藏版)》请在金锄头文库上搜索。
1、.实 验 报 告课程名称信号与系统 实验名称信号与LTI系统的时频域分析实验时间2017年6月15日学 院电子信息学院指导教师周新志学生姓名班级学号学院(系)电子信息学院专 业信息安全;.实 验 报 告实验名称信号与LTI系统的时频域分析指导教师周新志一、 实验目的和要求1)熟悉和掌握实现常用信号的产生方法;2)理解系统的单位冲激响应的概念,LTI系统的卷积表达式及其物理意义,卷积的计算方法;3)理解典型信号的频谱特征;4)理解系统的频率响应的概念及其物理意义,理解具有不同频率响应特性的滤波器对信号的滤波作用;5)学会利用编程实现卷积以求解系统响应,并绘制相应曲线;6)学会利用编程实现一些典型
2、信号的频谱分析,并绘制相应曲线。二、实验环境(实验设备)计算机,Matlab2014a三、 实验原理及内容已知一LTI系统如下:h nynxn 1) 编程产生以下三个正弦信号,并画出波形图。 其中f1=,f2=;2) 编程计算下面卷积:已知h1n= 0.0031,0.0044, -0.0031, -0.0272,-0.0346,0.0374, 0.1921, 0.3279 0.3279,0.1921,0.0374,-0.0346,-0.0272,-0.0031, 0.0044,0.0031 ,n=0,1,.,15; h2 n= -0.0238,0.0562,-0.0575,-0.1302,0.
3、5252, -0.6842,-0.3129,5.6197,5.6197,-0.3129,-0.6842,0.5252,-0.1302,-0.0575,0.0562,-0.0238, n=0,1,.,15。 a、当h n= h1n时,输入分别为x1n, x2n和x3n时系统的输出yn, 并画出波形图。 b、当h n= h2 n时,输入分别为x1n, x2n和x3n时系统的输出yn, 并画出波形图。3) 编程实现以下信号的频谱分析:a、输入信号x1n, x2n 和x3n的频谱,并画出频谱图; b、冲激响应h n= h1n时h n的频谱,三种输入信号下输出yn的频谱,并画出h n和输出信号的频谱图;
4、 c、冲激响应h n= h2 n时h n的频谱,三种输入信号下输出yn的频谱,并画出h n和输出信号的频谱图。4)根据输入信号、h n和输出信号的频谱,验证输出信号的频谱与输入信号、h n的频谱关系(或卷积性质),即是否满足 。5)分析以上各种情况下,输出信号及频谱不同原因(1)clear;n=-4:4;x1=cos(0.25*pi*n);subplot(2,2,1),stem(n,x1),grid on;title(余弦信号 x1n)xlabel(Time index n);x2=cos(1.25*pi*n);subplot(2,2,2),stem(n,x2),grid on;title(余
5、弦信号 x2n)xlabel(Time index n);x3=x1+x2;subplot(2,2,3),stem(n,x3),grid on;title(余弦相加信号 x3n)xlabel(Time index n); (2)aclear;h1=0.0031,0.0044,-0.0031,-0.0272,-0.0346,0.0374,0.1921,0.3279,0.3279,0.1921,0.0374,-0.0346,-0.0272,-0.0031,0.0044,0.0031;k1=0:15;n=-4:4;x1=cos(0.25*pi*n);y1=conv(h1,x1);%计算序列f1与f2
6、的卷积和fk0=k1(1)+n(1); %计算序列f非零样值的起点位置k3=length(x1)+length(h1)-2; %计算卷积和f的非零样值的宽度k=k0:k0+k3; %确定卷积和f非零样值的序号向量subplot(2,2,1);stem(k,y1);title(x1n与h1n的卷积和y1n);xlabel(k);ylabel(y1k);x2=cos(1.25*pi*n);y2=conv(h1,x2);subplot(2,2,2);stem(k,y2);title(x2n与h1n的卷积和y2n);xlabel(k);ylabel(y2k);x3=x1+x2;y3=conv(h1,x
7、3);subplot(2,2,3);stem(k,y3);title(x3n与h1n的卷积和y3n);xlabel(k);ylabel(y3k);b.clear;h2=-0.0238,0.0562,-0.0575,-0.1302,0.5252, -0.6842,-0.3129,5.6197,5.6197,-0.3129,-0.6842,0.5252,-0.1302,-0.0575,0.0562,-0.0238;k1=0:15;n=-4:4;x1=cos(0.25*pi*n);y1=conv(h2,x1);%计算序列f1与f2的卷积和fk0=k1(1)+n(1); %计算序列f非零样值的起点位置
8、k3=length(x1)+length(h2)-2; %计算卷积和f的非零样值的宽度k=k0:k0+k3; %确定卷积和f非零样值的序号向量subplot(2,2,1);stem(k,y1);title(x1n与h2n的卷积和y1n);xlabel(k);ylabel(y1k);x2=cos(1.25*pi*n);y2=conv(h2,x2);subplot(2,2,2);stem(k,y2);title(x2n与h2n的卷积和y2n);xlabel(k);ylabel(y2k);x3=x1+x2;y3=conv(h2,x3);subplot(2,2,3);stem(k,y3);title(
9、x3n与h2n的卷积和y3n);xlabel(k);ylabel(y3k);3.(a)fs=128;t=1/fs;L=256;n=0:1:L-1;x1=cos(0.25*pi*n);x2=cos(1.25*pi*n);x3=x2+x1;N = 2nextpow2(L);X1=fft(x1,N)/N*2;X2=fft(x2,N)/N*2;X3=fft(x3,N)/N*2;f=fs/N*(0:1:N-1);figure;subplot(2,1,1);plot(f,abs(X1);title(幅值频谱);xlabel(频率(HZ);ylabel(幅值);subplot(2,1,2);plot(f,a
10、ngle(X1);title(相位频谱);xlabel(频率(HZ);ylabel(相位);figure;subplot(2,1,1);plot(f,abs(X2);title(幅值频谱);xlabel(频率(HZ);ylabel(幅值);subplot(2,1,2);plot(f,angle(X2);title(相位频谱);xlabel(频率(HZ);ylabel(相位);figure;subplot(2,1,1);plot(f,abs(X3);title(幅值频谱);xlabel(频率(HZ);ylabel(幅值);subplot(2,1,2);plot(f,angle(X3);title
11、(相位频谱);xlabel(频率(HZ);ylabel(相位);(b)fs=128;t=1/fs;L1=256;n=0:1:L1-1;h1=0.0031,0.0044,-0.0031,-0.0272,-0.0346,0.0374,0.1921,0.3279,0.3279,0.1921,0.0374,-0.0346,-0.0272,-0.0031,0.0044,0.0031;x1=cos(0.25*pi*n);x2=cos(1.25*pi*n);x3=x2+x1;N = 2nextpow2(L1);X1=fft(x1,N)/N*2;X2=fft(x2,N)/N*2;X3=fft(x3,N)/N*
12、2;H1=fft(h1,N)/N*2;Y11=fft(x1,N)/N.*2.*fft(h1,N)/N.*2;Y12=fft(x2,N)/N.*2.*fft(h1,N)/N.*2;Y13=fft(x3,N)/N.*2.*fft(h1,N)/N.*2;f=fs/N*(0:1:N-1);figure;subplot(2,1,1);plot(f,abs(H1);title(幅值频谱);xlabel(频率(HZ);ylabel(幅值);subplot(2,1,2);plot(f,angle(H1);title(相位频谱);xlabel(频率(HZ);ylabel(相位);figure;subplot(2
13、,1,1);plot(f,abs(Y11);title(幅值频谱);xlabel(频率(HZ);ylabel(幅值);subplot(2,1,2);plot(f,angle(Y11);title(相位频谱);xlabel(频率(HZ);ylabel(相位);figure;subplot(2,1,1);plot(f,abs(Y12);title(幅值频谱);xlabel(频率(HZ);ylabel(幅值);subplot(2,1,2);plot(f,angle(Y12);title(相位频谱);xlabel(频率(HZ);ylabel(相位);figure;subplot(2,1,1);plot(f,abs(Y13);title(幅值频谱);xlabel(频率(HZ);ylabel(幅值);subplot(2,1,2);plot(f,angle(Y13);title(相位频谱);xlabel(频率(HZ);ylabel(相位);fs=128;t=1/fs;L1=256;n=0:1:L1-1;h2=-0.0238,0.0562,-0.0575,-0.1302,0.5252, -0.6842,-0.3129,5.6197,5.6197,-0.