数字信号调制基于matlab GUI数字信号调制系统(2ASK+2FSK+2PSK+4ASK+4FSK+4PSK带面板)含Matlab源码 1658期
Posted 紫极神光
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了数字信号调制基于matlab GUI数字信号调制系统(2ASK+2FSK+2PSK+4ASK+4FSK+4PSK带面板)含Matlab源码 1658期相关的知识,希望对你有一定的参考价值。
一、数字信号调制系统简介
二进制数字信号调制原理
数字调制是指用数字基带信号对载波的某些参量进行控制, 使载波的这些参量随基带信号的变化而变化。在通信系统中, 作为载波的正弦波有幅度、频率和相位3个参数, 对应的也就有3种基本的调制方式:调幅、调频和调相。由于数字信号不同与模拟信号的特殊性, 在数字载波通信中, 这3种基本的调制方式分别被称为幅移 (ASK) 、频移键控 (FSK) 和相移键控 (PSK) 。调制信号是二进制数字基带信号时, 这种调制称为二进制数字调制。在二进制数字调制中, 载波的幅度、频率和相位只有两种变化方式。
1 ASK调制
振幅键控是利用载波的幅度变化来传递数字信息, 而其频率和初相位保持不变。二进制幅度键控 (2ASK) 方式是数字调制方式中出现最早也是最简单的一种方法。这种方法最初用于电报系统, 二进制振幅键控常常作为研究其它数字调制方式的基础。2ASK调制信号只有0或1两个电平相乘的, 结果相当于将载频或者关断, 或者接通, 它的实际意义是当调制的数字信号为“1”时, 传输载波;当调制的数字信号为“0”时, 不传输载波。
2ASK信号的一般表达式为:
其中
2 FSK调制
频移键控是利用载波的频率变化来传递数字信息。在2FSK中, 载波的频率随二进制基带信号在f1和f0的两个频率点变化。它的实际意义是当调制的数字信号为“1”或“0”时传输f1或f2频率的载波。
其中ω1=2nf1, ω0=2nf0, θn为频率为f1的载波的初始相位, φn为频率为f0的载波的初始相位。令 为Dn的反码, 即
则2FSK信号可表示为:
3 PSK调制
相移键控是利用载波的相位变化来传递数字信息, 而振幅和频率保持不变。PSK调制时, 载波的相位随调制信号状态不同而改变。如果两个频率相同的载波同时开始振荡, 这两个频率同时达到正最大值, 同时达到零值, 同时达到负最大值, 此时它们就处于“同相”状态;如果一个达到正最大值时, 另一个达到负最大值, 则称为“反相”。一般把信号振荡一次 (一周) 作为360度。如果一个波比另一个波相差半个周期, 我们说两个波的相位差180度, 也就是反相。当传输数字信号时, “1”码控制发0度相位, “0”码控制发180度相位。相移键控有很好的抗干扰性, 在有衰落的信道中也能获得很好的效果。
二、部分源代码
function varargout = xhcl(varargin)
% XHCL MATLAB code for xhcl.fig
% XHCL, by itself, creates a new XHCL or raises the existing
% singleton*.
%
% H = XHCL returns the handle to a new XHCL or the handle to
% the existing singleton*.
%
% XHCL('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in XHCL.M with the given input arguments.
%
% XHCL('Property','Value',...) creates a new XHCL or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before xhcl_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to xhcl_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help xhcl
% Last Modified by GUIDE v2.5 07-Jan-2022 15:44:18
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @xhcl_OpeningFcn, ...
'gui_OutputFcn', @xhcl_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin1)
gui_State.gui_Callback = str2func(varargin1);
end
if nargout
[varargout1:nargout] = gui_mainfcn(gui_State, varargin:);
else
gui_mainfcn(gui_State, varargin:);
end
% End initialization code - DO NOT EDIT
% --- Executes just before xhcl is made visible.
function xhcl_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 xhcl (see VARARGIN)
% Choose default command line output for xhcl
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes xhcl wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = xhcl_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
varargout1 = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sj;
N_m = 10;%随机信号长度
sj= randi([0,1],1,N_m);
t_begin=0;
t_end=1;
mt=0;
t=0:0.01:10;
for i=1:length(sj)
if(sj(i)==1);
mt=mt+1.*(t>=t_begin&t<t_end);
else
mt=mt+0.*(t>=t_begin&t<t_end);
end
t_begin=t_begin+1;
t_end=t_end+1;
end
axes(handles.axes1);
plot(t,mt);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sj;
t_begin=0;
t_end=1;
ASK2=0;
t=0:0.01:10;
for i=1:length(sj)
% t=t_begin:0.01:t_end
if(sj(i)==1)
ASK2=ASK2+sin(2*pi*t).*(t>=t_begin&t<t_end);
else
ASK2=ASK2+0.*(t>=t_begin&t<t_end);
end
t_begin=t_begin+1;
t_end=t_end+1;
end
axes(handles.axes3);
plot(t,ASK2);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sj;
t_begin=0;
t_end=1;
FSK2=0;
t=0:0.01:10;
for i=1:length(sj)
if(sj(i)==1)
FSK2=FSK2+sin(4*pi*t).*(t>=t_begin&t<t_end);
else
FSK2=FSK2+sin(2*pi*t).*(t>=t_begin&t<t_end);
end
t_begin=t_begin+1;
t_end=t_end+1;
end
axes(handles.axes3);
plot(t,FSK2);
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sj;
t_begin=0;
t_end=2;
PSK4=0;
t=0:0.01:10;
for i=1:2:length(sj)
if(sj(i)==1)
if(sj(i+1)==1)
PSK4=PSK4+sin(2*pi*t+1.5*pi).*(t>=t_begin&t<t_end);
else
PSK4=PSK4+sin(2*pi*t+pi).*(t>=t_begin&t<t_end);
end
else
if(sj(i+1)==1)
PSK4=PSK4+sin(2*pi*t+0.5*pi).*(t>=t_begin&t<t_end);
else
PSK4=PSK4+sin(2*pi*t).*(t>=t_begin&t<t_end);
end
end
t_begin=t_begin+2;
t_end=t_end+2;
end
三、运行结果
四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1] 沈再阳.精通MATLAB信号处理[M].清华大学出版社,2015.
[2]高宝建,彭进业,王琳,潘建寿.信号与系统——使用MATLAB分析与实现[M].清华大学出版社,2020.
[3]王文光,魏少明,任欣.信号处理与系统分析的MATLAB实现[M].电子工业出版社,2018.
[4]曾祥龙,梁清梅,索丽敏.运用MATLAB实现对数字信号调制的仿真[J].黑龙江科技信息. 2009,(32)
以上是关于数字信号调制基于matlab GUI数字信号调制系统(2ASK+2FSK+2PSK+4ASK+4FSK+4PSK带面板)含Matlab源码 1658期的主要内容,如果未能解决你的问题,请参考以下文章
数字信号调制基于matlab GUI 2ASK+2FSK+2PSK调制解调仿真含Matlab源码 1504期
数字信号调制基于matlab GUI AM调制系统含Matlab源码 2083期
数字信号调制基于matlab GUI AM调制系统含Matlab源码 2083期
数字信号调制基于matlab GUI PCM编码+QAM调制含Matlab源码 1095期