www.gusucode.com > phased 案例源码 matlab代码程序 > phased/PlotCrossAmbiguityFunctionExample.m

    %% Plot Crossambiguity Function
% Plot the crossambiguity function between an LFM pulse and a delayed
% replica. Compare the crossambiguity function with the original ambiguity
% function. Set the sampling rate to 100 Hz, the pulse width to 0.5 sec,
% and the pulse repetition frequency to 1 Hz. The delay or lag is 10
% samples equal to 100 ms. The bandwidth of the LFM signal is 10 Hz.
fs = 100.0;
bw1 = 10.0;
prf = 1;
nsamp = fs/prf;
pw = 0.5;
nlag = 10;

%%
% Create the original waveform and its delayed replica.
waveform1 = phased.LinearFMWaveform('SampleRate',fs,'PulseWidth',1,...
    'SweepBandwidth',bw1,'SweepDirection','Up','PulseWidth',pw,'PRF',prf);
wav1 = waveform1();
wav2 = [zeros(nlag,1);wav1(1:(end-nlag))];
%%
% Plot the ambiguity and crossambiguity functions.
ambgfun(wav1,fs,prf,'Cut','Doppler','CutVal',0)
hold on
ambgfun(wav1,wav2,fs,[prf,prf],'Cut','Doppler','CutVal',0)
legend('Signal ambiguity', 'Crossambiguity')
hold off