function varargout = OFDM_test(varargin)
% OFDM_TEST MATLAB code for OFDM_test.fig
% OFDM_TEST, by itself, creates a new OFDM_TEST or raises the existing
% singleton*.
%
% H = OFDM_TEST returns the handle to a new OFDM_TEST or the handle to
% the existing singleton*.
%
% OFDM_TEST('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in OFDM_TEST.M with the given input arguments.
%
% OFDM_TEST('Property','Value',...) creates a new OFDM_TEST or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before OFDM_test_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to OFDM_test_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 OFDM_test
% Last Modified by GUIDE v2.5 22-Nov-2018 23:50:12
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @OFDM_test_OpeningFcn, ...
'gui_OutputFcn', @OFDM_test_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 OFDM_test is made visible.
function OFDM_test_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 OFDM_test (see VARARGIN)
% Choose default command line output for OFDM_test
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes OFDM_test wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = OFDM_test_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;
set(handles.Path,'String',1);
set(handles.SNR,'String',20);
% --- Executes on button press in start.
function start_Callback(hObject, eventdata, handles)
str = get(handles.Modulation_type, 'String');
val = get(handles.Modulation_type,'Value');
switch str{val}
case 'QPSK'
modu_type = 0;
case '16QAM'
modu_type = 1;
end
SNR = str2double(get(handles.SNR,'String'));
if (isnan(SNR))
SNR = 20;
set(handles.SNR,'String',20);
end
pathes = str2double(get(handles.Path,'String'));
if (isnan(pathes))
pathes = 1;
set(handles.Path,'String',1);
end
OP = get(handles.OP_switch, 'Value');
config=OFDMSettings(modu_type, SNR, pathes, 1, 0, 0, OP,1024,8);
Baseband=OFDMSimpleSignalGenerator(config);
OFDM(config,Baseband);
function SNR_Callback(hObject, eventdata, handles)
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function SNR_CreateFcn(hObject, eventdata, handles)
% hObject handle to SNR (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
function Path_Callback(hObject, eventdata, handles)
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function Path_CreateFcn(hObject, eventdata, handles)
% hObject handle to Path (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 selection change in Modulation_type.
function Modulation_type_Callback(hObject, eventdata, handles)
guidata(hObject,handles)
% --- Executes during object creation, after setting all properties.
function Modulation_type_CreateFcn(hObject, eventdata, handles)
% hObject handle to Modulation_type (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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 during object creation, after setting all properties.
function axes1_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes1
% --- Executes on button press in BER_curve.
function BER_curve_Callback(hObject, eventdata, handles)
str = get(handles.Modulation_type, 'String');
val = get(handles.Modulation_type,'Value');
comp = get(handles.Compare_switch,'Value');
L = str2double(get(handles.Path,'String'));
switch str{val}
case 'QPSK'
modu_type = 0;
case '16QAM'
modu_type = 1;
end
OFDM_BER_SNR(modu_type, L, comp);
% --- Executes on button press in BER_path.
function BER_path_Callback(hObject, eventdata, handles)
str = get(handles.Modulation_type, 'String');
val = get(handles.Modulation_type,'Value');
comp = get(handles.Compare_switch,'Value');
SNR = str2double(get(handles.SNR,'String'));
switch str{val}
case 'QPSK'
modu_type = 0;
case '16QAM'
modu_type = 1;
end
OFDM_BER_L(modu_type, SNR, comp);
% hObject handle to BER_path (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in OP_switch.
function OP_switch_Callback(hObject, eventdata, handles)
% hObject handle to OP_switch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of OP_switch
% --- Executes on button press in Compare_switch.
function Compare_switch_Callback(hObject, eventdata, handles)
% hObject handle to Compare_switch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of Compare_switch
% --- Executes when user attempts to close figure1.
function figure1_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: delete(hObject) closes the figure
close(findobj(0,'Name','16QAM Constellation Diagram'));
close(findobj(0,'Nam
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 基于Matlab的OFDM仿真源码+全部资料.zip基于Matlab的OFDM仿真源码+全部资料.zip基于Matlab的OFDM仿真源码+全部资料.zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如软件工程、计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也可作为毕设项目、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 3、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
基于Matlab的OFDM仿真源码+全部资料.zip (23个子文件)
DigiC-Simulation-master
.gitignore 31B
OFDM
OFDMTransferImage.m 833B
rcoswindow.m 362B
qam16.m 762B
demoduqpsk.m 684B
README.adoc 259B
OFDM_test.fig 17KB
OFDM_BER_SNR.m 2KB
OFDMSimpleSignalGenerator.m 124B
QPSK_Demodulation.m 570B
OFDMReceiver.m 3KB
OFDMChannel.m 1KB
OFDMSettings.m 1KB
OFDMTransiver.m 4KB
qpsk.m 532B
OFDM_BER_L.m 2KB
OFDM.m 1KB
demoduqam16.m 910B
QAM16_Demodulation.m 796B
OFDM_test.m 8KB
Go.jpg 32KB
Window.m 344B
171265889347208773632.zip 416B
共 23 条
- 1
资源评论
不走小道
- 粉丝: 3199
- 资源: 4969
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功