您好,欢迎访问三七文档
调制解调仿真2调制分类调制信号:载波信号:调幅:数字调制数字信号模拟调制模拟信号)(tf)(cos)(ccθtwAtc幅度调制频率调制相位调制线性调制非线性调制)(cos)()(ccθtwtftc3常规调幅(AM)时域表达式调制)(cos)]([)(0ccAMθtwtfAtS直流调制信号零均值随机确知)(tf)cos(twc)(tSAM0A4常规调幅(AM)频域表达式)(21)()(21)()](*)([21)(00ccccAMwwFwwδAπwwFwwδAπwCwFwS直流分量信号分量5常规调幅解调解调---包络检波无失真恢复条件)(tSAMLPFAtf)(0)(0tfAfcww6常规调幅信号的功率分配功率组成调制效率:最大:1/32)(2220tfAPPPfcAM222AMAMfcfAMfAMββPPPPPη7模拟调制仿真举例被调信号为1,t0/3t0;m(t)=-2,t0/3=t2*t0/3;0,其它利用AM调制方式调制载波。假设t0=0.15s,fc=250hz;调制系数a=0.85。要求:(1)仿真调制信号和被调制信号的频谱;(2)如果被调制信号是周期为t0的周期函数,确定调制信号的功率和调制效率。(3)如噪声信号与被调制信号相加解调器输出的信噪比为10db,那么求出噪声信号的功率。8MATLAB的实现t0=0.15;%信号持续时间ts=0.001;fc=250;snr=10;a=0.85;fs=1/ts;%抽样间隔t=[0:ts:t0];df=0.2;%频率分辨率snr_lin=10^(snr/10);%信噪比m=[ones(1,t0/(3*ts)),-2*ones(1,t0/(3*ts)),zeros(1,t0/(3*ts)+1)];c=cos(2*pi*fc.*t);%载波信号m_n=m/max(abs(m));[M,m,df1]=fftseq(m,ts,df);%傅立叶变换9MATLAB的实现f=[0:df1:df1*(length(m)-1)]-fs/2;u=m_n*max(abs(m)).*c;%调制信号[U,u,df1]=fftseq(u,ts,df);signal_power=(norm(u).^2)/length(u);pmn=(norm(u).^2)/length(u)/(max(abs(m)))^2;eta=(a^2*pmn)/(1+a^2*pmn);%调制效率noise_power=eta*signal_power/snr_lin;noise_std=sqrt(noise_power);%噪声标准偏差noise=noise_std*randn(1,length(u));r=u+noise;[R,r,df1]=fftseq(r,ts,df);R=R/fs;signal_powerpause%按任意键可看到调制效率eta10MATLAB的实现plot(t,m(1:length(t)))axis([00.15–2.12.1])xlabel('time')title('themessagesignal')subplot(3,1,2)plot(t,c(1:length(t)))xlabel('time')title('thecarrier')subplot(3,1,3)plot(t,u(1:length(t)))xlabel('time')title('themodulatedsignal')subplot(2,1,1)plot(f,abs(fftshift(M)))xlabel('frequency')title('spectrumofthemessagesignal')xlabel('frequency')11MATLAB的实现subplot(2,1,2)plot(f,abs(fftshift(U)))xlabel('frequency')title('spectrumofthemessagesignal')xlabel('frequency')subplot(2,1,1)plot(t,noise(1:length(t)))title('noisesample')xlabel('time')subplot(2,1,2)plot(t,r(1:length(t)))title('signalandnoise')xlabel('time')subplot(2,1,1)plot(f,abs(fftshift(U)))title('signalspectrum')xlabel('frequency')subplot(2,1,2)plot(f,abs(fftshift(R)))title('signalandnoisespectrum')xlabel('frequency')12MATLAB的仿真结果调制消息、载波、已调信号的时域波形00.020.040.060.080.10.120.140.16-202timethemessagesignal00.020.040.060.080.10.120.140.16-101time00.020.040.060.080.10.120.140.16-202time13MATLAB的仿真结果调制信号幅度的曲线和已调制信号的频谱-500050000.050.10.150.2frequencyspectrumofthemessagesignal-500050000.020.040.06spectrumofthemessagesignal14调相系统瞬时相位偏移瞬时相位调相信号表达式)(tfKPM:相移常数PMK为起始相位ooPMtfKt)()(为分析方便,起始相位设为零。))((cos)(tfKtwAtSPMcPM15调频系统瞬时角频率偏移瞬时角频率瞬时相位调频信号表达式)(tfKwFM:频移常数FMKdttdwtfKtwcFM)()()(dttfKtwwdttFMc)()())((cos)(dttfKtwAtSFMcFM16模拟调制仿真举例被调信号为1,t0/3t0;m(t)=-2,t0/3=t2*t0/3;0,其它利用频率调制方式调制载波。调制载波c(t)=cos(2*pi*fc*t),假设fc=200HZ,t0=0.15s,偏移常数kf=50。绘出调制信号的曲线;17echoont0=.15;%信号的持续时间ts=0.0005;%抽样间隔fc=200;%载波频率fs=1/ts;%抽样频率t=[0:ts:t0];kf=50;%调制指数df=0.25;%频率分辨率m=[ones(1,t0/(3*ts)),-2*ones(1,t0/(3*ts)),zeros(1,t0/(3*ts)+1)];MATLAB的实现18int_m(1)=0;fori=1:length(t)-1int_m(i+1)=int_m(i)+m(i)*ts;endf=[0:df1:df1*(length(m)-1)]-fs/2;u=cos(2*pi*fc*t+2*pi*kf*int_m);pause%按任意键可看到消息和调制信号的曲线MATLAB的实现19subplot(2,1,1)plot(t,m(1:length(t)))axis([00.15-2.12.1])title('themessagesignal')xlabel('time')subplot(2,1,2)plot(t,u(1:length(t)))axis([00.15-2.12.1])title('themodulatorsignal')xlabel('time')MATLAB的实现20MATLAB的仿真结果信息和调制信号的曲线00.050.10.15-2-1012themessagesignaltime00.050.10.15-2-1012themodulatorsignaltime21MATLAB实现模拟信号调制amod模拟信号解调ademodPp.154-155.22echoont0=.15;%信号的持续时间ts=0.0005;%抽样间隔fc=200;%载波频率fs=1/ts;%抽样频率t=[0:ts:t0];kf=50;%调制指数df=0.25;%频率分辨率m=[ones(1,t0/(3*ts)),-2*ones(1,t0/(3*ts)),zeros(1,t0/(3*ts)+1)];y=amod(m,fc,fs,‘fm',kf)MATLAB的实现23数字信号的载波传输24BFSK(二进制频移键控)MFSK(多进制频移键控)FSK(频移键控)ASK(幅移键控)QAM(正交幅度调制)MQAM(星座调制)非恒定包络OQPSK(参差QPSK)л/4QPSKDQPSK(差分QPSK)QPSK(正交四相相移键控)DPSK(差分二进制相移键控)BPSK(二进制相移键控)PSK(相移键控)CPM(连续相位调制)MSK(最小频移键控)GMSK(高斯成型MSK)TFM(平滑调频)恒定包络数字调制分类25二进制幅度键控(2ASK)时域表达式an等于±1。当输入比特为1,an为1;当输入比特为0,an为-1。是基带信号波形,例如矩形波信号、或者通过脉冲成型滤波器后的输出信号。tatScnOOKcosg(t))(26调制器可用一个相乘器来实现27假设在1秒内传送10个比特,代码如下:%onesecondt=0:1/1e3:0.999;%Tenrandoma=2*randint(1,10,2)-1;%Tenrectanglurewaveformg=ones(1,100);g=[g,g,g,g,g,g,g,g,g,g];%Binaryamplitudemodulations=a(ceil(10*t+0.01)).*g.*cos(2*pi*100*t);%Drawingsubplot(2,1,1);plot(t,a(ceil(10*t+0.01)));axis([0,1,-1.2,1.2]);subplot(2,1,2);plot(t,s);MATLAB的实现28MATLAB的仿真结果信息和调制信号的曲线29频域特性从频域上看,余弦信号是在特定频率上的冲激信号,而矩形信号是sinc波形。因为时域的相乘等价于频域的卷积操作,所以可以认为矩形信号在频域上做了平移,从0平移到fc30%Cosine&BASKwaveformt=0:1/1e3:0.999;a=2*[1010101010]-1;g=ones(1,100);g=[g,g,g,g,g,g,g,g,g,g];s1=cos(2*pi*100*t);s2=a(ceil(10*t+0.01)).*g.*cos(2*pi*100*t);%Calculatethepowerspectrumf=1000*(0:256)/512;MATLAB的实现31S1=fft(s1,512);Pss1=S1.*conj(S1)/512;S2=fft(s2,512);Pss2=S2.*conj(S2)/512;%Drawingsubplot(2,1,1);plot(f,Pss1(1:257));subplot(2,1,2);plot(f,Pss2(1:257));MATLAB的实现32MATLAB的仿真结果对比波形33MASKM=2N,N是大于或等于2的自然数,N代表同时被发送的比特数。将M进制比特流映射成振幅值应该等于:A=(2m+1-M)dm=0,L,M-1式中d用来控制幅度间的差值,该值等于幅度间差值的一半。34%M-aryM=4%Amplitudegapd=1;%Durationt=0:1/1e3:0.999;%Generatebitstreama=randint(1,20,2);%Generatesymbolforn=0:9sym(n+1)=a(2*n+1)*2+a(2*n+2);endMATLAB的实现35%MASKsym=(2*sym+1-M)*d;g=ones(
本文标题:调制解调
链接地址:https://www.777doc.com/doc-4806666 .html