📄 pr3_25.m
字号:
%Problem3.25
%Simulates antijamming features of spread spectrum signal (no band elimination used) against narrow
%band jammer and compares to the ones of plain signals;
clear all; close all;
t=[0:0.001:2]; t1=[-1:0.001:2]; N=length(t); fo=25; fj=fo; %time scales and signal and jammer carrier frequencies;
WD=[0,40]; %vector of two deviations of LFM signal (for a plain signal WD=0);
S=[ones(2,ceil(N/2)),zeros(2,floor(N/2))].*exp(i*pi*WD'*((t-0.5).^2)); %two rows are two complex envelopes of LFM signals with different deviations;
Sbp=imag(S.*kron(ones(2,1),exp(i*2*pi*fo.*t))); %two LFM bandpass signals;
Fi=2*pi*unidrnd(10,1,10)/10; %random phases for 10 jammer realizations;
Aj=2; %set jammer amplitiude;
JM=Aj*sin(kron(ones(10,1),2*pi*fj*t1)+kron(ones(1,N+1000),Fi')); %10 realizations of an unmodulated jammer of carrier frequency fj;
for k=1:2 %in this loop the same is done for two LFM signals corrupted by the same jammer;
subplot(3,2,k); plot(t,Sbp(k,:)); ylim([-1.2 1.2]); ylabel('signal'); grid; %plotting signals;
Y=[zeros(10,1000),kron(ones(10,1),Sbp(k,:))]+JM; %10 observations of signal+jammer, front zeros added to make filtering stationary;
subplot(3,2,k+2); plot(t,Y(:,1001:end)); ylim([-1.5,1.5]*Aj); ylabel('signall+jam'); grid; %plotting observations;
mfout=filter(Sbp(k,ceil(N/2):-1:1),1,Y'); mfout=mfout'; %matched filtering of observation;
M=max(max(mfout)); mfout=mfout(:,1001:end)/M; %scaling to have nicer plot;
subplot(3,2,k+4); plot(t,mfout); xlabel('t/T'); ylabel('MF output'); ylim([-1.2,1.2]);
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -