通信原理报告

更新时间:2023-10-02 18:15:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

通信原理课程设计

要求

通信原理课程设计——基于Matlab的通信系统仿真

一、完成模拟调制系统的调制与解调(AM、DSB、SSB、VSB)

AM signal420-2-400.511.522.533.544.55spectrum of AM signal6420-20-15-10-50f5101520

DSB signal210-1-200.511.522.533.544.55spectrum of DSB signal0.60.40.20-20-15-10-50f5101520

1.51FM signal0.50-0.5-1-1.500.511.522.5t33.544.553spectrum of FM signal2.521.510.50-25-20-15-10-50f510152025envelop of derivative FM signal2001000-100-20000.511.522.5t33.544.55

VSB signal210-1-2-300.511.522.533.544.55spectrum of VSB signal0.60.40.20-40-30-20-100f10203040

SSB signal210-1-200.511.522.533.544.55spectrum of SSB signal21.510.50-20-15-10-50f5101520

20-210-110-110-110-1m(t)00.511.522.5t33.544.55am(t)00.511.522.5t33.544.55dsb(t)00.511.522.5t33.544.55ssb(t)00.511.522.5t33.544.55vsb(t)00.511.522.5t33.544.55

二、完成数字基带系统的眼图观察仿真

10.50-0.5-102baseband eyebaseband signal246810t/Ts121416182010-1-20123t/Ts456

三、实现ASK系统

original signal10.80.60.40.20010.50-0.5-10100200300400500600700800100200300400ask signal500600700800

四、(1)能够将语音数据通过AM调制,并解调恢复(2)能够将2个或2个以上的语音数据用不同频率的载波进行AM调制,并分别解调恢复

10.50-0.5-1051015x 100.20.10-0.1-0.200.511.522.533.5x 10445

2.DSB

实验程序

% 抑制载波双边带调制 DSB dt=0.001; fmax=1; fc=10; T=5; t=0:dt:T;

mt=sqrt(2)*cos(2*pi*fmax*t); s_dsb=mt.*cos(2*pi*fc*t);

[f,sf]=FFT_SHIFT(t,s_dsb); PSD=(abs(sf).^2)/T; figure(1) subplot(211)

plot(t,s_dsb);hold on; plot(t,mt,'r--');

title('DSB调制信号及其包络'); xlabel('t'); subplot(212)

plot(f,PSD);

axis([-2*fc 2*fc 0 max(PSD)]); title('DSB信号功率谱'); xlabel('f');

仿真图

3.VSB

实验程序:

clear; dt=0.001; fmax=5; fm=1; fc=20; T=5; N=T/dt;

t=[0:N-1]*dt;

mt=sqrt(2)*(cos(2*pi*fmax*t)+sin(2*pi*0.5*fmax*t));

s_vsb=mt.*cos(2*pi*fc*t); B=1.2*fm;

[f,sf]=fft_shift(t,s_vsb);

[t,s_vsb]=vsbmd(f,sf,0.2*fm,1.2*fm,fc);

[f,sf]=fft_shift(t,s_vsb);

PSD=(abs(sf).^2)/T; figure(1); subplot(211);

plot(t,s_vsb);hold on; plot(t,mt,'r--'); title('VSB signal'); subplot(212); plot(f,PSD);

axis([-2*fc 2*fc 0 max(PSD)]); title('spectrum of VSB signal'); xlabel('f');

function [t,st]=vsbmd(f,sf,B1,B2,fc) df=f(2)-f(1); T=1/df;

hf=zeros(1,length(f));

bf1=[floor((fc-B1)/df):floor((fc+B1)/df)]; bf2=[floor((fc+B1/df)):floor((fc+B2)/df)]; f1=bf1+floor(length(f)/2); f2=bf2+floor(length(f)/2); stepf=1/length(f1); hf(f1)=0:stepf:1-stepf; hf(f2)=1;

f3=-bf1+floor(length(f)/2); f4=-bf2+floor(length(f)/2); hf(f3)=0:stepf:(1-stepf); hf(f4)=1; yf=hf.*sf;

[t,st]=ifft_shift(f,yf); st=real(st);

仿真图

4.SSB

实验程序:

% 单边带调制 SSB dt=0.001; fmax=1; fc=10; T=5; t=0:dt:T;

mt=sqrt(2)*cos(2*pi*fmax*t);

s_ssb=real(hilbert(mt).*exp(j*2*pi*fc*t)); [f,sf]=FFT_SHIFT(t,s_ssb); PSD=(abs(sf).^2)/T; figure(1) subplot(211)

