900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > 【数字信号调制】基于matlab GUI数字频带(ASK+PSK+QAM)调制仿真 【含Matlab源码 483期】

【数字信号调制】基于matlab GUI数字频带(ASK+PSK+QAM)调制仿真 【含Matlab源码 483期】

时间:2021-03-17 07:21:49

相关推荐

【数字信号调制】基于matlab GUI数字频带(ASK+PSK+QAM)调制仿真 【含Matlab源码 483期】

一、获取代码方式

获取代码方式1:

完整代码已上传我的资源:【数字信号调制】基于matlab GUI数字频带(ASK+PSK+QAM)调制仿真 【含Matlab源码 483期】

获取代码方式2:

通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。

备注:

订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);

二、数字频带调制简介

1 绪论

调制:把消息信号寄托到载波的某个参数上,形成已调信号。

解调:调制的逆过程,从已调信号中恢复消息信号。

2 调制的目的

无线通信中,匹配信道特性,提高发射信号的频率,减小天线尺寸;频谱搬移,一条信道中同时传输多路信号,多路复用,提高信道利用率;扩展信号带宽,提高系统抗干扰能力;实现带宽与信噪比的互换(有效性和可靠性);利用电话线将PC机接入Internet,需要翻译模/数信号。

3 调制的分类

3.1 涉及的信号

消息信号,又称调制信号、基带信号;

载波:运载工具,常用的是正弦波、脉冲序列;

已调信号:受调载波,载有消息信号的信息,具有多种形式。

3.2 可以从不同角度分类

按调制信号的类型:模拟调制/数字调制

按已调信号的频谱结构:线性调制/非线性调制

按正弦载波的受调参量:幅度调制/频率调制/相位调制

按载波信号的类型:连续波调制/脉冲调制

4 幅度调制

4.1 一般模型

(1)理论基础:傅里叶变换

(2)一般模型

幅度调制:消息信号控制正弦载波的幅度。

方法:用消息信号通过相乘器乘上载波信号,再通过带通滤波器(时域卷积滤波器特性)。

举例:AM、DSB、SSB、VSB。

4.2 常规双边带调幅AM

t 域:已调信号的波形,调制/解调方法

f 域:已调信号的频谱,带宽B

AM信号的包络正比于消息信号的规律,因此可以采用简单的**包络检波方法(非相干解调)**解调;

频谱由载波、上边带USB、下边带LSB组成。带宽BAM=2fH;

幅度调制又称为线性调制;

应用:中短波调幅广播。

缺点:功率利用率低,最多达到50%

4.3 抑制载波双边带DSB

频谱由上边带USB、下边带LSB组成,没有了载波分量。带宽BDSB=BAM=2fH;

调制效率可达100%。

采用相干解调:

方法:用消息信号通过想乘器乘上相干载波信号,再通过低通滤波器(时域卷积滤波器特性)。

要求:载波同步(相干载波和载波信号同频同相)

4.4 单边带调制SSB

只传输一个边带,频带利用率高。带宽BSSB=BAM/2=fH;在频谱拥挤的通信场合,如短波通信、多路载波电话系统。低功耗特性。使用于移动通信系统。

缺点:设备复杂,存在技术难点,需要相干解调。

4.5 残留边带调制VSB

残留边带滤波器特性:在载频处具有互补对称特性;介于单边带与双边带之间的方案。

5 角度调制

正弦载波有三个参量:幅度、频率、相位。都可以携带消息信号。

其中,频率(FM)和相位(PM)都称为角度调制。

频率调制(FM)

幅度恒定,对瞬时相位对t求微分,得到瞬时角频率。

调频的频谱由载频分量wc两侧的无数多对边频wc±nwm组成,其幅度取决于mf;

理论上,调频的带宽无穷大;

实际中,用卡森公式计算FM带宽:BFM=2(mf+1)fm。fm为调制信号的最高频率

FM调制为非线性调制。FM解调也称鉴频 ,采用微分电路+包络检波实现。

FM的特点和应用

特点:幅度不变,包络恒定。

优势:抗噪能力强;

代价:占用较大信道带宽,频谱利用率低;

应用:高质量或信道噪声大的场合。如卫星通信、移动通信、微波通信等。

6 抗噪声性能

性能指标:输出信噪比、制度增益

输入信噪比:Ni=n0B。n0是噪声的单边功率谱密度,B=2fH是带宽,是基带带宽的2倍。

AM DSB SSB VSB(幅度调制)

相干解调器:线性解调,信号和噪声可以分开处理。

双边带和单边带调制的抗噪声性能相同。

小信噪比时,信号被干扰为噪声,产生门限效应。原因是包络检波的非线性解调作用。

信噪比固定。

FM(角度调制)

FM系统可以通过增加传输带宽来改善抗噪声性能(信噪比)。

