【扩频通信】扩频通信系统仿真(带面板)【含GUI Matlab源码 1587期】

✅博主简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,Matlab项目合作可私信。
🍎个人主页:海神之光
🏆代码获取方式:
海神之光Matlab王者学习之路—代码获取方式
⛳️座右铭:行百里者,半于九十。

更多Matlab仿真内容点击👇
Matlab图像处理(进阶版)
路径规划(Matlab)
神经网络预测与分类(Matlab)
优化求解(Matlab)
语音处理(Matlab)
信号处理(Matlab)
车间调度(Matlab)

⛄一、扩频通信系统简介

** 扩频通信的基本原理**
1 扩频通信
所谓扩展频谱通信,可简单表述如下:“扩频通信技术是一种信息传输方式,其信号所占有的频带宽度远大于所传信息必需的最小带宽;频带的扩展是通过一个独立的码序列来完成,用编码及调制的方法来实现的,与所传信息数据无关;在接收端则用同样的码进行相关同步接收、解扩及恢复所传信息数据”。
扩频通信的基本特点,是传输信号所占用的频带宽度(W)远大于原始信息本身实际所需的最小带宽(B),其比值称为处理增益(Gp)。总之,我们用扩展频谱的宽带信号来传输信息,就是为了提高通信的抗干扰能力,即在强干扰条件下保证可靠安全地通信。这就是扩展频谱通信的基本思想和理论依据。
扩频通信的性能。扩频通信的可行性是从信息论和抗干扰理论的基本公式中引伸而来的。信息论中关于信息容量的香农( Shannon) 公式为:C=Blog2 ( 1+ SN)其中: C 为信道容量( 即极限传输速率) , B 为信号频带宽度, S 为信号功率, N 为噪声功率。Shannon 公式说明, 在给定的传输速率不变的条件下, 频带宽度和信噪比P 可以互换, 即可以通过增加频带宽度, 在信噪比较低的情况下传输信息。扩展频谱以换取信噪比要求的降低, 正是扩频通信的重要特点, 并由此为扩频通信的应用奠定了基础。扩频通信的一个重要参数是扩频增益, 反映了系统抗干扰能力的强弱, 是对信噪比改善程度的度量, 定义为接收机相关器输出信噪比和输入信噪比之比, 即
在这里插入图片描述
2 直接序列扩频
直接序列扩频就是直接用具有高码率的扩频码序列在发送端去扩展信号的频谱。而在接收端, 用相同的扩频码序列去进行解扩, 将展宽的扩频信号还原成原始的信息。直扩通信系统原理如图1 所示。
在这里插入图片描述
在这里插入图片描述
5 高斯加性白噪声(AWNG)
白噪声是指功率谱密度在整个频域内均匀分布的噪声。即其功率谱密度:
在这里插入图片描述

⛄二、部分源代码

function varargout = my_work(varargin)
% MY_WORK MATLAB code for my_work.fig
% MY_WORK, by itself, creates a new MY_WORK or raises the existing
% singleton*.
%
% H = MY_WORK returns the handle to a new MY_WORK or the handle to
% the existing singleton*.
%
% MY_WORK(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in MY_WORK.M with the given input arguments.
%
% MY_WORK(‘Property’,‘Value’,…) creates a new MY_WORK or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before my_work_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to my_work_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 my_work

% Last Modified by GUIDE v2.5 17-May-2019 11:55:22

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @my_work_OpeningFcn, …
‘gui_OutputFcn’, @my_work_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 my_work is made visible.
function my_work_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 my_work (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes my_work wait for user response (see UIRESUME)
% uiwait(handles.figure1);

% — Outputs from this function are returned to the command line.
function varargout = my_work_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 selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,‘String’)) returns popupmenu1 contents as cell array
% contents{get(hObject,‘Value’)} returns selected item from popupmenu1

% — Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu1 (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
set(hObject, ‘String’, {‘直接扩频’, ‘跳频’});

% — Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,‘String’)) returns popupmenu2 contents as cell array
% contents{get(hObject,‘Value’)} returns selected item from popupmenu2

% — Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu2 (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
set(hObject, ‘String’, {‘m序列’, ‘gold码’,‘walsh码’});

% — 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)
figure(1);
clf;
code_length = 100;
rand_x=zeros(1,code_length);
rng(‘default’);
my_x=rand(1,code_length);
for i=1:code_length
if(my_x(i)>=0.5)
rand_x(i)=1;
end
end
subplot(2,1,1);
plot(rand_x);
title(‘随机信源序列’);
axis([0 code_length1.1 -2 2]);
grid on;
sampling_1=10;
rand_x1=signal_sampling(sign(rand_x-0.5),sampling_1);%变为双极性,且每个码元内采样10个点
seq_length=length(rand_x1);
subplot(2,1,2);
plot(rand_x1);
axis([0 seq_length
1.1 -2 2]);
title(‘采样后的双极性信源序列’);
grid on;

popup_sel_index_1 = get(handles.popupmenu1, ‘Value’);
popup_sel_index_2 = get(handles.popupmenu2, ‘Value’);
sig_noise = get(handles.edit3,‘string’);
s_n=str2double(sig_noise);

switch popup_sel_index_1
case 1
pn_seqence=my_seq(seq_length,popup_sel_index_2);
figure(2);
clf;
plot(pn_seqence);
axis([0 250 -2 2]);
title(‘伪随机码序列’);
grid on;
rec_signal=direct_spread(rand_x1,pn_seqence,s_n);
case 2
rec_signal=freq_hopping(rand_x1,popup_sel_index_2,s_n);
end

signal_x=rec_signal_jud(rec_signal,sampling_1);
[m_1,n_1]=symerr(signal_x,rand_x);%m表示误码个数,n表示误码率
set(handles.edit1,‘string’,m_1);
set(handles.edit2,‘string’,n_1);

n_sample=0:(code_length-1);
f=n_sample2pi/code_length;

axes(handles.axes1);
cla;
plot(rand_x);
axis([0 code_length*1.1 -1 2]);
title(‘信源序列’);
grid on;

axes(handles.axes2);
cla;
y1_abs=abs(fft(rand_x));
plot(f(1:floor(code_length/2)),y1_abs(1:floor(code_length/2)));
title(‘信源序列频谱图’);
grid on;
axes(‘position’,[0.55 0.5 0.15 0.15])
plot(f(1:round(0.2code_length)),y1_abs(1:round(0.2code_length)));
title(‘局部频谱图’);
xlim([0,0.5]);

axes(handles.axes3);
cla;
plot(signal_x);
axis([0 code_length*1.1 -1 2]);
title(‘恢复出的信源序列’);
grid on;

axes(handles.axes4);
cla;
y2_abs=abs(fft(signal_x));
plot(f(1:floor(code_length/2)),y2_abs(1:floor(code_length/2)));
title(‘恢复出的信源序列的频谱图’);
grid on;
axes(‘position’,[0.55 0.15 0.15 0.15])
plot(f(1:round(0.2code_length)),y2_abs(1:round(0.2code_length)));
title(‘局部频谱图’);
xlim([0,0.5]);

function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (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 edit3 as text
% str2double(get(hObject,‘String’)) returns contents of edit3 as a double

⛄三、运行结果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

⛄四、matlab版本及参考文献

1 matlab版本
2014a

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

3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除

🍅 仿真咨询
1 各类智能优化算法改进及应用

生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化、公交排班优化、充电桩布局优化、车间布局优化、集装箱船配载优化、水泵组合优化、解医疗资源分配优化、设施布局优化、可视域基站和无人机选址优化

2 机器学习和深度学习方面
卷积神经网络(CNN)、LSTM、支持向量机(SVM)、最小二乘支持向量机(LSSVM)、极限学习机(ELM)、核极限学习机(KELM)、BP、RBF、宽度学习、DBN、RF、RBF、DELM、XGBOOST、TCN实现风电预测、光伏预测、电池寿命预测、辐射源识别、交通流预测、负荷预测、股价预测、PM2.5浓度预测、电池健康状态预测、水体光学参数反演、NLOS信号识别、地铁停车精准预测、变压器故障诊断

3 图像处理方面
图像识别、图像分割、图像检测、图像隐藏、图像配准、图像拼接、图像融合、图像增强、图像压缩感知

4 路径规划方面
旅行商问题(TSP)、车辆路径问题(VRP、MVRP、CVRP、VRPTW等)、无人机三维路径规划、无人机协同、无人机编队、机器人路径规划、栅格地图路径规划、多式联运运输问题、车辆协同无人机路径规划、天线线性阵列分布优化、车间布局优化

5 无人机应用方面
无人机路径规划、无人机控制、无人机编队、无人机协同、无人机任务分配

6 无线传感器定位及布局方面
传感器部署优化、通信协议优化、路由优化、目标定位优化、Dv-Hop定位优化、Leach协议优化、WSN覆盖优化、组播优化、RSSI定位优化

7 信号处理方面
信号识别、信号加密、信号去噪、信号增强、雷达信号处理、信号水印嵌入提取、肌电信号、脑电信号、信号配时优化

8 电力系统方面
微电网优化、无功优化、配电网重构、储能配置

9 元胞自动机方面
交通流 人群疏散 病毒扩散 晶体生长

10 雷达方面
卡尔曼滤波跟踪、航迹关联、航迹融合

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值