PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

502 Practical MATLAB® Applications for Engineers


>> f _ 3by3 = magic(3) % part(f)
f_3by3 =
8 1 6
3 5 7
4 9 2

>> DFT _ f _ 3by3 = (fft(f _ 3by3))’
DFT _ f _ 3by3 =
15.0000 4.5000 - 0.8660i 4.5000 + 0.8660i
15.0000 -6.0000 - 3.4641i -6.0000 + 3.4641i
15.0000 1.5000 + 4.3301i 1.5000 - 4.3301i
>> %Note that the results obtained in part(g) are not equal to part(f)
>> f _ trans _ 3by3 = (magic(3))’ % part(g)
f_trans_3by3 =
8 3 4
1 5 9
6 7 2

>> DFT _ f _ trans _ 3by3 = (fft(f _ trans _ 3by3))’ % part(h)
DFT _ f _ trans _ 3by3 =
15.0000 4.5000 - 4.3301i 4.5000 + 4.3301i
15.0000 -3.0000 - 1.7321i -3.0000 + 1.7321i
15.0000 -1.5000 + 6.0622i -1.5000 - 6.0622i

>> DFT _ f _ trans _ 3by3 = (fft2(f _ trans _ 3by3))’
DFT _ f _ trans _ 3by3 =
45.0000 0 0
0 13.5000 - 7.7942i 0 + 5.1962i
0 0 - 5.1962i 13.5000 + 7.7942i

>> DFT _ f _ 3by3 = (fft2(f _ 3by3))’
DFT _ f _ 3by3 =
45.0000 0 - 0.0000i 0 + 0.0000i
0 13.5000 - 7.7942i 0.0000 - 5.1962i
0 0.0000 + 5.1962i 13.5000 + 7.7942i

R.5.138 The command fft is used to evaluate the correlation function, which is used in
signal detection and estimation, in applications such as radar and sonar.
The autocorrelation of f 1 (n) is defi ned as:


Rs fnfn s s
n

11 () 1 ( ) ( 1 ) 


 


∑ over the range 

where s is referred to as the scanning or searching parameter. Observe that the
autocorrelation is very similar to the convolution. Recall that the convolution is
given by


fs fs fnfs n
n

12 ()⊗ ()∑ 12 ( ) ( )
 


Free download pdf