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:
R s
f n f n 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
f s
f s
f n f s n
n
1
2
1
2
( )
( )
( ) (
)
⊗
∑
ϭ
Ϫ
ϭϪϱ
ϩϱ
CRC_47760_CH005.indd 502
CRC_47760_CH005.indd 502
7/23/2008 1:47:29 PM
7/23/2008 1:47:29 PM
Précédent

- 513/708

Suivant