plot(t,s_ssb);hold on; plot(t,mt,'r--'); title('SSB调制信号'); xlabel('t'); subplot(212) plot(f,PSD);

axis([-2*fc 2*fc 0 max(PSD)]); title('SSB信号功率谱'); xlabel('f');

function [f, sf]=FFT_SHIFT(t, st)

%This function is FFT to calculate a signal’s Fourier transform

%Input: t: sampling time , st : signal data. Time length must greater thean 2 %output: f : sampling frequency , sf: frequen %output is the frequency and the signal spectrum dt=t(2)-t(1); T=t(end); df=1/T; N=length(t);

f=[-N/2:N/2-1]*df; sf=fft(st);

sf=T/N*fftshift(sf);

仿真图

5.解调

实验程序:

clear;

dt=0.01; fmax=1; B=2*fmax; fc=10; T=5;

N=floor(T/dt); t=[0:N-1]*dt;

mt=sqrt(2)*cos(2*pi*fmax*t);

%AM modulation A=2;

am=(A+mt).*cos(2*pi*fc*t); amd=am.*cos(2*pi*fc*t); amd=amd-mean(amd); [f,amf]=fft_shift(t,amd); B=2*fmax;

[t,am_t]=rect_lpf(f,amf,B);

%DSB modulation

dsb=mt.*cos(2*pi*fc*t); dsbd=dsb.*cos(2*pi*fc*t); dsbd=dsbd-mean(dsbd); [f,dsbf]=fft_shift(t,dsbd); [t,dsb_t]=rect_lpf(f,dsbf,B);

%SSB modulation

ssb=real(hilbert(mt).*exp(j*2*pi*fc*t)); ssbd=ssb.*cos(2*pi*fc*t); ssbd=ssbd-mean(ssbd); B=2*fmax;

[f,ssbf]=fft_shift(t,ssbd); [t,ssb_t]=rect_lpf(f,ssbf,B);

%VSB modulation

vsb=mt.*cos(2*pi*fc*t); [f,vsbf]=fft_shift(t,vsb);

[t,vsb]=vsbmd(f,vsbf,0.2*fmax,1.2*fmax,fc); vsbd=vsb.*cos(2*pi*fc*t); vsbd=vsbd-mean(vsbd); [f,vsbf]=fft_shift(t,vsbd);

[t,vsb_t]=rect_lpf(f,vsbf,2*fmax);

figure(1); subplot(511);

plot(t,mt); ylabel('m(t)'); xlabel('t'); subplot(512); plot(t,am_t); ylabel('am(t)'); xlabel('t'); subplot(513); plot(t,dsb_t); ylabel('dsb(t)'); xlabel('t'); subplot(514); plot(t,ssb_t); ylabel('ssb(t)'); xlabel('t'); subplot(515); plot(t,vsb_t); ylabel('vsb(t)'); xlabel('t');

仿真图:

心得体会:

通过本次实验不仅对MATLAB的操作有了更进一步的熟悉了解,在完成各项调试的时候参考了书本还对此相关的知识有了更进一步的巩固和提高。

实验二

实验内容:

完成数字基带系统的眼图观察仿真

10.50-0.5-102baseband eyebaseband signal246810t/Ts121416182010-1-20123t/Ts456

眼图实验程序

Ts=1; N=15;

eye_num=6; a=1;

N_data=1000; dt=Ts/N;

t=-3*Ts:dt:3*Ts;

d=sign(randn(1,N_data)); dd=sigexpand(d,N); %

ht=sinc(t/Ts).*(cos(a*pi*t/Ts))./(1-4*a^2*t.^2/Ts^2+eps); st=conv(dd,ht);

tt=-3*Ts:dt:(N_data+3)*N*dt-dt; subplot(211) plot(tt,st);

axis([0 20 -1.2 1.2]); xlabel('t/Ts');

ylabel('基带信号'); subplot(212)

ss=zeros(1,eye_num*N); ttt=0:dt:eye_num*N*dt-dt; for k=3:50

ss=st(k*N+1:(k+eye_num)*N); drawnow; plot(ttt,ss); hold on; end;

xlabel('t/Ts');

ylabel('基带信号眼图');

function[out]=sigexpand(d,M) N=length(d); out=zeros(M,N); out(1,:)=d;

out=reshape(out,1,M*N);

仿真图

心得体会:

通过本次实验对眼图的仿真调试让我对眼图的概念产生条件有了更加深刻的印象,进一步巩固了相关专业知识。

本文来源:https://www.bwwdw.com/article/tixd.html

Top