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

举报
海神之光 发表于 2022/05/29 02:43:36 2022/05/29
【摘要】 一、获取代码方式 获取代码方式1: 完整代码已上传我的资源:【数字信号调制】基于matlab GUI数字频带(ASK+PSK+QAM)调制仿真 【含Matlab源码 483期】 获取代码方式2: 通过...

一、获取代码方式

获取代码方式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@yahoo.com.cn
%Loja (Ecuador)
%For more information, visit: www.miniyao.cn
%Last Modified by GUIDE v2.5 25-Jan-2019 22:07:45

% Begin initialization code - DO NOT EDIT
gui_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});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_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)==1
                se=[zeros(1,50) ones(1,50)];
            elseif h(n)==0 & h(n+1)==0
                se=[zeros(1,50) zeros(1,50)];
            elseif h(n)==1 & h(n+1)==0
                se=[ones(1,50) zeros(1,50)];
            elseif h(n)==1 & h(n+1)==1
                se=[ones(1,50) ones(1,50)];
            end
            bit=[bit se];
        end
        plot(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]; %modulante
        n=1;
    while n<=length(g)
        if g(n)==0
            tx=(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;
        end
            n=n+1;
            
    end

% Choose default command line output for digital_modulation
handles.output = hObject;

% Update handles structure
guidata(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 structure
varargout{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 aleatorios
ran=[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)==1
        se=[zeros(1,50) ones(1,50)];
    elseif h(n)==0 & h(n+1)==0
        se=[zeros(1,50) zeros(1,50)];
    elseif h(n)==1 & h(n+1)==0
        se=[ones(1,50) zeros(1,50)];
    elseif h(n)==1 & h(n+1)==1
        se=[ones(1,50) ones(1,50)];
    end
   
    bit=[bit se];
end
plot(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 1
        hold off;
        axes(handles.axes3)
        fc=30;
        g=handles.bits; %modulante
        n=1;
    while n<=length(g)
        if g(n)==0
            tx=(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;
        end
            n=n+1;
    end
    
%*-*-*-*-*-*-*-Modulation OOK*-*-*-*-*-*-*-*-*-
    case 2
        hold off;
        axes(handles.axes3);
        t=0:0.001:1;
        m=1;
        fc=30;
        g=handles.bits; %modulante
        n=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 3
        axes(handles.axes3)
        hold off;
        g=handles.bits;
        fc=10;
        n=1;
    while n<=length(g)
        if g(n)==0 %0 is -1
            tx=(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=(1)*sin(2*pi*fc*tx);
            plot(tx,p,'LineWidth',1.5);grid on;
            hold on;
        end
        n=n+1;
    end
    
%*-*-*-*-*-Modulation QPSK-*-*-*-*-*
    case 4
        axes(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);
            end
        
            c=cos(t);
            s=sin(t);
            cp=[cp die];    %Amplitude cosino
            sp=[sp die1];   %Amplitude sino
            mod=[mod c];    %cosino carrier (Q)
            mod1=[mod1 s];  %sino carrier   (I)
        end
        bpsk=cp.*mod+sp.*mod1;
        plot(bpsk,'LineWidth',1.5);grid on;
        title('QPSK modulation')
        axis([0 500 -1.5 1.5]); 

%-*-*-*-*Modulation 8PSK*-*-*-*-*-*-*-
    case    5
        axes(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)==1
        die=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)==0
        die=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)==0
        die=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)==1
        die=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)==1
        die=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)==0
        die=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)==0
        die=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)==1
        die=cos(-pi/8)*ones(1,150);
        die1=sin(-pi/8)*ones(1,150);
        se=[ones(1,50) ones(1,50) ones(1,50)];
        
    end
    c=cos(t);
    s=sin(t);
    cp=[cp die];    %Amplitude cosino
    sp=[sp -die1];   %Amplitude sino
    mod=[mod c];    %cosino carrier (Q)
    mod1=[mod1 s];  %sino carrier   (I)
end

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270
  • 271
  • 272
  • 273
  • 274
  • 275
  • 276
  • 277
  • 278
  • 279
  • 280
  • 281
  • 282
  • 283
  • 284
  • 285
  • 286
  • 287
  • 288
  • 289
  • 290
  • 291
  • 292
  • 293
  • 294
  • 295
  • 296
  • 297

四、运行结果

在这里插入图片描述

五、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 沈再阳.精通MATLAB信号处理[M].清华大学出版社,2015.
[2]高宝建,彭进业,王琳,潘建寿.信号与系统——使用MATLAB分析与实现[M].清华大学出版社,2020.
[3]王文光,魏少明,任欣.信号处理与系统分析的MATLAB实现[M].电子工业出版社,2018.

文章来源: qq912100926.blog.csdn.net,作者:海神之光,版权归原作者所有,如需转载,请联系作者。

原文链接:qq912100926.blog.csdn.net/article/details/114579926

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。