当前位置:文档之家› 数字通信原理实验报告

数字通信原理实验报告

《数字通信原理与技术》实验报告学院:江苏城市职业学院专业:计算机科学与技术班级:姓名:___________学号: ________实验一熟悉MATLAB环境一、实验目的(1)熟悉MATLAB的主要操作命令。

(2)掌握简单的绘图命令。

(3)用MATLAB编程并学会创建函数。

(4)观察离散系统的频率响应。

二、实验内容(1)数组的加、减、乘、除和乘方运算。

输入A=【1 2 3 4】,B=【3 4 5 6】,求C=A+B,D=A-B,E=A.*B,F=A./B,G=A.^B并用stem语句画出A、B、C、D、E、F、G。

(2)用MATLAB实现下列序列:a)x(n)=0.8n 0≦n≦15b)x(n)=e(0.2+0.3j) 0≦n≦15c)x(n)=3cos(0.125πn+0.2π)+0.2sin(0.25πn+0.1π) 0≦n≦15d) 将c)中的x(n)扩展成以16为周期的函数x16(n)=x(n+16),绘出四个周期。

e) 将c)中的x(n)扩展成以10为周期的函数x10(n)=x(n+10),绘出四个周期。

(3) 绘出下列时间函数图形,对x轴、y轴以及图形上方均须加上适当的标注:a)x (t )=sin(2πt) 0≦n≦10sb) x (t)=cos(100πt)sin(πt) 0≦n≦14s三、程序和实验结果(1)实验结果:1、A=[1,2,3,4]B=[3,4,5,6]C=A+BD=A-BE=A.*BF=A./BG=A.^BA =1 2 3 4B =3 4 5 6C =4 6 8 10D =-2 -2 -2 -2E =3 8 15 24F =0.3333 0.5000 0.6000 0.6667G =1 16 243 4096>> stem(A)>> stem(B)>> stem(C)>> stem(D)>> stem(E)>> stem(F)>> stem(G)A BC DE FG(2)(a) n=0:15x=0.8.^nn =Columns 1 through 130 1 2 3 4 5 6 7 8 9 10 11 12Columns 14 through 1613 14 15x =Columns 1 through 81.0000 0.8000 0.6400 0.5120 0.4096 0.3277 0.2621 0.2097Columns 9 through 160.1678 0.1342 0.1074 0.0859 0.0687 0.0550 0.0440 0.0352>> stem(x)(b) n=0:15x=exp((0.2+3j)*n)n =Columns 1 through 130 1 2 3 4 5 6 7 8 9 10 11 12 Columns 14 through 1613 14 15x =Columns 1 through 51.0000 -1.2092 + 0.1724i 1.4324 - 0.4168i -1.6602 + 0.7509i 1.8780 - 1.1942i Columns 6 through 10-2.0650 + 1.7677i 2.1923 - 2.4934i -2.2212 + 3.3928i 2.1010 - 4.4854i -1.7673 + 5.7857iColumns 11 through 151.1398 - 7.3006i -0.1198 + 9.0242i -1.4106 -10.9326i 3.5900 +12.9763i -6.5776 -15.0719iColumn 1610.5514 +17.0909i>> stem(x)(c) n=0:15x=3.*cos(0.125*pi*n+0.2*pi)+2.*sin(0.25*pi*n+0.1*pi)n =Columns 1 through 130 1 2 3 4 5 6 7 8 9 10 11 12Columns 14 through 1613 14 15x =Columns 1 through 83.0451 3.3495 2.3714 0.2076 -2.3814 -4.3399 -4.8652 -3.8251Columns 9 through 16-1.8090 0.2145 1.4328 1.6083 1.1453 0.7759 1.0610 2.0091 >> stem(x)(d) n=[0:63]%n=[n1(0:15),n1(0:15),n1(0:15),n1(0:15)]x=3.*cos(0.125*pi*n+0.2*pi)+2.*sin(0.25*pi*n+0.1*pi)n =Columns 1 through 130 1 2 3 4 5 6 7 8 9 10 11 12 Columns 14 through 2613 14 15 16 17 18 19 20 21 22 23 24 25 Columns 27 through 3926 27 28 29 30 31 32 33 34 35 36 37 38 Columns 40 through 5239 40 41 42 43 44 45 46 47 48 49 50 51 Columns 53 through 6452 53 54 55 56 57 58 59 60 61 62 63x =Columns 1 through 83.0451 3.3495 2.3714 0.2076 -2.3814 -4.3399 -4.8652 -3.8251 Columns 9 through 16-1.8090 0.2145 1.4328 1.6083 1.1453 0.7759 1.0610 2.0091 Columns 17 through 243.0451 3.3495 2.3714 0.2076 -2.3814 -4.3399 -4.8652 -3.8251 Columns 25 through 32-1.8090 0.2145 1.4328 1.6083 1.1453 0.7759 1.0610 2.0091 Columns 33 through 403.0451 3.3495 2.3714 0.2076 -2.3814 -4.3399 -4.8652 -3.8251Columns 41 through 48-1.8090 0.2145 1.4328 1.6083 1.1453 0.7759 1.0610 2.0091 Columns 49 through 563.0451 3.3495 2.3714 0.2076 -2.3814 -4.3399 -4.8652 -3.8251 Columns 57 through 64-1.8090 0.2145 1.4328 1.6083 1.1453 0.7759 1.0610 2.0091(e) n=[0:39]%n=[n1(0:15),n1(0:15),n1(0:15),n1(0:15)]x=3.*cos(0.125*pi*n+0.2*pi)+2.*sin(0.25*pi*n+0.1*pi)n =Columns 1 through 130 1 2 3 4 5 6 7 8 9 10 11 12Columns 14 through 2613 14 15 16 17 18 19 20 21 22 23 24 25Columns 27 through 3926 27 28 29 30 31 32 33 34 35 36 37 38Column 4039x =Columns 1 through 83.0451 3.3495 2.3714 0.2076 -2.3814 -4.3399 -4.8652 -3.8251Columns 9 through 16-1.8090 0.2145 1.4328 1.6083 1.1453 0.7759 1.0610 2.0091 Columns 17 through 243.0451 3.3495 2.3714 0.2076 -2.3814 -4.3399 -4.8652 -3.8251Columns 25 through 32-1.8090 0.2145 1.4328 1.6083 1.1453 0.7759 1.0610 2.0091 Columns 33 through 403.0451 3.3495 2.3714 0.2076 -2.3814 -4.3399 -4.8652 -3.8251>> stem(x)(3)(a) t=0:10x=sin(2*pi*t)stem(x)title('x(t)=sin(2*pi*t)')xlabel('(t)')ylabel('x(t)')t =0 1 2 3 4 5 6 7 8 9 10x =1.0e-014 *Columns 1 through 80 -0.0245 -0.0490 -0.0735 -0.0980 -0.1225 -0.1470 -0.1715Columns 9 through 11-0.1959 -0.2204 -0.2449(b) t=0:4x=cos(100*pi*t).*sin(pi*t)stem(x)title('x(t)=cos(100*pi*t).*sin(pi*t)')xlabel('(t)')ylabel('x(t)')t =0 1 2 3 4x =1.0e-015 *0 0.1225 -0.2449 0.3674 -0.4899>> stem(x)四、实验结果分析1、若不想让MA TLAB会直接显示运算结果,只需在运算式最后加上分号即可,如y=sin(10)*exp(-0.3*4^2);若要显示变数y的值,直接键入y即可>>yY=-0.00452、若将2)中c的周期改变,波形图的紧密程度不同;实验二模拟调制系统一、实验目的(1)熟悉MA TLAB仿真环境。

