Syntax
afmag = ambgfun(x,Fs,PRF)
[afmag,delay,doppler]
= ambgfun(x,Fs,PRF)
[afmag,delay,doppler]
= ambgfun(x,Fs,PRF,'Cut','2D')
[afmag,delay]
= ambgfun(x,Fs,PRF,'Cut','Doppler')
[afmag,doppler]
= ambgfun(x,Fs,PRF,'Cut','Delay')
[afmag,delay]
= ambgfun(x,Fs,PRF,'Cut','Doppler','CutValue',V)
[afmag,doppler]
= ambgfun(x,Fs,PRF,'Cut','Delay','CutValue',V)
ambgfun(x,Fs,PRF)
ambgfun(x,Fs,PRF,'Cut','2D')
ambgfun(x,Fs,PRF,'Cut','Delay')
ambgfun(x,Fs,PRF,'Cut','Doppler')
ambgfun(x,Fs,PRF,'Cut','Delay','CutValue',V)
ambgfun(x,Fs,PRF,'Cut','Doppler','CutValue',V)
Description
afmag = ambgfun(x,Fs,PRF) returns
the magnitude of the normalized ambiguity function for the vector x.
The sampling of x occurs at Fs hertz
with pulse repetition frequency, PRF. The sampling
frequency Fs divided by the pulse repetition
frequency PRF is the number of samples per pulse.
[afmag,delay,doppler]
= ambgfun(x,Fs,PRF) or [afmag,delay,doppler]
= ambgfun(x,Fs,PRF,'Cut','2D') returns
the time delay vector, delay, and the Doppler
frequency vector, doppler.
[afmag,delay]
= ambgfun(x,Fs,PRF,'Cut','Doppler') returns
the zero Doppler cut through the 2D normalized ambiguity function
magnitude.
[afmag,doppler]
= ambgfun(x,Fs,PRF,'Cut','Delay') returns
the zero delay cut through the 2D normalized ambiguity function magnitude.
[afmag,delay]
= ambgfun(x,Fs,PRF,'Cut','Doppler','CutValue',V) returns
a onedimensional cut through the 2D normalized ambiguity function
magnitude at a Doppler value of V Hertz. V should
lie in the range[Fs/2,Fs/2].
[afmag,doppler]
= ambgfun(x,Fs,PRF,'Cut','Delay','CutValue',V) returns
a onedimensional cut through the 2D normalized ambiguity function
magnitude at a delay value of V seconds. V should
lie in the range [(length(x)1)/Fs,(length(x)1)/Fs].
ambgfun(x,Fs,PRF) or ambgfun(x,Fs,PRF,'Cut','2D') with
no output argument produces a contour plot of the ambiguity function.
ambgfun(x,Fs,PRF,'Cut','Delay') or ambgfun(x,Fs,PRF,'Cut','Doppler') with
no output argument produces a line plot of the ambiguity function
cut.
ambgfun(x,Fs,PRF,'Cut','Delay','CutValue',V) or ambgfun(x,Fs,PRF,'Cut','Doppler','CutValue',V) with
no output argument produces a line plot of the ambiguity function
cut at nonzero cut values.
Output Arguments
afmag 
Normalized ambiguity function magnitudes. afmag is
an MbyN matrix where M is
the number of Doppler frequencies and N is the
number of time delays.

delay 
Time delay vector. delay is an Nby1
vector of time delays. The time delay vector consists of N
= 2*length(x)1 linearly spaced samples in the interval (length(x)/Fs,
length(x)/Fs). The spacing between elements is the reciprocal
of the sampling frequency.

doppler 
Doppler frequency vector. doppler is an Mby1
vector of Doppler frequencies. The Doppler frequency vector consists
of linearly spaced samples in the frequency interval [Fs/2,Fs/2).
The spacing between elements in the Doppler frequency vector is Fs/2^nextpow2(2*length(x)1).

