pcspec.m

来自「此程序给出了不同情况的雷达距离测量仿真平台」· M 代码 · 共 73 行

M
73
字号
% PULSE COMPRESSION SPECTRUM USING FFT
% -------------------------------------
clear;clf;clc;

% Input Chirp Bandwidth and Pulsewidth

bw=1e6;		% Bandwidth - Hz
T= 1e-4; 	% Pulsewidth - 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);

% Plot Chirp Waveform

subplot(221);
plot(t,real(s));grid;
title(['Chirp Waveform']);

% Find Fourier Spectrum of Chirp

ZY= fft(s,lfft);
Y=fftshift(ZY);

% Find Power Spectral Density

Psd=Y.*conj(Y)/lfft;
A=ceil(max(Psd));
l=length(Y);
f=(1/T)*(-(l-1)/2:(l-1)/2);

% Plot Power Spectral Density

subplot(222);
plot(f,Psd/A);grid
axis([-bw bw 0 1]);
title(['Pulse Compression Spectrum']);
xlabel('Frequency - Hz');
ylabel('Amplitude');

% Find Matched Filter Time Waveform

zh=ifft(Psd,lfft);
h=fftshift(zh);

%Plot Time Waveform

subplot(223);
plot(t,abs(h));grid;
axis([-T/16 T/16 0 1 ]);
title(['PC Matched Filter Output']);
xlabel('Time - Sec');ylabel('Amplitude');

%Plot Log of Time Waveform

zz=20*log10(abs(h));
subplot(224);
plot(t,zz);grid;
axis([ -T/16 T/16 -60 0]);
title(['PC Matched Filter Output']);
xlabel('Time - Sec');ylabel('Amplitude - DB');



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?