数字信号处理实验报告1 DSP信号与系统实验报告 信号的基本表示及时域分析 电子科技大学 2018版 下载本文

内容发布更新时间 : 2024/6/2 20:26:40星期一 下面是文章的全部内容请认真阅读。

3、在?20?n?20内,画出单位下列信号:

(a)单位采样序列x1[n]??[n]和单位阶跃序列x2[n]?u[n]的时域波形图。 (b)y1[n]?x1[n?5]、y2[n]?x2[n?8]的波形。说明x1[n]与y1[n]、x2[n]与

y2[n]之间的关系。

4、画出下列信号在0?n?100内的波形。

??n?x3[n]?sin???16??n?x4[n]?sin??

?2???n??3?n?x5[n]?cos???cos??128????

观察x3[n]、x4[n]、x5[n]是否周期信号。如果是周期信号,信号的基波周期是什么?如果不是周期信号,说明原因。

5、在0?n?30内,画出下列信号:

x6[n]?0.2(0.8)nx7[n]?e??1/12?j?/6?n

对于复数序列,要求分别画出实部和虚部;幅值和相角。若把x6[n]中的底数0.8分别改为1.2、-0.8,讨论产生的时域波形有何变化。总结指数序列的底数对序列变化的影响。

6、(拓展要求)设计产生数字二进制序列:1 0 1 0 1 0 的2ASK、2FSK、2PSK调制信号。已知符号速率Fd=10Hz(即时间间隔Ts为0.1),输出信号的采样频率为200Hz。

(a)2ASK信号的载波频率Fc=40Hz,

(b)2FSK信号载波1频率F1=25Hz,载波2频率F2=40Hz。

(c)2PSK载波频率Fc=50Hz。

分别画出以上信号调制前后的时域波形图。

7、(拓展要求)利用MATLAB产生DTMF双音多频信号。画出数字“0”的时域波形图。

8、(拓展要求)MATLAB函数randn(1,N)可以产生均值为0,方差为1的高斯随机序列,也就是白噪声序列。试利用randn函数产生均值为0.15,方差为0.1的高斯白噪声序列x8[n],要求序列时域范围为0?n?100。画出时域波形图。同时将实验步骤2中产生的信号x2[n]与x8[n]相加,将得到的波形与x2[n]的波形做比较。

9、(拓展要求)利用MATLAB中的谱分析函数画出x3[n]、x4[n]、x5[n]的频谱。与理论上根据傅立叶变换的定义计算出的x3[n]、x4[n]、x5[n]的频谱进行比较。

八、实验数据及结果分析:

需要的程序代码:

(1)一段MATLAB包括从键盘输入,赋值,基本矩阵和向量计算,程序流控(循环,逻辑判断,选择结构,分支语句等)和绘图操作的MATLAB简单程序。

x = ones(1,10); for i = 3:10

x(i) = x(i-1) + x(i-2); end

M = input('Please input the ID = '); if M == 1

plottype = 'bar'; elseif M == 2

plottype = 'pie3'; else

plottype = 'UNKNOWN'; end

switch plottype case 'bar'

bar(x)

title('Bar Graph') case {'pie','pie3'} pie3(x)

title('Pie Chart') otherwise

warning('Unexpected plot type. No plot created.') end

(2)产生x1[n]、x2[n]、y1[n]、y2[n]、x3[n]、x4[n]、x5[n]、x6[n]、x7[n]序列的程序

t = -20:20;

x1 = zeros(1,length(t)); x1(21) = 1; subplot(2,2,1) stem(t,x1)

x2 = [zeros(1,20) ones(1,21)]; subplot(2,2,2) stem(t,x2)

y1 = circshift(x1,5); subplot(2,2,3) stem(t,y1)

y2 = circshift(x2,-8); y2(41-8:41) = 1; subplot(2,2,4) stem(t,y2)

n = 0:100;

x3 = sin(pi*n/16); x4 = sin(n/2);

x5 = cos(pi*n/12)+cos(3*pi*n/8);

subplot(3,1,1) stem(n,x3)

subplot(3,1,2) stem(n,x4)

subplot(3,1,3) stem(n,x5)

n = 0:30;

x6 = 0.2*0.8.^n;

x7 = exp((-1/12+1i*pi/6)*n);

subplot(4,2,1) stem(n,real(x6)) subplot(4,2,2) stem(n,real(x7)) subplot(4,2,3) stem(n,imag(x6))

subplot(4,2,4) stem(n,imag(x7)) subplot(4,2,5) stem(n,abs(x6)) subplot(4,2,6) stem(n,abs(x7)) subplot(4,2,7) stem(n,angle(x6)) subplot(4,2,8) stem(n,angle(x7))

x6 = 0.2*1.2.^n; x7 = 0.2*-0.8.^n; figure(2)

subplot(4,2,1) stem(n,real(x6)) subplot(4,2,2) stem(n,real(x7)) subplot(4,2,3) stem(n,imag(x6)) subplot(4,2,4) stem(n,imag(x7)) subplot(4,2,5) stem(n,abs(x6)) subplot(4,2,6) stem(n,abs(x7)) subplot(4,2,7) stem(n,angle(x6)) subplot(4,2,8) stem(n,angle(x7))

(3)产生2ASK、2FSK、2PSK调制信号的程序(拓展要求)

Fd = 10;Ts = 1/Fd;Fs = 200; %t:n = 1s:200 n = 0:0.6*Fs-1;

message = [1 0 1 0 1 0]; a = [];

for i = 1:6

if message(i) == 1

a = [a ones(1,20)]; else

a = [a zeros(1,20)]; end end

figure(1)

subplot(4,1,1) stem(a) %% 2ASK Fc1 = 40;

b = sin(2*pi*Fc1*n/Fs); stem(b)

ASK = a.*b; subplot(4,1,2) stem(ASK) %% 2FSK

F1 = 25;F2 = 40;

c1 = sin(2*pi*F1*n/Fs);