📄 pcwina.m
字号:
% Pulse Compression Spectrum with Windows
% ---------------------------------------
% pcwina.m
clear;clf;clc;
% Input Chirp Bandwidth and Pulsewidth
bw=1e6; % Bandwidth - Hz
T=1e-4; % Pulse Width - sec
%Input FFT Points
lfft=1024;
% Set Time Base
t=-T/2:T/(lfft-1):T/2;
% Sample Complex Chirp
s= exp(-j*pi*bw*t.*t/T);
% Window Sample Chirp
w1=1; % Uniform Weighting
w2=.54+.46*cos(2*pi*t/T); % Hamming Weighting
w3=.5*(1+cos(2*pi*t/T)); % Hanning weighting
w4=.42+.5*cos(2*pi*t/T)+.08*cos(4*pi*t/T); % Blackman Weighting
sw1=s.*w1;sw2=s.*w2;sw3=s.*w3;sw4=s.*w4;
% Find Fourier Spectrum of Chirp
ZY1=fft(sw1,lfft);ZY2=fft(sw2,lfft);
ZY3=fft(sw3,lfft);ZY4=fft(sw4,lfft);
Y1=fftshift(ZY1);Y2=fftshift(ZY2);
Y3=fftshift(ZY3);Y4=fftshift(ZY4);
% Find Power Spectral Density
Psd1=Y1.*conj(Y1)/lfft;
Psd2=Y2.*conj(Y2)/lfft;
Psd3=Y3.*conj(Y3)/lfft;
Psd4=Y4.*conj(Y4)/lfft;
% Find Matched Filter Time Waveform
zh1=ifft(Psd1,lfft);zh2=ifft(Psd2,lfft);
zh3=ifft(Psd3,lfft);zh4=ifft(Psd4,lfft);
h1=fftshift(zh1);h2=fftshift(zh2);
h3=fftshift(zh3);h4=fftshift(zh4);
% Plot Log of Time Waveform
zz1=20*log10(abs(h1));
zz2=20*log10(abs(h2));
zz3=20*log10(abs(h3));
zz4=20*log10(abs(h4));
C1=max(zz1);C2=max(zz2);
C3=max(zz3);C4=max(zz4);
subplot(221);
plot(t,zz1-C1);grid;
axis([ -T/16 T/16 -40 0 ]);
title(['PC Matched Filter - Uniform']);
xlabel('Time - Sec');ylabel('Amplitude - DB');
subplot(222);
plot(t,zz2-C2);grid;
axis([ -T/16 T/16 -80 0 ]);
title(['PC Matched Filter - Hamming']);
xlabel('Time - sec');ylabel('Amplitude - dB');
subplot(223);
plot(t,zz3-C3);grid;
axis([ -T/16 T/16 -80 0 ]);
title(['PC Matched Filter - Hanning']);
xlabel('Time - sec');ylabel('Amplitude - dB');
subplot(224);
plot(t,zz4-C4);grid;
axis([ -T/16 T/16 -120 0 ]);
title(['PC Matched Filter - Blackman']);
xlabel('Time - sec');ylabel('Amplitude - dB');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -