实验二 离散时间信号的时域分析(附思考题程序).docVIP

  • 311
  • 0
  • 约2.72千字
  • 约 7页
  • 2017-02-01 发布于北京
  • 举报

实验二 离散时间信号的时域分析(附思考题程序).doc

实验二 离散时间信号的时域分析 1.实验目的 (1)学习MATLAB软件及其在信号处理中的应用,加深对常用离散时间信号的理解。 (2) 如果序列在时间轴上面有K个单位的延迟,则可以得到,即: 该序列可以用MATLAB中的zeros函数来实现。 (2)正弦序列 可以利用sin函数来产生。 (3)指数序列 在MATLAB中通过:和来实现。 3.实验内容及其步骤 ()(2) 参考:% Generation of a Unit Sample Sequence clf; % Generate a vector from -10 to 20 n = -10:20; % Generate the unit sample sequence u = [zeros(1,10) 1 zeros(1,20)]; % Plot the unit sample sequence stem(n,u); xlabel(Time index n);ylabel(Amplitude); title(Unit Sample Sequence); axis([-10 20 0 1.2]); 如果序列在时间轴上面有K个单位的延迟,则可以得到,即: ,通过程序来实现如下所示结果。 正弦序列 参考:% Generation of a sinusoidal sequence n = 0:40; f = 0.1; phase = 0; A = 1.5; arg = 2*pi*f*n - phase; x = A*cos(arg); clf; % Clear old graph stem(n,x); % Plot the generated sequence axis([0 40 -2 2]); grid; title(Sinusoidal Sequence); xlabel(Time index n); ylabel(Amplitude); axis; 指数序列 参考:% Generation of a real exponential sequence clf; n = 0:35; a = 1.2; K = 0.2; x = K*a.^n; stem(n,x); xlabel(Time index n); ylabel(Amplitude); ()n1=1:5; x10=[1 0.7 0.4 0.1 0]; n2=3:8; x20=[0.1 0.3 0.5 0.7 0.9 1]; n=1:8; x1=[x10 zeros(1,8-length(n1))];%右边补3个零 x2=[zeros(1,8-length(n2)) x20];%左面补2个零 x=x1+x2; subplot(3,1,1);stem(n,x1); subplot(3,1,2);stem(n,x2); subplot(3,1,3);stem(n,x); ()C:\MATLAB6p5\work\speech\”语音信号” f3.wav”,进行操作: x=(C:\MATLAB6p5\work\speech\f3.wav);y=wavread(x);plot(y); sound(y,16000) 4. 实验用MATLAB函数介绍 其中在实验过程中常用到的MATLAB指令(函数名)有:clf, zeros, ones, length, wavread, sound命令等,具体调用格式参看“help”或者查阅相关书籍。另外,在具体的实验过程中也可以根据实际需要自己定义函数。 5.思考题 (1)离散时间信号在时域上有何特点。 ()() 产生指数序列 x(n)等于2乘以-1的n次方 n = 0:20; x=2*(-1).^n; stem(n,x); 产生一个周期正弦函数 n=0:0.2:4*pi; y=sin(n); stem(n,y); 已知:x[n]={-4 5 1 -2 -3 0 2}, -4n4; y[n]={6 -3 -1 0 8 7 -2}; -2n6; 编程计算 x[n-1]和y[-n]的内积 x=[-4 5 1 -2 -3 0 2];n1=-3:3; y=[6 -3 -1 0 8 7 -2];n2=-1:5; n=n1+1; y1=fliplr(y); x10=[zeros(1

文档评论(0)

1亿VIP精品文档

相关文档