Examples
expand all
Plot the ambiguity function magnitude of a rectangular pulse.
hrect = phased.RectangularWaveform;
x = step(hrect);
PRF = 2e4;
[afmag,delay,doppler] = ambgfun(x,hrect.SampleRate,PRF);
contour(delay,doppler,afmag);
xlabel('Delay (seconds)'); ylabel('Doppler Shift (hertz)');
This example shows how to plot zeroDoppler cuts of the autocorrelation sequences of rectangular and linear FM pulses of equal duration. Note the pulse compression exhibited in the autocorrelation sequence of the linear FM pulse.
hrect = phased.RectangularWaveform('PRF',2e4);
hfm = phased.LinearFMWaveform('PRF',2e4);
xrect = step(hrect);
xfm = step(hfm);
[ambrect,delayrect] = ambgfun(xrect,hrect.SampleRate,...,
hrect.PRF,'Cut','Doppler');
[ambfm,delayfm] = ambgfun(xfm,hfm.SampleRate,...,
hfm.PRF,'Cut','Doppler');
figure;
subplot(211);
stem(delayrect,ambrect);
title('Autocorrelation of Rectangular Pulse');
subplot(212);
stem(delayfm,ambfm)
xlabel('Delay (seconds)');
title('Autocorrelation of Linear FM Pulse');
Plot nonzeroDoppler cuts of the autocorrelation sequences of rectangular and linear FM pulses of equal duration. Both cuts are taken at a 5 kHz Doppler shift. Besides the reduction of the peak value, there is a strong shift in the position of the linear FM peak, evidence of rangedoppler coupling.
hrect = phased.RectangularWaveform('PRF',2e4);
hfm = phased.LinearFMWaveform('PRF',2e4);
xrect = step(hrect);
xfm = step(hfm);
fd = 5000;
[ambrect,delayrect] = ambgfun(xrect,hrect.SampleRate,...,
hrect.PRF,'Cut','Doppler','CutValue',fd);
[ambfm,delayfm] = ambgfun(xfm,hfm.SampleRate,...,
hfm.PRF,'Cut','Doppler','CutValue',fd);
figure;
subplot(211);
stem(delayrect*10^6,ambrect);
title('Autocorrelation of Rectangular Pulse at 5 kHz Doppler Shift');
subplot(212);
stem(delayfm*10^6,ambfm)
xlabel('Delay (\mu sec)');
title('Autocorrelation of Linear FM Pulse at 5 kHz Doppler Shift');
More About
expand all
The magnitude of the normalized ambiguity function is defined
as:
where E_{x} is the norm
of the signal, x(t), t is the
time delay, and f_{d} is a
Doppler shift. The asterisk (*) denotes the complex conjugate.
The ambiguity function is a function of two variables that describes
the effects of time delays and Doppler shifts on the output of a matched
filter.
The magnitude of the ambiguity function at zero time delay and
Doppler shift,
indicates the
matched filter output when the received waveform exhibits the time
delay and Doppler shift for which the matched filter is designed.
Nonzero values of the time delay and Doppler shift variables indicate
that the received waveform exhibits mismatches in time delay and Doppler
shift from the matched filter.
The magnitude of the ambiguity function achieves maximum value
at (0,0). At this point, there is perfect correspondence between the
received waveform and the matched filter. In the normalized ambiguity
function, the maximum value equals one.
References
[1] Levanon, N. and E. Mozeson. Radar Signals.
Hoboken, NJ: John Wiley & Sons, 2004.
[2] Mahafza, B. R., and A. Z. Elsherbeni. MATLAB^{®} Simulations for Radar Systems
Design. Boca Raton, FL: CRC Press, 2004.
[3] Richards, M. A. Fundamentals of Radar Signal
Processing. New York: McGrawHill, 2005.
See Also
phased.LinearFMWaveform  phased.MatchedFilter  phased.RectangularWaveform  phased.SteppedFMWaveform