通信原理实验报告

更新时间:2023-09-20 04:12:01 阅读量: 小学教育 文档下载

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

通信原理MATLAB 实验报告

1

仿真

实验一 调幅信号波形频谱仿真

一、实验目的

假设基带信号为m(t)?sin(2000?t)?2cos(1000?t),载波频率为20kHz,请仿真出AM、DSB-SC、SSB信号,观察已调信号的波形及频谱。

二、实验平台

装有MATLAB的计算机

三、实验原理 1、AM调制原理 对于单音频信号

m(t)?Amsin(2?fmt)

进行AM调制的结果为

sAM(t)?Ac(A?Amsin(2?fmt))sin2?fct?AcA(1?asin(2?fmt))sin2?fct

其中调幅系数a?Am,要求a?1以免过调引起包络失真。 A由Amax和Amin分别表示AM信号波形包络最大值和最小值,则AM信号的调幅系数为

a?Amax?Amin

Amax?Amin2、DSB-SC调制原理

DSB信号的时域表达式为

2

sDSB(t)?m(t)cos?ct

频域表达式为

1SDSB(?)?[M(???c)?M(???c)]

23、SSB调制原理

SSB信号只发送单边带,比DSB节省一半带宽,其表达式为:

sssB(t)?1Amcosmtcoswmt21Amtsinwct 2定义时域采样率、截断时间和采样点数,可得到载波和调制信号,容易根据调制原理写出各调制信号表达式,由此可以画出时域波形图。另外,对时域信号进行FFT变换,此处使用预先定义的t2f.m函数替代,进行傅立叶变换,得到频谱,在频域作图即可。

产生载波和调制信号m(t) SSB、DSB、AM信号表达式 FFT变换得各调制信号频谱 作图

附注t2f.m函数代码,此函数在后续实验中也有使用:

%傅里叶正变换

function S= t2f(s,fs) % s代表输入信号,S代表s的频谱,fs是采样频率 N= length(s); %样点总数 T= 1/fs*N; %观察时间

f= [-N/2:(N/2-1)]/T; % 频率采样点 tmp1= fft(s)/fs; tmp2= N*ifft(s)/fs;

S(1:N/2)= tmp2(N/2+1: -1:2); S(N/2+1:N)= tmp1(1:N/2); S= S.*exp(j*pi*f*T); End

四、实验内容

3

MATLAB实现程序源代码:

%Assume baseband signal:m(t)=si(2000*pi*t)+2*cos(1000*pi*t) êrrier frequency is fc=20KHz,that is cos(2*pi*fc*t) %prepare workspace clear all close all

%Common definitions

fs = 800; %sampling frequency T = 200; %Timne-domain truncation N = T*fs; %sample points dt = 1/fs;%time resolution t = -T/2:dt:T/2-dt;

df = 1/T;%minimum frequency-domain resolution f = -fs/2:df:fs/2-df; fm1 = 1;%KHz fm2 = 0.5;%KHz

mt = sin(2*pi*fm1*t)+2*cos(2*pi*fm2*t); mt1 = mt/3;%normalization fc = 20;%KHz

ct = cos(2*pi*fc*t); Ac = 1; %Simulate AM a = 0.8;

st1 = Ac*(1+a*mt1).*ct;%AM Equation Sf1 = t2f(st1,fs);%Fourier Transform surf1 = abs(hilbert(st1));%envelope figure(1)

%plot Modulating Signal

subplot(2,2,1),plot(t,mt),grid on,axis([0,+4,-3,+3]), title('Modulating Signal'),xlabel('t'),ylabel('m(t)') %plot Carrier Signal

4

subplot(2,2,2),plot(t,ct),grid on,axis([0,2/fc,-1,1]), title('Carrier Signal'),xlabel('t'),ylabel('c(t)') %plot Modulated Signal and its envelope subplot(2,2,3),plot(t,st1,t,surf1,'r:'),grid on,axis([0,60/fc,-2*Ac,+2*Ac]),title('Modulated Signal'),xlabel('t'),ylabel('s(t)') %plot Frequency Spectrum

subplot(2,2,4),plot(f,abs(Sf1)),axis([-30,+30,0,max(abs(Sf1))]),grid on,title('Frequency Spectrum'),xlabel('f'), ylabel('S(f)') %%Simulate DSB-SC st2 = Ac*mt.*ct;

Sf2 = t2f(st2,fs);%Fourier Transform surf2 = abs(hilbert(st2));%envelope figure(2)

%plot Modulating Signal

subplot(2,2,1),plot(t,mt),grid on,axis([0,+4,-3,+3]), title('Modulating Signal'),xlabel('t'),ylabel('m(t)') %plot Carrier Signal

subplot(2,2,2),plot(t,ct),grid on,axis([0,2/fc,-1,1]), title('Carrier Signal'),xlabel('t'),ylabel('c(t)') %plot Modulated Signal

subplot(2,2,3),plot(t,st1,t,surf1,'r:'),grid on,axis([0,60/fc,-2*Ac,+2*Ac]),title('Modulated Signal'),xlabel('t'),ylabel('s(t)') %plot Frequency Spectrum

subplot(2,2,4),plot(f,abs(Sf2)),axis([-30,+30,0,max(abs(Sf2))]),grid on,title('Frequency Spectrum'),xlabel('f'), ylabel('S(f)') %%Simulate SSB

%use t2f and f2t function to do hilbert transform %or may use mh = hilbert(mt); Mt = t2f(mt,fs); Mh = -1j*sign(f);

5

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

Top