您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > SSB单边带信号调制与解调仿真代码
t=-2:0.001:2;y1=sinc(t*200)subplot(3,3,1)plot(t,y1)title('已知信号')xlabel('时间:s')ylabel('幅度')gridxlim([-0.1,0.1])fs=3000;%%信号频谱t1=-2:0.0001:2;y11=sinc(t1*200)yk=fft(y11,50000)yw=2*pi/40000*abs(fftshift(yk))fw=[-25000:24999]/50000*fssubplot(3,3,2)plot(fw,yw)title('已知信号的频谱')xlabel('频率:hz')ylabel('幅度')gridxlim([-30,30])y3=cos(2*pi*200*t)subplot(3,3,3)plot(t,y3)title('载波信号')xlabel('时间:s')ylabel('幅度')gridxlim([-0.1,0.1])y4=sinc(t*200).*cos(2*pi*200*t)subplot(3,3,4)plot(t,y4,'r-')title('已调信号')xlabel('时间:s')ylabel('幅度')gridxlim([-0.05,0.05])fs1=1000%已调信号频谱yk=fft(y4,5000)yw=2*pi/4000*abs(fftshift(yk))fw=[-2500:2499]/5000*fs1subplot(3,3,5)plot(fw,yw,'r-')title('已调信号的频谱')xlabel('频率:hz')ylabel('幅度')gridxlim([-400,400])[c,lags]=xcorr(y4,200)subplot(3,3,6)plot(lags/fs,c)title('DSB信号自相关函数')xlabel('t')ylabel('Rxx(t)')gridSDSBp=fft(c,5000)fw=[-2500:2499]/5000*fs1yw=2*pi/4000*abs(fftshift(SDSBp))subplot(3,3,7)plot(fw,yw)title('DSB信号功率谱')xlabel('w')ylabel('Rxx(t)')gridy7=y4.*y3subplot(3,3,8)plot(t,y7)title('解调信号')xlabel('时间:s')ylabel('幅度')gridxlim([-0.1,0.1])Rp=0.1;Rs=80;Wp=40/100;Ws=45/100;[n,Wn]=ellipord(Wp,Ws,Rp,Rs)[b,a]=ellip(n,Rp,Rs,Wn)Xl=5*filter(b,a,y7)subplot(3,3,9)plot(t,Xl)title('滤波后的f(t)信号')xlabel('时间单位:s')ylabel('幅度')gridxlim([-0.1,0.1])
本文标题:SSB单边带信号调制与解调仿真代码
链接地址:https://www.777doc.com/doc-5073382 .html