MATLAB代码
面包多链接https://mbd.pub/o/author-a2mYl2tsbA==/work 。
知识星球:https://t.zsxq.com/11PZOV9jw ,永久获取更多相关资料、代码。
close all
clear all
warning off
fADC = 10e6; %sampling rate
fCar = 4e6; %carrier frequency
Ttotal = 7.5e-6; %total time duration
T = 5.5e-6; %signal duration
A = 1; %signal amplitude
num_jam = 2;
t = 0:1/fADC:T - 1/fADC; %signal time
tTotal = 0:1/fADC:Ttotal - 1/fADC; %time axis
Nspace = round((Ttotal - T)*fADC/2); %points of time without signal
%Generate MP signal
sigMP = A*exp(j*2*pi*fCar*t); %Generate the MP signal
sigMP = [zeros(1,Nspace),sigMP, zeros(1,Nspace)];
%Generate BPSK signal (11 bit Barker code)
Len = length(t);
Ncode = 11;
for kIndex = 1:Len
if kIndex<Len/Ncode
sBPSK(kIndex)=1;
elseif kIndex<Len/Ncode*2
sBPSK(kIndex)=1;
elseif kIndex<Len/Ncode*3
sBPSK(kIndex)=1;
elseif kIndex<Len/Ncode*4
sBPSK(kIndex)=-1;
elseif kIndex<Len/Ncode*5
sBPSK(kIndex)=-1;
elseif kIndex<Len/Ncode*6
sBPSK(kIndex)=-1;
elseif kIndex<Len/Ncode*7
sBPSK(kIndex)=1;
elseif kIndex<Len/Ncode*8
sBPSK(kIndex)=-1;
elseif kIndex<Len/Ncode*9
sBPSK(kIndex)=-1;
elseif kIndex<Len/Ncode*10
sBPSK(kIndex)=1;
else
sBPSK(kIndex)=-1;
end
end
sMP = A*exp(j*2*pi*fCar*t); %Generate the MP signal
sigBPSK = sMP.*sBPSK;
sigBPSK = [zeros(1,Nspace),sigBPSK, zeros(1,Nspace)];
%Generate LFM signal
B = 4e6;
chirpRate =B/Ttotal;
sigLFM = A*exp(j*2*pi*fCar*t + j*pi*chirpRate*t.^2);
sigLFM = [zeros(1,Nspace),sigLFM, zeros(1,Nspace)];
%Generate NLFM signal
a1 = 1e11;
a2 = 5e16;
sigNLFM = A*exp(j*2*pi*fCar*t + j*pi*a1*t.^2 + j*pi*a2*t.^3);
sigNLFM = [zeros(1,Nspace),sigNLFM, zeros(1,Nspace)];
%Input signal
sig = sigLFM;%change signal type for different input
figure;
plot(tTotal*1e6,sig)
xlabel('t/us')
ylabel('Amplitude')
sig = awgn(sig,1000,'measured');
figure;
plot(tTotal*1e6,sig)
xlabel('t/us')
ylabel('Amplitude')
title('无干扰回波时域波形')
联系客服