# 1.算法描述

信道为Rayleigh衰落信道下的性能分析和Nakagami-m衰落信道下的性能分析。本课题我们采用的仿真参数如下：

 数据速率 100bps 频率间隔 100Hz 跳频频点 64个 跳频频率间隔 50Hz 跳频速率 50跳/s 跳频输出信号带宽 50*64 = 3200hz 低通信号频率变化 -1600 hz ~ 1600 hz 信号采样率 4000 hz 数据码元的仿真采样点数 40 每跳持续时间 0.02s

# 2.部分程序

``````clc;
clear;
close all;
warning off;

%参数初始化
%主要用于设置噪声
EbNo            = 1000;
SNR             = 10^(EbNo/10);
sigma           = 1/(sqrt(SNR))/2;
%系统参数初始化
Rb              = 100;%100bps
Sample_times    = 0.02;
Sample_Num      = 40;
MSK_track_depth = 16;

%梳状干扰有效性设置
S1              = 1;
S2              = 1;
S3              = 1;
S4              = 1;
S5              = 1;
S6              = 1;
S7              = 1;
S8              = 0;
S9              = 0;
S10             = 0;

%图4跳频载波频谱图
%图5信源的调制输出信号频谱图
%图6跳频扩频后的信号频谱图
%图8宽带噪声干扰频谱图
%图12梳状干扰频谱图(7个频点)

open('tops.mdl');
sim('tops.mdl');

%以下两个图是误码率的仿真图，需要重新调用在不同的信噪比下进行仿真
%所以需要如下代码的编写
%图9宽带噪声干扰信噪比误码率关系曲线
%tops1.mdl
%噪声干扰
EbNo            = [-20:2:6];
for i = 1:length(EbNo)
i
SNR             = 10^(EbNo(i)/10);
sigma           = 1/(sqrt(SNR))/2;
sim('tops1.mdl');
Err1(i)         = err1.signals.values(end,1);
end
figure;
semilogy(EbNo,Err1,'b-o');
xlabel('db');
xlabel('db');
grid on

%tops2.mdl
%单频干扰
for i = 1:length(EbNo)
i
SNR             = 10^(EbNo(i)/10);
sigma           = 1/(sqrt(SNR))/2;
sim('tops2.mdl');
Err2(i)         = err2.signals.values(end,1);
end
figure;
semilogy(EbNo,Err2,'b-o');
xlabel('db');
xlabel('db');
grid on

%tops2.mdl
%单频干扰
for i = 1:length(EbNo)
i
SNR             = 10^(EbNo(i)/10);
sigma           = 1/(sqrt(SNR))/2;
sim('tops3.mdl');
Err3(i)         = err3.signals.values(end,1);
end
figure;
semilogy(EbNo,Err3,'b-o');
xlabel('db');
xlabel('db');
grid on

save data1.mat EbNo Err1
save data2.mat EbNo Err2
save data3.mat EbNo Err3

``````