📄 dfcm.m
字号:
% Dicke-Fix Countermeasure
% -------------------------
clf;clc;clear;
% Define Time Vector
tmax=.06;N=1024;
t=tmax*(1:N)/N;
% Sample Frequency
fs=N/tmax;
% Generate Modulated Signal
x=cos(2*pi*256*t)+3*square(2*pi*32*t).*cos(2*pi*256*t);
% Plot Waveform
subplot(2,2,1)
plot(t,x);grid;
xlabel('Time - sec');ylabel('Volts');
title(['Jam Waveform']);
% Limit Signal To Clip Level k
k=1;
for i=1:N;
y(i)=x(i);
if x(i)>k;y(i)=k;end;
if x(i)<-k;y(i)=-k;end;
end;
% Plot Limited Waveform
subplot(2,2,3);
plot(t,y);grid;
xlabel('Time - sec');ylabel('Volts');
title(['Clipped Waveform']);
% Find x and y for M steps
M=64;A=[];B=[];
for i=1:M;
A=[A x];B=[B y];end;
x=A;y=B;
% Extend t vector
N=N*M;
t=M*tmax*(1:N)/N;
% Find Power Spectrums
Y=fft(y);X=fft(x);
Py=Y.*conj(Y);Px=X.*conj(X);
Py=fftshift(Py);Px=fftshift(Px);
% Select Central Frequency Axis
Px(3*N/4+1:N)=[];
Px(1:N/4)=[];
Py(3*N/4+1:N)=[];
Py(1:N/4)=[];
fax=fs*(-N/4:N/4-1)/N;
% Normalize Amplitude
Px=Px/max(Px);
Py=Py/max(Py);
Pxdbm=30+10*log10(Px+1e-6);
Pydbm=30+10*log10(Py+1e-6);
% Plot Power Spectrums
subplot(2,2,2);plot(fax,Pxdbm);grid;
xlabel('Frequency - Hz');
ylabel('Power - dbm');
title(['Power Spectrum']);
axis([0 ,600 ,-30,40]);
subplot(2,2,4);plot(fax,Pydbm);grid;
xlabel('Frequency - Hz');
ylabel('Power - dbm');
title(['Jammed Spectrum']);
axis([0,600,-30,40]);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -