《matlab第五章》PPT课件.ppt_第1页
《matlab第五章》PPT课件.ppt_第2页
《matlab第五章》PPT课件.ppt_第3页
《matlab第五章》PPT课件.ppt_第4页
《matlab第五章》PPT课件.ppt_第5页
已阅读5页,还剩49页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、第五章 调制与解调,第五章 调制与解调,5.1 调制与解调基本知识 5.2 通带模拟调制与解调 5.3 数字调制与解调,5.1 调制与解调基本知识,5.1.1 调制在通信系统中的作用 5.1.2 调制的基本特性和分类 5.1.3 通带仿真与基带仿真,5.1.1 调制在通信系统中的作用, 调制为了容易辐射 调制为了频率分配 调制为了多路复用 调制为了减少噪声和干扰的影响 调制可以克服设备的限制,5.1.2 调制的基本特性和分类(1),1.两个基本特性 仍然携带有消息 适合于信道传输 2.分类,5.1.2 调制的基本特性和分类(2),1 根据x(t)的不同可以分为:模拟调制、数字调制 2 根据c(

2、t)的不同分为:连续载波调制、脉冲载波调制 3根据调制器功能不同分为:幅度调制、频率调制等。 4 根据调制器频谱搬移特性的不同可以分为:线性调制:Xc(t)与x(t)呈线性搬移,如AM和SSB。非线性调制:输出已调信号Xc(t)的频谱和调制信号x(t)的频谱之间没有线性对应关系,如FM FSK等。,5.1.3 通带仿真与基带仿真,通带仿真的载波信号包含在模型的发射部分,载波频率通常都远远高于信号的最高频率。由Nyquist抽样定理可知,为了能正确恢复出信息信号,仿真中的抽样频率应至少为载波频率最大值的两倍。如果信号频率很高,则仿真会变得非常慢,并且效率很低。为了加快仿真速度,当调制/解调技术的

3、参数选择或性能要求不是设计的关键时,通常使用基带仿真来代替通带仿真。 基带仿真一般被成为低通等效法仿真,它使用的是通带信号的复包络(complex envelope)。,5.2 通带模拟调制与解调,振幅调制(AM) DSB-SC 双边带抑制载波振幅调制 DSB-TC 双边带载波振幅调制 SSB QAM 频率调制(FM) 相位调制(PM),5.2.1 调制与解调函数介绍,1 通信工具箱提供的有关调制解调函数 ammod 功能:模拟信号幅度调制 语法:Y = ammod(X, Fc, Fs) ; Y = ammod(X,Fc,Fs,INI_PHASE) Y = ammod (X,Fc,Fs,INI

4、_PHASE,CARRAMP) Fs must satisfy Fs 2*(Fc + BW),5.2.1 调制与解调函数介绍,1 通信工具箱提供的有关调制解调函数 Fs = 8000; % Sampling rate is 8000 samples per second. Fc = 300; % Carrier frequency in Hz t=0:.1*Fs/Fs; % Sampling times for .1 second x = sin(20*pi*t); % Representation of the signal y = ammod(x,Fc,Fs); % Modulate x

5、to produce y. figure; subplot(2,1,1); plot(t,x); % Plot x on top. subplot(2,1,2); plot(t,y)% Plot y below.,5.2.1 调制与解调函数介绍,5.2.1 调制与解调函数介绍,1 通信工具箱提供的有关调制解调函数 ssbmod pmmod fmmod,5.2.1 调制与解调函数介绍,1 通信工具箱提供的有关调制解调函数 amdemod 功能:模拟幅度解调。 语法:z = amdemod(y,Fc,Fs) z = amdemod(y,Fc,Fs,ini_phase) z = amdemod(y,

6、Fc,Fs,ini_phase,carramp) z = amdemod(y,Fc,Fs,ini_phase,carramp,num,den) num,den = butter(5,Fc*2/Fs),5.2.1 调制与解调函数介绍,2 解调过程中低通滤波器的使用 butter 功能:数字巴特沃斯滤波器与模拟巴特沃斯滤波器设计 语法:B,A=butter(N,Wn) 说明:设计一个N阶低通巴特沃斯滤波器,返回滤波器的系数,A为分母的系数,B为分子的系数。A和B为长度为N+1的向量。系数按照Z的降幂排列。 The cut-off frequency Wn must be 0.0 Wn 1.0, w