(2)掌握基于MA TLAB的通信系统建模方法。

(3)验证AM、DSB、SSB、FM系统的调制解调方法。

二、实验内容用MA TLAB实现频率为10Hz,功率为1的余弦信号源,设载波频率为500Hz。

持续时间(0:5s),采样间隔为1./80s,试画出(1)载波信号及其频谱(2)AM调制信号及其频谱(3)DSB调制信号及其频谱(4)SSB信号及其频谱(5)FM和PM信号及其频谱三、程序和实验结果clear;clc;t=[0:1./80:5];g=cos(2*pi*10.*t);figure(1)subplot(2,1,1)plot(g)title('orginal signal')subplot(2,1,2)plot(abs(fftshift(fft(g))))title('frequency of signal')center=2.*cos(2*pi*500.*t)figure(2);subplot(2,1,1)plot(center);title('center frequency signal');subplot(2,1,2)plot(abs(fftshift(fft(center))))title('frequency of center signal')AM=(1+g).*center;figure(3);subplot(2,1,1);plot(AM);title('AM signal');subplot(2,1,2);plot(abs(fftshift(fft(AM))));title('frequency of AM signal');SSB=g.*center;figure(4);subplot(2,1,1);plot(SSB);title('SSB signal')subplot(2,1,2)plot(abs(fftshift(fft(SSB))));title('frequency of SSB signal');DSB=fft(fftshift(fft(SSB)).*(fftshift(abs([0:400]-200)<75))); figure(5)subplot(2,1,1)plot(DSB)subplot(2,1,2)plot(abs(fftshift(fft(DSB))))% g=cos(2.*pi.*t)+2.*cos(4.*pi.*t);% figure(1)% plot(abs(g));% figure(2);% plot(abs(fftshift(fft(g))));% t1=[0:0.3:50];% g1=cos(2.*pi.*t1)+2.*cos(4.*pi.*t1);% figure(3);% plot(abs(fftshift(fft(g1))));% a_filter=[zeros(1,64),ones(1,128),zeros(1,64)];% gf=fftshift(fft(g)).*(abs(t-25)<25);% figure(4)% plot(abs(fft(gf)))(a)clear;clc;t=[0:1./80:5];g=cos(2*pi*10.*t);figure(1)subplot(2,1,1)plot(g)title('orginal signal')subplot(2,1,2)plot(abs(fftshift(fft(g))))title('frequency of signal')载波信号及其频谱center=2.*cos(2*pi*500.*t)figure(2);subplot(2,1,1)plot(center);title('center frequency signal'); subplot(2,1,2)plot(abs(fftshift(fft(center))))title('frequency of center signal')FM和PM信号及其频谱AM=(1+g).*center;figure(3);subplot(2,1,1);plot(AM);title('AM signal');subplot(2,1,2);plot(abs(fftshift(fft(AM))));title('frequency of AM signal');AM调制信号及其频谱SSB=g.*center;figure(4);subplot(2,1,1);plot(SSB);title('SSB signal')subplot(2,1,2)plot(abs(fftshift(fft(SSB))));title('frequency of SSB signal');SSB信号及其频谱DSB=fft(fftshift(fft(SSB)).*(fftshift(abs([0:400]-200)<75))); figure(5)subplot(2,1,1)plot(DSB)subplot(2,1,2)plot(abs(fftshift(fft(DSB)))DSB调制信号及其频谱四、实验结果分析1、AM有载频双边带,DSB无载频双边带,SSB无载频单边带,FM和PM幅度不变,信号过0点;2、AM与DSB的带宽都是两倍的基带信号带宽,SSB是一倍的基带信号带宽。

相关主题