Digital Signal Processing Reference
In-Depth Information
A script that implements the same demonstrations as given by the above-mentioned VIs is
ML _ Correlation
Figure 4.10, plot (c), shows the result after completely “sliding” the rightmost rectangle over the
leftmost rectangle, and hence having computed the entire correlation sequence for the two rectangles.
Corr Seq Val at Lag −7 is 1
1.5
10
1
0
0.5
−10
0
0
10
20
−5
0
5
(a) Sample
(b) Lag
Corr Seq Val at Lag 8 is 0
1.5
10
1
0
0.5
−10
0
0
10
20
−5
0
5
(c) Sample
(d) Lag
Figure 4.10: (a) Two rectangles just touching, ready to begin computing the correlation sequence; (b) First
value of correlation sequence, plotted at Lag -7; (c) The two rectangles, after the one which was right-
most originally has been moved to the left one sample at a time to compute the correlation sequence;
(d) Complete correlation sequence.
Example 4.12.
Using MathScript, compute and plot the correlation of the sequences sin ( 2 π( 0
:
1
:
:
:
7 )/ 4 ) and cos ( 2 π( 0
1
7 )/ 8 ) .
MathScript provides the function xcorr to compute the correlation sequence; if two input arguments
are provided, the Cross-correlation sequence is computed, which is just the correlation sequence as
 
Search WWH ::




Custom Search