function varargout = GUI_QPSK(varargin)
% GUI_QPSK MATLAB code for GUI_QPSK.fig
% GUI_QPSK, by itself, creates a new GUI_QPSK or raises the existing
% singleton*.
%
% H = GUI_QPSK returns the handle to a new GUI_QPSK or the handle to
% the existing singleton*.
%
% GUI_QPSK('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUI_QPSK.M with the given input arguments.
%
% GUI_QPSK('Property','Value',...) creates a new GUI_QPSK or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before GUI_QPSK_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to GUI_QPSK_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 GUI_QPSK
% Last Modified by GUIDE v2.5 03-Dec-2018 20:37:56
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_QPSK_OpeningFcn, ...
'gui_OutputFcn', @GUI_QPSK_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 GUI_QPSK is made visible.
function GUI_QPSK_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 GUI_QPSK (see VARARGIN)
% Choose default command line output for GUI_QPSK
handles.output = hObject;
s=round(rand(1,100)); %生成二进制基带数据并画出基带信号图
N=1:100;
%figure(1);subplot(311);stem(N,s);title('基带信号');grid on;
Ps=1;
M=4; %QPSK星座图
d=sqrt(Ps)*sin(pi/M);
A=[1+1*i,-1+1*i,-1-1*i,1-1*i]*d;
%subplot(312);scatter(real(A),imag(A),'filled');title('QPSK星座图');hold on;
theta=0:pi/100:2*pi;
x=cos(theta);
y=sin(theta);
%plot(x,y);grid on;
Maptable=[0 0;0 1;1 1;1 0]; %QPSK格雷码比特映射
for j=1:2:100
for m=1:M
if isequal(s(j:j+1),Maptable(m,:))
Qu((j+1)/2)= (2*m-1)*pi/4;
x((j+1)/2)=A(m);
break
end
end
end %基带数据s携带的信息映射到X[n]
Am=1; %载波调制
T=0.0001; fc=6/T;
Smpl=1000;
deltaT=T/Smpl; %连续时间离散化间隔
Ns=5; %画出Ns个符号的波形
t=deltaT:deltaT:Ns*T; %离散时间序列
for j=1:Ns
index=(j-1)*Smpl+1:j*Smpl; %第i个符号对应的离散时间序号
g(index)=1; %矩形脉冲成型
X(index)=Am*g(index).*cos(2*pi*fc*t(index)+Qu(ceil(index/100.01))); %载波调制信号
end
%subplot(313);plot(t,X);title('QPSK调制信号波形');
SNR_dB=15; %定义信噪比
SNR=10^(SNR_dB/10); %定义线性信噪比
Ps=1; %发射功率
Pn=Ps/SNR; %噪声方差
x=x(1:50);
z=sqrt(Pn/2)*(randn(size(x))+randn(size(x))*i); %生成白噪声
h=1; %AWGN信道下,信道增益h=1
y=h*x+z; %基带接受信号
%figure(2);subplot(211);scatter(real(y(1:10)),imag(y(1:10)),'filled'); %y的星座图title('QPSK接收星座图');
for j=1:length(y)
Dist=abs(y(j)-A); %第j个接受信号与各星座图点的距离
[~,Index]=min(Dist); %找到距离最近的点
x_est(j)=A(Index); %得到发射调制信号的估计
s_est(2*j-1:2*j)=Maptable(Index,:); %得到比特数据的估计
end
W=1:100;
%subplot(212);stem(W,s_est);title('QPSK解调后信号');
for n=1:25
Pe_t(n)=2*sqrt(2)/4*erfc(sqrt(2*n)*sin(pi/M))-sqrt(2)/4*erfc(sqrt(2*n)*sin(pi/M))* sqrt(2)/4*erfc(sqrt(2*n)*sin(pi/M));
Pb_t(n)=0.5*Pe_t(n);
end
PESUM=0;
PBSUM=0
for n=1:25
for m=1:1000
SNR=n;
Ps=1;
Pn=Ps/SNR;
z=sqrt(Pn/2)*(randn(size(x))+randn(size(x))*i);
h=1;
y=h*x+z;
for j=1:length(y)
Dist=abs(y(j)-A);
[~,Index]=min(Dist);
x_est(j)=A(Index);
s_est(2*j-1:2*j)=Maptable(Index,:);
end
for k=1:100
if(s(k)+s_est(k)==1)
PBSUM=PBSUM+1;
end
end
for k1=1:50
if isequal(x(k1),x_est(k1))
PESUM=PESUM+0;
else
PESUM=PESUM+1;
end
end
end
Pb(n)=PBSUM/1000/100;
Pe(n)=PESUM/1000/50;
PBSUM=0;
PESUM=0;
end
SNRX=1:25;
%figure(3);plot(SNRX,Pb); hold on;plot(SNRX,Pe);scatter(SNRX,Pe_t);scatter(SNRX,Pb_t, 'filled');
%xlabel('信噪比 SNR(r/dB)');title('AWGN信道下误码率与误符号率曲线'); axis([1 25 0 1]);grid on;hold off;
H=sqrt(1/2)*(randn+i*randn);
Y=H*x+z;
%figure(4);subplot(211);scatter(real(Y(1:10)),imag(Y(1:10)),'filled');title('4PSK信道均衡前星座图');
Y1=Y/H;
%subplot(212);scatter(real(Y1(1:10)),imag(Y1(1:10)),'filled');title('4PSK信道均衡后星座图');
PESUM1=0;
PBSUM1=0
for n=1:25
for m=1:1000
SNR=n;
Ps=1;
Pn=Ps/SNR;
z=sqrt(Pn/2)*(randn(size(x))+randn(size(x))*i);
Y1=(H*x+z)/H;
for j=1:length(Y1)
Dist=abs(Y1(j)-A);
[~,Index]=min(Dist);
x_est1(j)=A(Index);
s_est1(2*j-1:2*j)=Maptable(Index,:);
end
for k=1:100
if(s(k)+s_est1(k)==1)
PBSUM1=PBSUM1+1;
end
end
for k1=1:50
if isequal(x(k1),x_est1(k1))
PESUM1=PESUM1+0;
else
PESUM1=PESUM1+1;
end
end
end
Pe1(n)=PESUM1/1000/50;
Pb1(n)=PBSUM1/1000/100;
PBSUM1=0;
PESUM1=0;
end
SNRX1=1:25;
%figure(5);
%plot(SNRX1,Pb1);
%hold on;
%plot(SNRX1,Pe1)
%scatter(SNRX1,Pe_t);
%scatter(SNRX1,Pb_t, 'filled');
%xlabel('信噪比 SNR(r/dB)');
%title('平衰落信道下误码率与误符号率曲线');
%axis([1 25 0 1])
%grid on;
%hold off;
handles.N=N;
handles.s=s;
handles.A_real=real(A);
handles.A_imag=imag(A);
handles.x=x;
handles.y=y;
handles.t=t;
handles.X=X;
handles.W=W;
handles.s_est=s_est;
handles.Y=Y;
handles.SNRX=SNRX;
handles.Pb=Pb;
handles.Pe=Pe;
handles.Pe_t=Pe_t;
handles.Pb_t=Pb_t;
handles.Y=Y;
handles.Y1=Y1;
handles.SNRX1=SNRX1;
handles.Pb1=Pb1;
handles.Pe1=Pe1;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes GUI_QPSK wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = GUI_QPSK_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 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)
axes(handles.axes1);
cla(handles.axes1),set(gca,'Visible','off');
axes(handles.axes2);
stem(handles.N,handles.s);title('基带信号');
axes(handles.axes3);
scatter(handles.A_real,handles.A_imag,'filled');title('QPSK星座图');
axes(handles.axes4);
plot(handles.t,handles.X);title('QPSK调制信号波形');
% --- 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)
axes(handles.axes1);
cla(handles.axes1),set(gca,'Visible','off');
axes(handles.axes2);
scatter(real(han
没有合适的资源?快使用搜索试试~ 我知道了~
【数字信号调制】基于matlab GUI QPSK调制+解调【含Matlab源码 646期】.zip
共7个文件
jpg:5个
m:1个
fig:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 4 下载量 30 浏览量
2021-11-29
22:52:45
上传
评论 4
收藏 277KB ZIP 举报
温馨提示
CSDN海神之光上传的代码均可运行,亲测可用,直接替换数据即可,适合小白; 1、代码压缩包内容 主函数:GUI_QPSK.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开GUI_QPSK.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可私信博主或扫描博客文章底部QQ名片; 4.1 博客或资源的完整代码提供 4.2 期刊或参考文献复现 4.3 Matlab程序定制 4.4 科研合作 功率谱估计: 故障诊断分析: 雷达通信:雷达LFM、MIMO、成像、定位、干扰、检测、信号分析、脉冲压缩 滤波估计:SOC估计 目标定位:WSN定位、滤波跟踪、目标定位 生物电信号:肌电信号EMG、脑电信号EEG、心电信号ECG 通信系统:DOA估计、编码译码、变分模态分解、管道泄漏、滤波器、数字信号处理+传输+分析+去噪、数字信号调制、误码率、信号估计、DTMF、信号检测识别融合
资源推荐
资源详情
资源评论
收起资源包目录
【数字信号调制】基于matlab GUI QPSK调制+解调【含Matlab源码 646期】.zip (7个子文件)
【数字信号调制】基于matlab GUI QPSK调制+解调【含Matlab源码 646期】
运行结果3.JPG 54KB
运行结果2.JPG 76KB
运行结果5.JPG 59KB
运行结果1.JPG 97KB
GUI_QPSK.m 10KB
GUI_QPSK.fig 54KB
运行结果4.JPG 51KB
共 7 条
- 1
资源评论
- weixin_440226292023-04-17资源有一定的参考价值,与资源描述一致,很实用,能够借鉴的部分挺多的,值得下载。
- m0_650406202022-05-10用户下载后在一定时间内未进行评价,系统默认好评。
- Kaixa9252022-12-18感谢大佬分享的资源,对我启发很大,给了我新的灵感。
- 2845112024-05-13资源内容详细,总结地很全面,与描述的内容一致,对我启发很大,学习了。
海神之光
- 粉丝: 5w+
- 资源: 6110
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功