Using the Discrete Fourier Transform

Using the Discrete Fourier Transform Generally speaking the expressions arising in the explicit computation of F (Z) are rather complicated. It is not...
2 downloads 0 Views 56KB Size
Using the Discrete Fourier Transform Generally speaking the expressions arising in the explicit computation of F (Z) are rather complicated. It is not so much the analytical computation, but rather the numerical use, of the discrete Fourier transform which primarily accounts for its importance. Here we will consider some of the more practical aspects of use of the discrete Fourier transform. Let us suppose we have a signal z(t) for t in an interval 0 < t < T , where T is a positive interval length. We will suppose the signal is sampled at the initial points, tk , of N equal intervals [tk , tk+1 ) = kT , (k+1)T , k = 0, 1, 2, ..., N − 1, yielding a measurement N N

vector Z ∈ E N with components zk = z(tk ), k = 0, 1, 2, ..., N − 1. The discrete Fourier transform of Z is then the vector C = FN−1 Z =

1 F N Z, N

whose components are given more explicitly by ck =

1 N

NX −1 j=0

wkj zj =

1 N

NX −1 j=0

w−kj zj =

1 N

NX −1

e−

2πkj N

zj .

j=0

In most applications the signal vector Z is real so that cN −k = ck , k = 1, 2, ..., N − 1, as indicated in the previous introductory section. Because this is the case, many Fourier analyzers display only the values c0 , c1 , ..., c N −1 (assuming, as is nearly always the case, that N is even). 2 In fact, typically what is displayed is |ck | , k = 0, 1, 2, ..., N2 − 1, or even the logarithms of these values. We define a single frequency signal vector Z to be one whose components take the form 2πkτ zk = A cos + φ , k = 0, 1, 2, ..., N − 1, N !

1

where A and τ are real and non-negative and φ is real but of arbitrary sign. The peak amplitude of the signal is A, the frequency is ω = τ /T and the phase shift is φ. Thus, for example, if T = 10 time units and 6πk 6πk zk = cos sin N N !

!

1 12πk = sin 2 n

!

1 12πk π = cos − , 2 N 2 !

6 then the peak amplitude is 12 , the frequency is ω = 10 = .6 and the π phase shift is − 2 . Of course we would assume here that N > 6.

Another definition of amplitude, the RMS, or root mean square, amplitude of the signal is given by

v u u u At

v u u u t

1 N

NX −1

1 N

NX −1

zk2

=

k=0

1 + cos



4πkτ N

v u u u t

1 N

+ 2φ



NX −1

A2

cos 2

k=1

A = √ if 2

2πkτ +φ N

!

NX −1

4πkτ = cos + 2φ = 0, 2 N k=1 k=1 √ which is typically true or approximately true. So we accept A/ 2 as the RMS amplitude of the signal. !

We then pose the following questions: i) What single frequency components of Z are recognized and displayed by the transform? ii) How can we compute the amplitudes and phase shifts associated with the various single frequency components of Z from the discrete Fourier transform C? Let us begin with question i). The single frequencies recognized by the transform are those associated with the Fourier vectors Wk , k = 0, 1, 2, ..., N − 1, with components i 2πkj N

(Wk )j = wkj = e

2πkj = cos N 2

!

2πkj + i sin , N !

the real and imaginary parts of which have frequency Tk , where T is the length of the time interval over which signals are sampled. Thus the frequencies recognized are ωk =

k , k = 0, 1, 2, ..., N − 1. T

The frequency increment between two of these recognized frequencies is δω = T1 . A real sinusoidal signal Z with components 2πkj zj = A cos +θ N

!

2πkj 2πkj = A cos cos θ − A sin sin θ N N !

!

    A A cos θ wkj + w(N −k)j + i sin θ wkj − w(N −k)j 2 2 A A = eiθ wkj + e−iθ w(N −k)j 2 2 manifests itself as a linear combination of Wk and WN −k with the conjugate coefficients

=

ck =

A iθ A e , cN −k = e−iθ ; 2 2

the other cj , j 6= k are then equal to zero. This “twin” representation of real sinusoidal signals is called aliasing. Because of this aliasing behavior many commerical Fourier analyzers display the ck (or |ck |, or log |ck |, etc.) only for k = 0, 1, · · · , N2 − 1. If a signal z(t) = A cos (2πωt) with ω 6= Tk , k = 0, 1, 2, ..., N − 1 is sampled, it will be interpreted as a linear combination of the frequencies which are recognized by the discrete Fourier transform FN . The resulting display of the |ck | will then have many non-zero values, exhibiting ˜ N − k˜ for which k˜ or N − k˜ lie closest to ω. If two peaks at the indices k, N N such frequencies, ω and ω ˜ , are present, they need to be separated by a 3

gap greater than δω = T1 in order for the peaks to be distinguishable; as a general guideline it is best to have |ω − ω ˜ | ≥ 2 δω = T2 . Example 1 A communications network operates at a nominal frequency of 10 megahertz (i.e., 107 cycles per second) and needs to be able to distinguish frequencies differing by 100 kilohertz (105 cycles per second). If discrete Fourier methods are used to analyze the network, what are the requirements on T and N ? To get the resolution indicated we need 2 < 105 ⇒ T > 2 × 10−5 . T Let us suppose we take T = 5 × 10−5 to be on the safe side. In order to h  N include the nominal frequency of 10 MHz in the range 0, 2T we need N > 107 ⇒ N > 2T × 107 = 103 2T

(in practice a power of 2 is always used for N , so this would indicate the use of N = 1024). Thus 1000 samples per sampling interval of T = 5 × 10−5 are needed, corresponding to a sampling rate of 2 × 107 (twenty million) samples per second. Returning to the general case, let us suppose the Fourier transform vector C includes the conjugate pair ck = ak + i bk , cN −k = ak − i bk . This means that the sum Z = c0 W0 + c1 W1 + · · · + cN −1 WN −1 includes the terms ck Wk + cN −k WN −k . The inverse Fourier transform of the vector (0 · · · 0ck 0 · · · 0cN −k 0 · · · 0) is then the vector Y with components

4

i 2πkj N

yj = ck e

−i 2πkj N

+ cN −j e

2πkj 2πkj = (ak + ibk ) cos + i sin N N

!

+

2πkj 2πkj 2πkj 2πkj + (ak − ibk ) cos − i sin = 2ak cos − 2bk sin = N N N N ! q a 2πkj b 2πkj k k 2 a2k + b2k q 2 cos − q 2 sin . N N ak + b2k ak + b2k !

Noting that

q

a2k + b2k = |ck | = |cN −k | and letting ak = cos φk , a2k + b2k

q

q

bk = sin φk , a2k + b2k

we see that yj = 2 |ck | cos 2πkj + φk . We conclude that the frequency N k is present with peak amplitude 2 |ck | and phase shift φk = tan−1 abkk . T 



Example 2 Let us suppose that N = 1024 samples per second are being taken over an interval of length T = 1 second. The Fourier transform is applied and it is then observed that c100 = 1 + i; c1024−100 = c924 = 1 − i. Thus a100 = b100 = 1, showing that the frequency ω = 100 = T 100 peak amplitude A = √ Hertz (cycles √ per second) is present with −1 2 2 2 1 + 1 = 2 2 and phase shift φ = tan 1 = π4 . Any other nonzero pairs c` , c1024−` present as components in the Fourier transform C correspond to other frequencies present in the signal.

5