Digital Signal Processing Reference
In-Depth Information
defined in Eq. (4.14). If only one input argument is provided, the correlation of the sequence with itself
is computed, which is referred to as the Auto-correlation sequence, which is thus defined as
N
1
C
[
k
]=
A
[
n
]
A
[
n
+
k
]
(4.15)
n
=
0
We thus run the following m-code:
y = xcorr([sin(2*pi*(0:1:7)/8)],[cos(2*pi*(0:1:7)/8)])
figure; stem(y)
:
:
Example 4.13.
Compute and plot the auto-correlation of the sequence sin ( 2 π( 0
1
7 )/ 4 ) .
We make the call
y = xcorr([sin(2*pi*2*(0:1:7)/8)]); figure; stem([-7:1:7],y)
which plots the correlation sequence versus lag number, with 0 representing the two sine sequences laying
squarely atop one another without offset, i.e., the CZL. Figure 4.11 shows the results.
Let's compute the correlation sequence between a single cycle of a sine wave having a period of N
samples and multiple cycles of a sine wave having a period of N samples. Figure 4.12 shows the correlation
sequence generated by correlating a sine wave having a period of 32 samples with four cycles of a sine
wave having the same period. Note that the correlation sequence comprises nonperiodic or transient “tail”
portions at each end and a central portion that is sinusoidal and periodic over 32 samples.
Now let's consider the correlation sequence between a sine wave having a single cycle over N
samples and a sine wave having multiple cycles over N samples. Figure 4.13, shows the result from
correlating a single cycle of a sine wave (of period N = 32) with a sequence of sine waves having two
cycles per N samples. Once the correlation sequence has proceeded to a certain point (the 32nd sample),
all samples of the first sequence are overlain with samples of the second sequence. From this time until
the second waveform starts to “emerge” (i.e., leave at least one sample of the first sequence “uncovered”
or “unmatched”), the correlation sequence value is zero due to orthogonality.
For purposes of discussion, we will refer to the shorter sequence as the correlator, the longer
sequence as the test or excitation sequence, and this fully “covered” state as “saturated.” In the saturated
state, the correlation sequence values reflect a “state-steady” response of the correlator to the test (or
excitation) signal when the test signal is periodic.
Figure 4.13 was generated by the script
LV CorrSeqSinOrthog(LenSeq 1 ,LenSeq 2 ,Freq 1 ,Freq 2 , phi)
and in specific, the call
LVCorrSeqSinOrthog(32,128,1,8,0)
The script receives as arguments two sequence lengths LenSeq 1 and LenSeq 2, two corresponding
frequencies Freq 1 and Freq 2, and a phase angle for the second sequence. It then constructs two sinusoidal
sequences of the lengths, frequencies, and phase specified and computes and plots the correlation sequence.
Let's do the experiment again, with the second sequence having three cycles over the same number
of samples as one cycle does in the first sequence. The call
Search WWH ::




Custom Search