总结

频谱利用率 SSB>VSB>DSB/AM>FM

抗噪声性能:FM>DSB/SSB>VSB>AM

设备复杂度:AM最简,DSB/FM次之,SSB最复杂

三、部分源代码

function varargout = digital_modulation(varargin)%DIGITAL_MODULATION %Author: leslieyao%leslieyao2000@%Loja (Ecuador)%For more information, visit: %Last Modified by GUIDE v2.5 25-Jan- 22:07:45% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ...'gui_Singleton', gui_Singleton, ...'gui_OpeningFcn', @digital_modulation_OpeningFcn, ...'gui_OutputFcn', @digital_modulation_OutputFcn, ...'gui_LayoutFcn', [] , ...'gui_Callback', []);if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});elsegui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before digital_modulation is made visible.function digital_modulation_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to digital_modulation (see VARARGIN)hold off;axes(handles.axes1);h=[1 1 0 1 0 0 1 1 1 0];hold off;bit=[];for n=1:2:length(h)-1;if h(n)==0 & h(n+1)==1se=[zeros(1,50) ones(1,50)];elseif h(n)==0 & h(n+1)==0se=[zeros(1,50) zeros(1,50)];elseif h(n)==1 & h(n+1)==0se=[ones(1,50) zeros(1,50)];elseif h(n)==1 & h(n+1)==1se=[ones(1,50) ones(1,50)];endbit=[bit se];endplot(bit,'LineWidth',1.5);grid on;axis([0 500 -1.5 1.5]);%*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-axes(handles.axes3)hold off;fc=30;g=[1 1 0 1 0 0 1 1 1 0]; %modulanten=1;while n<=length(g)if g(n)==0tx=(n-1)*0.1:0.1/100:n*0.1;p=(1)*sin(2*pi*fc*tx);plot(tx,p,'LineWidth',1.5);grid on;hold on;else tx=(n-1)*0.1:0.1/100:n*0.1;p=(2)*sin(2*pi*fc*tx);plot(tx,p,'LineWidth',1.5);grid on;hold on;endn=n+1;end% Choose default command line output for digital_modulationhandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes digital_modulation wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = digital_modulation_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout{1} = handles.output;% --- Executes on button press in random.function random_Callback(hObject, eventdata, handles)% hObject handle to random (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)a=round(rand(1,10)); %genarar bits aleatoriosran=[a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10)];set(handles.bit1,'String',ran(1));set(handles.bit2,'String',ran(2));set(handles.bit3,'String',ran(3));set(handles.bit4,'String',ran(4));set(handles.bit5,'String',ran(5));set(handles.bit6,'String',ran(6));set(handles.bit7,'String',ran(7));set(handles.bit8,'String',ran(8));set(handles.bit9,'String',ran(9));set(handles.bit10,'String',ran(10));%*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*handles.bits=ran;h=handles.bits;axes(handles.axes1)hold off;bit=[];for n=1:2:length(h)-1;if h(n)==0 & h(n+1)==1se=[zeros(1,50) ones(1,50)];elseif h(n)==0 & h(n+1)==0se=[zeros(1,50) zeros(1,50)];elseif h(n)==1 & h(n+1)==0se=[ones(1,50) zeros(1,50)];elseif h(n)==1 & h(n+1)==1se=[ones(1,50) ones(1,50)];endbit=[bit se];endplot(bit,'LineWidth',1.5);grid on;axis([0 500 -1.5 1.5]);%*-*-*-*-*-*-*-*-*-*-*-*-hold off;axes(handles.axes3);cod=get(handles.select_mod,'Value');switch cod%*-*-*-*Modulation ASK*-*-*-*-*-*-*-*-*case 1hold off;axes(handles.axes3)fc=30;g=handles.bits; %modulanten=1;while n<=length(g)if g(n)==0tx=(n-1)*0.1:0.1/100:n*0.1;p=(1)*sin(2*pi*fc*tx);plot(tx,p,'LineWidth',1.5);grid on;hold on;% axis([0 n*2/fc -3 3]);else tx=(n-1)*0.1:0.1/100:n*0.1;p=(2)*sin(2*pi*fc*tx);plot(tx,p,'LineWidth',1.5);grid on;hold on;endn=n+1;end%*-*-*-*-*-*-*-Modulation OOK*-*-*-*-*-*-*-*-*-case 2hold off;axes(handles.axes3);t=0:0.001:1;m=1;fc=30;g=handles.bits; %modulanten=1;while n<=length(g)tx=(n-1)*1/length(g):0.001:n*1/length(g);p=(g(n))*sin(2*pi*fc*tx);plot(tx,p,'LineWidth',1.5);hold on;axis([0 (n)*1/length(g) -1.5 1.5]);grid on;n=n+1;end%*-*-*-*-*-*-*-Modulation BPSK*-*-*-*-*-*-*-*-*-*-*-case 3axes(handles.axes3)hold off;g=handles.bits;fc=10;n=1;while n<=length(g)if g(n)==0 %0 is -1tx=(n-1)*0.1:0.1/100:n*0.1;p=(-1)*sin(2*pi*fc*tx);plot(tx,p,'LineWidth',1.5);grid on;hold on;elsetx=(n-1)*0.1:0.1/100:n*0.1;p=(1)*sin(2*pi*fc*tx);plot(tx,p,'LineWidth',1.5);grid on;hold on;endn=n+1;end%*-*-*-*-*-Modulation QPSK-*-*-*-*-*case 4axes(handles.axes3)hold off;g=handles.bits;t=0:2*pi/99:2*pi;cp=[];sp=[];mod=[];mod1=[];for n=1:2:9;if g(n)==0 & g(n+1)==1;die=sqrt(2)/2*ones(1,100);die1=-sqrt(2)/2*ones(1,100);elseif g(n)==0 & g(n+1)==0;die=-sqrt(2)/2*ones(1,100);die1=-sqrt(2)/2*ones(1,100);elseif g(n)==1 & g(n+1)==0;die=-sqrt(2)/2*ones(1,100);die1=sqrt(2)/2*ones(1,100);elseif g(n)==1 & g(n+1)==1;die=sqrt(2)/2*ones(1,100);die1=sqrt(2)/2*ones(1,100);endc=cos(t);s=sin(t);cp=[cp die]; %Amplitude cosinosp=[sp die1]; %Amplitude sinomod=[mod c]; %cosino carrier (Q)mod1=[mod1 s]; %sino carrier (I)endbpsk=cp.*mod+sp.*mod1;plot(bpsk,'LineWidth',1.5);grid on;title('QPSK modulation')axis([0 500 -1.5 1.5]); %-*-*-*-*Modulation 8PSK*-*-*-*-*-*-*-case 5axes(handles.axes3)hold off;g=[handles.bits 0 0];t=0:2*pi/149:2*pi;cp=[];sp=[];mod=[];mod1=[];bit=[];for n=1:3:length(g);if g(n)==0 & g(n+1)==1 & g(n+2)==1die=cos(pi/8)*ones(1,150);die1=sin(pi/8)*ones(1,150);se=[zeros(1,50) ones(1,50) ones(1,50)];elseif g(n)==0 & g(n+1)==1 & g(n+2)==0die=cos(3*pi/8)*ones(1,150);die1=sin(3*pi/8)*ones(1,150);se=[zeros(1,50) ones(1,50) zeros(1,50)];elseif g(n)==0 & g(n+1)==0 & g(n+2)==0die=cos(5*pi/8)*ones(1,150);die1=sin(5*pi/8)*ones(1,150);se=[zeros(1,50) zeros(1,50) zeros(1,50)];elseif g(n)==0 & g(n+1)==0 & g(n+2)==1die=cos(7*pi/8)*ones(1,150);die1=sin(7*pi/8)*ones(1,150);se=[zeros(1,50) zeros(1,50) ones(1,50)];elseif g(n)==1 & g(n+1)==0 & g(n+2)==1die=cos(-7*pi/8)*ones(1,150);die1=sin(-7*pi/8)*ones(1,150);se=[ones(1,50) zeros(1,50) ones(1,50)];elseif g(n)==1 & g(n+1)==0 & g(n+2)==0die=cos(-5*pi/8)*ones(1,150);die1=sin(-5*pi/8)*ones(1,150);se=[ones(1,50) zeros(1,50) zeros(1,50)];elseif g(n)==1 & g(n+1)==1 & g(n+2)==0die=cos(-3*pi/8)*ones(1,150);die1=sin(-3*pi/8)*ones(1,150);se=[ones(1,50) ones(1,50) zeros(1,50)];elseif g(n)==1 & g(n+1)==1 & g(n+2)==1die=cos(-pi/8)*ones(1,150);die1=sin(-pi/8)*ones(1,150);se=[ones(1,50) ones(1,50) ones(1,50)];endc=cos(t);s=sin(t);cp=[cp die]; %Amplitude cosinosp=[sp -die1]; %Amplitude sinomod=[mod c]; %cosino carrier (Q)mod1=[mod1 s]; %sino carrier (I)end

四、运行结果

五、matlab版本及参考文献

1 matlab版本

a

2 参考文献

[1] 沈再阳.精通MATLAB信号处理[M].清华大学出版社,.

[2]高宝建,彭进业,王琳,潘建寿.信号与系统——使用MATLAB分析与实现[M].清华大学出版社,.

[3]王文光,魏少明,任欣.信号处理与系统分析的MATLAB实现[M].电子工业出版社,.

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。