7、ith 1.0 corresponding to half the sample rate.,t = .01; Fc = 10000; Fs = 80000; t = 0:1/Fs:0.01; s = sin(2*pi*300*t)+2*sin(2*pi*600*t); % Original signal num,den = butter(10,Fc*2/Fs); % Lowpass filter y1 = ammod(s,Fc,Fs); % Modulate. s1 = amdemod(y1,Fc,Fs,0,0,num,den); % Demodulate. subplot(3,1,1);

8、plot(t,s) subplot(3,1,2); plot(t,y1) subplot(3,1,3); plot(t,s1),5.2.2 单边带抑制载波振幅调制与解调,1 原理分析,上边带调幅波的频谱图,下边带调幅波的频谱图,5.2.2 单边带抑制载波振幅调制与解调,1 原理分析,单边带调幅方式的时域表达式比较复杂,有上边带 (USB)和下边带(LSB)两种方式,表达式分别如下:,其中 为 的希尔伯特变换,5.2.2 单边带抑制载波振幅调制与解调,调制 y = ssbmod(x,Fc,Fs) y = ssbmod(x,Fc,Fs,ini_phase) y = ssbmod(x,fc,fs,i

9、ni_phase,upper) 解调 z = ssbdemod(y,Fc,Fs) z = ssbdemod(y,Fc,Fs,ini_phase) z = ssbdemod(y,Fc,Fs,ini_phase,num,den),5.2.3 角度调制与解调,角度调制信号的一般表示式为,相位调制,频率调制,5.2.3.1 相位调制与解调,调制 y = pmmod(x,Fc,Fs,phasedev) y = pmmod(x,Fc,Fs,phasedev,ini_phase) 解调 z = pmdemod(y,Fc,Fs,phasedev) z = pmdemod(y,Fc,Fs,phasedev,in

10、i_phase),5.2.3.2 频率调制与解调,调制 y = fmmod(x,Fc,Fs,freqdev) y = fmmod(x,Fc,Fs,freqdev,ini_phase) 解调 z = fmdemod(y,Fc,Fs,freqdev) z = fmdemod(y,Fc,Fs,freqdev,ini_phase),% Prepare to sample a signal for two seconds, % at a rate of 100 samples per second. Fs = 100; % Sampling rate t = 0:2*Fs+1/Fs; % Time po

11、ints for sampling % Create the signal, a sum of sinusoids. x = sin(2*pi*t) + sin(4*pi*t); Fc = 10; % Carrier frequency in modulation phasedev = pi/2; % Phase deviation for phase modulation y = pmmod(x,Fc,Fs,phasedev); % Modulate. y = awgn(y,10,measured,103); % Add noise. z = pmdemod(y,Fc,Fs,phasedev

12、); % Demodulate. % Plot the original and recovered signals. figure; plot(t,x,k-,t,z,g-); legend(Original signal,Recovered signal);,加性高斯白噪声函数,y = awgn(x,snr) y = awgn(x,snr,sigpower) sigpower is the power of x in dBW . y = awgn(x,snr,measured) measures the power of x before adding noise. y = awgn(x,s

13、nr,sigpower,state) y = awgn(x,snr,measured,state),5.2.3 模拟幅度调制模块仿真,5.3.1 幅度键控(ASK),MATLAB函数 pammod y = pammod(x,M) (X中所有元素的值要小于M1) y = pammod(x,M,ini_phase) pamdemod z = pamdemod(y,M) z = pamdemod(y,M,ini_phase),5.3.1 幅度键控(ASK),x=1 0 0 1 1 0 1 y=pammod(x,2) y = 1 -1 -1 1 1 -1 1 x=1 0 3 1 1 2 1 y=pam

14、mod(x,4) y = -1 -3 3 -1 -1 1 -1,5.3.1 幅度键控(ASK),x=1 2 3 1 2 3 0 4 3 y=pammod(x,5) y = -2 0 2 -2 0 2 -4 4 2,5.3.1 幅度键控(ASK),5.3.2 频移键控(FSK),将数字信号调制在载波的频率上的调制方法称为频移键控(FSK),它也包括二电平频移键控(BFSK)和多电平频移键控(MFSK)。 频移键控的原理与调频类似,只是使用数字信号而已。,5.3.2 频移键控(FSK),对上例的二元序列10110010,画出2FSK的波形, x=0:0.01:8; t=ones(1,100),ze

15、ros(1,100),ones(1,100),ones(1,100),zeros(1,100),zeros(1,100),ones(1,100),zeros(1,101) y=sin(x.*(2*pi+2*t); plot(x,y),5.3.2 频移键控(FSK),可以看出,载频有所改变,由于调频同时必然带来了相位的改变,所以有相位的突变。,FSK波形,5.3.2 频移键控(FSK),调制 y = fskmod(x,M,freq_sep,nsamp) outputs the complex envelope y of the modulation of the message signal x

16、 using frequency shift keying modulation. M is the alphabet size and must be an integer power of 2. The message signal must consist of integers between 0 and M-1. freq_sep is the desired separation between successive frequencies in Hz. nsamp denotes the number of samples per symbol in y and must be

17、a positive integer greater than 1. The sampling rate of y is 1 Hz. By the Nyquist sampling theorem, freq_sep and M must satisfy (M-1)*freq_sep = 1. If x is a matrix with multiple rows and columns, the function processes the columns independently.,5.3.2 频移键控(FSK),调制 y = fskmod(x,M,freq_sep,nsamp,Fs)

18、specifies the sampling rate of y in Hz. Because the Nyquist sampling theorem implies that the maximum frequency must be no larger than Fs/2, the inputs must satisfy (M-1)*freq_sep = Fs. 解调 z = fskdemod(y,M,freq_sep,nsamp) z = fskdemod(y,M,freq_sep,nsamp,Fs),5.3.2 频移键控(FSK),M = 4; freqsep = 8; nsamp

19、= 8; Fs = 32; x = randint(6,1,M) % Random signal y = fskmod(x,M,freqsep,nsamp,Fs); % Modulate. t=0:1:47; plot(t,y),5.3.2 频移键控(FSK),5.3.3 相移键控(PSK),1 简介 将信道发送的信息调制在载波的相位上,所以通过数字相位调制,数字信号的载波相位是 , m=0,1,M-1。对二进制调制,两个载波的相位分别是0, 。对于M进制的相位调制,一组M个载波调相信号的波形的一般表达式为: m=0,1,M-1 其中 为发射端的滤波脉冲,决定了信号的频谱特征,A是信号振幅。,

20、5.3.3 相移键控(PSK),2 matlab函数 调制 y = pskmod(x,M) M is the alphabet size and must be an integer power of 2. The message signal must consist of integers between 0 and M-1. The initial phase of the modulation is zero. y = pskmod(x,M,ini_phase) 解调 z = pskdemod(y,M) z = pskdemod(y,M,ini_phase),5.3.3 相移键控(PS

21、K),len = 10000; % Number of symbols M = 16; % Size of alphabet msg = randint(len,1,M); % Original signal % Modulate using both PSK and PAM, % to compare the two methods. txpsk = pskmod(msg,M); txpam = pammod(msg,M); % Perturb the phase of the modulated signals. phasenoise = randn(len,1)*.015; rxpsk

22、= txpsk.*exp(j*2*pi*phasenoise); rxpam = txpam.*exp(j*2*pi*phasenoise);,an n-by-n matrix containing pseudorandom values drawn from the standard normal distribution,5.3.3 相移键控(PSK),% Create a scatter plot of the received signals. scatterplot(rxpsk); title(Noisy PSK Scatter Plot) scatterplot(rxpam); t

23、itle(Noisy PAM Scatter Plot) % Demodulate the received signals. recovpsk = pskdemod(rxpsk,M); recovpam = pamdemod(rxpam,M); % Compute number of symbol errors in each case. numerrs_psk = symerr(msg,recovpsk) numerrs_pam = symerr(msg,recovpam),5.3.3 相移键控(PSK),5.3.3 相移键控(PSK),N=7; K=4; row_num=100; g=1 1 0;0 1 1;1 1 1;1 0 1,eye(4); l=2K;%k比特传输信道 t=0:row_num-1*pi/50; sig=sin(t);%一个完整周期的正弦信号 p,codebook,partition=dpcmopt(sig,1,l); indx=dpcmenco(sig,codebook,partition,p); indx=indx; %可省略,msg=de2bi(indx); msg1=reshape(msg,row_num*K,1);

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论