function varargout = askpskfsk(varargin)
% ASKPSKFSK MATLAB code for askpskfsk.fig
% ASKPSKFSK, by itself, creates a new ASKPSKFSK or raises the existing
% singleton*.
%
% H = ASKPSKFSK returns the handle to a new ASKPSKFSK or the handle to
% the existing singleton*.
%
% ASKPSKFSK('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in ASKPSKFSK.M with the given input arguments.
%
% ASKPSKFSK('Property','Value',...) creates a new ASKPSKFSK or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before askpskfsk_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to askpskfsk_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 askpskfsk
% Last Modified by GUIDE v2.5 26-Dec-2022 01:59:54
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @askpskfsk_OpeningFcn, ...
'gui_OutputFcn', @askpskfsk_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 askpskfsk is made visible.
function askpskfsk_OpeningFcn(hObject, eventdata, handles, varargin)
set(gcf,'name','基于MATLAB的常见数字通信系统的的仿真 作者:曹孟涛 20201009178');
h=handles.figure1; %获取句柄
newIcon=javax.swing.ImageIcon('123.jpg'); %读取图片文件
figFrame=get(h,'JavaFrame');
figFrame.setFigureIcon(newIcon);
handles.output = hObject;
guidata(hObject, handles);
% --- Outputs from this function are returned to the command line.
function varargout = askpskfsk_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;
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
global flag;global st;global st1;global st2;global st3;global st4;
if(flag==1)
i=10;
j=5000;
t=linspace(0,5,j);%0-5,5000个数的等差数列
fc=10;%载频
fm=i/5;
B=2*fc;
a=round(rand(1,i));%产生随机序列并取整
st=t;%将st定义为5000个数的序列
for n=1:10
if a(n)<1
for m=j/i*(n-1)+1:j/i*n%循环500次
st(m)=0;
end
else
for m=j/i*(n-1)+1:j/i*n
st(m)=1;
end
end
end
axes(handles.axes2);
plot(t,st);
axis([0,5,-1,2]);
end
if(flag==2)
i=10;
j=5000;
a=round(rand(1,i));
t=linspace(0,5,j);
f1=10;%载波1频率
f2=5;%载波2频率
fm=i/5;%基带信号频率
B1=2*f1;%载波1带宽
B2=2*f2;%载波2带宽
st1=t;
for n=1:10
if a(n)<1
for m=j/i*(n-1)+1:j/i*n
st1(m)=0;
end
else
for m=j/i*(n-1)+1:j/i*n
st1(m)=1;
end
end
end
st2=t;
for n=1:j
if st1(n)>=1
st2(n)=0;
else
st2(n)=1;
end
end
axes(handles.axes2);
plot(t,st1);
axis([0,5,-1,2]);
end
if(flag==3)
i=10;j=5000;fc=4;fm=i/5;B=2*fm;
t=linspace(0,5,j);
a=round(rand(1,i));
st3=t;
for n=1:10
if a(n)<1
for m=j/i*(n-1)+1:j/i*n
st3(m)=0;
end
else
for m=j/i*(n-1)+1:j/i*n
st3(m)=1;
end
end
end
st4=t; %基带信号求反
for k=1:j
if st3(k)>=1
st4(k)=0;
else
st4(k)=1;
end
end
axes(handles.axes2);
plot(t,st3);
axis([0,5,-1,2]);
end
if(flag==4)
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
global flag;global s1;global s2;global s3;global st3;global st4;global s4;global s5;
if(flag==1)
j=5000;
t=linspace(0,5,j);
fc=10;
s1=cos(2*pi*fc*t);
axes(handles.axes3);
plot(t,s1);
axis([0,5,-2,2]);
end
if(flag==2)
j=5000;f1=10;f2=5;
t=linspace(0,5,j);
s2=cos(2*pi*f1*t);
s3=cos(2*pi*f2*t);
axes(handles.axes3);
plot(t,s2);
axis([0,5,-2,2]);
end
if(flag==3)
j=5000;
t=linspace(0,5,j);fc=4;
s4=sin(2*pi*fc*t);
s5=sin(2*pi*fc*t+pi);
axes(handles.axes3)
plot(t,s4);
axis([0,5,-2,2]);
end
if(flag==4)
end
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
global flag;global st;global s1;global e_2ask;global e_fsk;global st1;global st2;global s2;
global s3;global st3;global st4;global s4;global s5;global e_psk;
if(flag==1)
j=5000;
t=linspace(0,5,j);
e_2ask=st.*s1;
axes(handles.axes3);
plot(t,e_2ask);
axis([0,5,-2,2]);
end
if(flag==2)
j=5000;
t=linspace(0,5,j);
F1=st1.*s2;%加入载波1
F2=st2.*s3;%加入载波2
e_fsk=F1+F2;
axes(handles.axes3);
plot(t,e_fsk);
axis([0,5,-2,2]);
end
if(flag==3)
j=5000;
t=linspace(0,5,j);
p1=st3.*s4;
p2=st4.*s5;
e_psk=p1+p2;
axes(handles.axes3);
plot(t,e_psk);
axis([0,5,-2,2]);
end
if(flag==4)
end
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
global flag;global e_2ask;global e_fsk;global e_psk;
if(flag==1)
j=5000;
noise =randn(1,j);
t=linspace(0,5,j);
e_2ask=e_2ask+noise;
axes(handles.axes3);
plot(t,e_2ask);
axis([0,5,-2,2]);
end
if(flag==2)
j=5000;
t=linspace(0,5,j);
nosie=randn(1,j);
e_fsk=e_fsk+nosie;
axes(handles.axes3);
plot(t,e_fsk);
axis([0,5,-2,2]);
end
if(flag==3)
j=5000;
t=linspace(0,5,j);
noise=randn(1,j);
e_psk=e_psk+noise;%加入噪声
axes(handles.axes3);
plot(t,e_psk);
axis([0,5,-2,2]);
end
if(flag==4)
end
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
global flag;global e_2ask;global s1;global at;global e_psk;global s4;global s5;
if(flag==1)
j=5000;i=10;fm=i/5;
t=linspace(0,5,j);
at=e_2ask.*s1;%解调
at=at-mean(at);
[f,af]=T2F(t,at);
[t,at]=lpf(f,af,2*fm);
axes(handles.axes3);
plot(t,at);
axis([0,5,-2,2]);
end
if(flag==2)
end
if(flag==3)
i=10; fm=i/5;
B=2*fm;
j=5000;
t=linspace(0,5,j);
e_psk=e_psk.*s4;%与载波相乘
[f,af]=T2F(t,e_psk);%通过低通滤波器
[t,e_psk]=lpf(f,af,B);
axes(handles.axes3);
plot(t,e_psk);
axis([0,5,-2,2]);
end
if(flag==4)
end
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
global flag;global e_2ask;global s1;global at;global st1;
global s2;global s3;global e_fsk;global st2;global e_psk;
if(flag==1)
j=5000;i=10;
t=linspace(0,5,j);
for m=0:i-1
if at(1,m*500+250)+0.5<0.5
for j=m*500+1:(m+1)*500
at(1,j)=0;
end
else
for j=m*500+1:(m+1)*500
at(1,j)=1;
end
end
end
axes(handles.axes3);
plot(t
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
matlab simulink仿真+GUI仿真 2ASK 2FSK 2PSK 2DPSK matlab simulink仿真+GUI仿真 2ASK 2FSK 2PSK 2DPSK matlab simulink仿真+GUI仿真 2ASK 2FSK 2PSK 2DPSK matlab simulink仿真+GUI仿真 2ASK 2FSK 2PSK 2DPSK 大学生通信课设使用 参数已调整,误码率控制在理论误差之内 包含8个仿真,其中ASK和FSK有基础设计和升级设计 软件设计利用MATLAB 2019版本,不清楚低版本是否适用
资源推荐
资源详情
资源评论
收起资源包目录
2ask_2fsk_2psk.zip (24个子文件)
dpsk.slx 38KB
psk1.slx 29KB
ask.slx 29KB
fsk2.slx 28KB
fsk1.slx 29KB
GUI设计
askpskfsk.fig 61KB
fft.m 45B
xulie.m 212B
F2T.m 323B
123.jpg 21KB
gsbzs.m 108B
ASK.m 1KB
lpf.m 469B
FSK.m 2KB
askfeixg.m 2KB
DPSK.m 3KB
PSK.m 2KB
jd.m 451B
askpskfsk.m 9KB
T2F.m 483B
ask1.slx 26KB
psk.slx 37KB
fsk3.mdl 71KB
dual_psk.mdl 34KB
共 24 条
- 1
资源评论
石大吴彦祖
- 粉丝: 8
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- #P0015. 全排列 超级简单
- pta题库答案c语言之排序4统计工龄.zip
- pta题库答案c语言之树结构7堆中的路径.zip
- pta题库答案c语言之树结构3TreeTraversalsAgain.zip
- pta题库答案c语言之树结构2ListLeaves.zip
- pta题库答案c语言之树结构1树的同构.zip
- 基于C++实现民航飞行与地图简易管理系统可执行程序+说明+详细注释.zip
- pta题库答案c语言之复杂度1最大子列和问题.zip
- 三维装箱问题(Three-Dimensional Bin Packing Problem,3D-BPP)是一个经典的组合优化问题
- 以下是一些关于Linux线程同步的基本概念和方法.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功