• No results found

Discrete Convolution and the Discrete Fourier Transform

N/A
N/A
Protected

Academic year: 2021

Share "Discrete Convolution and the Discrete Fourier Transform"

Copied!
11
0
0

Loading.... (view fulltext now)

Full text

(1)

Discrete Convolution and the Discrete Fourier Transform

Discrete Convolution First of all we need to introduce what we might call the “wraparound” convention. Because the complex num- bers wj = ei2πjN have the property wj±N = wj, which readily ex- tends to wj+m N = wj for any integer m, and since in the discrete Fourier context we represent all N -dimensional vectors as linear com- binations of the Fourier vectors Wk whose components are wkj, we make the convention that for any vector Z ∈ EN with components zk, k = 1, 2,· · · , N − 1, if we write zk with k lying outside the range 0 through N − 1 what is meant is zk+m N where m is the unique integer such that k + m N does lie in this range. Thus, for example, if N = 8 and we write z−13, what we mean is z−13+2×8 = z3. This convention may initially seem rather strange and arbitrary but, in fact, it is quite essential for effective use of and computation with the discrete Fourier transform.

Now suppose we have two real or complex vectors in EN: Z = ( z0 z1 · · · zN−1)t, Y = ( y0 y1 · · · yN−1)t.

The discrete convolution of these two vectors is another vector, which we denote by Z ∗ Y , defined componentwise by

(Z ∗ Y )k =

N−1

j=0 zk−j yj, k = 0, 1, 2, ....

In making this definition we have to take into account the fact that if j > k the index k−j will be negative. According to the convention just introduced, what is meant instead of zk−j is zk−j+N. Setting  = k − j we can see that

(Z ∗ Y )k =

N−1

j=0 zk−j yj =

k−N+1

=k

zyk− =

N−1

=0

yk−z = (Y ∗ Z)k,

(2)

the second inequality again following from the wraparound convention.

As a consequence we conclude that discrete convolution is commutative:

Z ∗ Y = Y ∗ Z.

Now we compute some discrete convolutions.

Example 1 If Z = ( 1 0 · · · 0 )t, then for any Y we have (Z ∗ Y )k = N−1

j=0

zk−jyj = yk

because zk−j = 0 when k = j and equals 1 when k = j. Thus the vector Z as shown here plays the role of the convolution identity.

Example 2 If Z = ( 1 1 · · · 1 )t, then for any Y we have (Z ∗ Y )k =

N−1

j=0 zk−jyj =

N−1

j=0 yj ≡ sY

and thus with Z as shown

Z ∗ Y = ( sY sY · · · sY )t = (sY)Z.

In particular, Z ∗ Z = N Z in this case.

Example 3 Let

Z = ( 3 2 1 0 · · · 0 1 2 )t for N ≥ 5 and let

Y = ( 0 · · · 0 1 0 1 0 · · · 0 )t

for the same value of N ; let us suppose the two 1’s are in positions k−1 and k + 1. In this case we can verify that Z ∗ Y has the form

Z ∗ Y = ( 0 · · · 0 1 2 4 4 4 2 1 0 · · · 0 )t;

the effect of the convolution is to ”blur” the two distinct 1’s into the extended pattern shown.

(3)

Just as the importance of the Laplace transform derives in large part from its behavior with respect to convolution of functions on [0,∞), the significance of the discrete Fourier transform also largely derives from its relationship to discrete convolution.

Theorem 1 For any two N -dimensional complex vectors Z and Y we have

F(Z ∗ Y ) = N F(Z) ⊗ F(Y )

where the product F(Z)⊗F(Y ) indicates the vector obtained with com- ponent by component multiplication; i.e.,

(F(Z) ⊗ F(Y ))k = (F(Z))k(F(Y ))k,

the right hand side being the ordinary numerical product of complex numbers.

Proof We compute F(Z ∗ Y )k = 1

N

N−1

j=0 w−kj(Z ∗ Y )j = 1 N

N−1

j=0 w−kj(

N−1

=0

zj−y)

= 1 N

N−1 j=0

N−1

=0

w−k(j−)zj−w−ky

= 1 N

N−1

=0

w−ky(

N−1 j=0

w−k(j−)zj−) = (setting m = j − )

= 1 N

N−1

=0

w−ky(

N−1− m=−

w−kmzm) = (taking the “wrap-around” effect into account)

= N ( 1 N

N−1

=0

w−ky) ( 1 N

N−1

m=0 w−kmzm)

= N (F(Y ))k(F(Z))k = (F(Y ) ⊗ F(Z))k,

(4)

which completes the proof.

Convolution Equations A (discrete) convolution equation is an equation of the form A ∗ Y = B, where A and B are known vectors in EN and Y is the vector in EN to be determined. Such an equation is simply a linear algebraic equation of a special type. If we define the N × N matrix

A =

a0 aN−1 aN−2 · · · a1

a1 a0 aN−1 · · · a2

a2 a1 a0 · · · a3

... ... ... ...

aN−1 aN−2 aN−3 · · · a0

,

whose first column is A and whose subsequent columns are “rotations”

of A, one can easily see that the convolution product A∗ Y is the same as the matrix-vector product A Y and the convolution equation takes the form A Y = B. Then we have the following

Proposition 1 The convolution equation A ∗ Y = B is solvable for arbitrary B ∈ EN (equivalently, the matrix A is nonsingular, so that A−1 exists) if and only if the discrete Fourier transform of A has no zero components; i.e.,

(F(A))k = 0, k = 0, 1, 2, ..., N − 1.

Proof From A∗Y = B we obtain, taking the discrete Fourier trans- form,

F(A ∗ Y ) = F(B).

Using the result from Section 3. on the discrete Fourier transform of a convolution product, this becomes

N F(A) ⊗ F(Y ) = F(B).

Looking at the k-th component on each side we have

N (F(A))k(F(Y ))k = (F(B))k, k = 0, 1, 2, ..., N − 1.

(5)

If (F(A))k = 0 for any k then it is clear that the corresponding compo- nent, (F(B))k, of F(B) must also be zero and the convolution equation cannot be solved for arbitrary vectors B. On the other hand, if all of the components of F(A) are different from zero, we simply divide to obtain

(F(Y ))k = (F(B))k N (F(A))k. We will write this vectorially as

F(Y ) = 1

NF(B)  F(A),

where the symbol  will be used to indicate component by component division of the first vector by the second. Then, applying the inverse transform, we have

Y = F−1( 1

NF(B)  F(A)).

This completes the proof of the proposition.

Solving Discrete Convolution Equations

Example 1 We consider the convolution equation in R4:

1 2 0 2

∗ Y =

1

−1−1 1

.

The discrete Fourier transform solution method involves application of the discrete Fourier transform to both sides of this equation and use of the property F(A ∗ Y ) = N F(A) ⊗ F(Y ). First of all, we have

F(A) = 1 4

1 1 1 1

1 −i −1 i

1 −1 1 −1

1 i −1 −i

1 2 0 2

= 1 4

5 1

−3 1

.

(6)

In this case none of the components of F(A) are zero so the solution process is a straightforward one. Computing

F(B) = 1 4

1 1 1 1

1 −i −1 i

1 −1 1 −1

1 i −1 −i

1

−1−1 1

=

0

12 + 2i 0

12 2i

,

and letting Z = F(Y ), we have the equation

F(A ∗ Y ) = 4 F(A) ⊗ Z =

5 1

−3 1

z0 z1 z2 z3

=

0

12 + 2i 0

12 2i

.

This is solved readily to give

Z =

0

12 + 2i 0

12 2i

.

Then, applying the inverse transform, we have

Y = F−1(Z) =

1 1 1 1

1 i −1 −i

1 −1 1 −1

1 −i −1 i

0

12 + 2i 0

12 2i

=

1

−1−1 1

.

The fact that the solution Y turns out to be the same as the original right hand side B is a coincidence particular to this example.

Example 2 In this example the solution process is complicated by the fact that one of the components of F(A) turns out to be zero. The convolution equation in question is

1 2 3

−6

∗ Y =

2 d 4 2d

=

2 0 4 0

+ d

0 1 0 2

≡ B0 + d B1,

(7)

where d is a parameter, initially undetermined. Here we have

F(A) = 1 4

1 1 1 1

1 −i −1 i

1 −1 1 −1

1 i −1 −i

1 2 3

−6

=

0

12 − 2i 2

12 + 2i

;

FB0 = 1 4

1 1 1 1

1 −i −1 i

1 −1 1 −1

1 i −1 −i

2 0 4 0

=

32

12

32

12

;

FB1 = 1 4

1 1 1 1

1 −i −1 i

1 −1 1 −1

1 i −1 −i

0 1 0 2

=

34 4i

34

4i

.

Since the transform is linear, letting Z = F(Y ), we have

4

0

12 − 2i 2

12 + 2i

z0 z1 z2 z3

=

32

12

32

12

+ d

34 4i

34

4i

.

From examination of the 0 component on both sides it is clear that we have to take d = −2 for consistency. Then z0 is arbitrary and we have

(−2 − 8i) z1 = 1 2 i

2 ⇒ z1 = 5− 3i 68 ; 8 z2 = 3

2 + 3

2 = 3 ⇒ z2 = 3 8; (−2 + 8i) z3 = 1

2 + i

2 ⇒ z3 = 5 + 3i 68 . Then

Y =

1 1 1 1

1 i −1 −i

1 −1 1 −1

1 −i −1 i

z0

5−3i68 38 5+3i68

= z0

1 1 1 1

+

13671

13639

13631

13663

.

(8)

Our next example shows that the discrete Fourier transform can be applied to solve, at least approximately, certain problems of classical mechanics. The example also shows that zero components of F(A) are not just an inconvenience but may correspond to degrees of freedom in the solution of the convolution equation A ∗ Y = B which we would quite naturally expect to find.

Example 4 A cable is strung between two vertical supporting struc- tures of equal height and is displaced from the horizontal due to the ef- fect of gravity acting on the cable. Letting 0 < x < 1 be the parametriza- tion in the horizontal direction and letting y(x) denote the vertical displacement of the cable, we have

τ d2y

dx2 − g ρ(x) = 0, 0 < x < 1,

where τ is the tension in the cable, g is the gravitational constant and ρ(x) is the cable mass per unit length. It is not difficult to solve this problem analytically but we will carry out an approximate solution as an example of application of Fourier solution of discrete convolution equations.

We discretize the problem by dividing the interval [0, 1) into N subin- tervals [xk−1, xk), k = 1, 2, ..., N , of equal length h = N1 and we replace the unknown displacement function y(x) by an N -dimensional vector Y = [y0, y1, ..., yN−1]T representing approximate displacements at the points xk. Since the supports at the endpoints are of equal height we can identify y0 with yN as we need to do in discrete Fourier analysis.

(In effect, we are assuming a periodic structure consisting of supports of equal height placed one unit apart with identical cables suspended between each adjacent pair of them.) We replace the second derivative operator by the standard second order divided difference approximation

d2y

dx2(xk) yk+1 − 2 yk + yk−1 h2

and we discretize the gravitational force to gk ≡ g ρ(xk) at the points xk, k = 0, 1, 2, ..., N−1. Then we let B be the vector whose components

(9)

are

bk =

 g0 − s = g ρ(0) − s, k = 0, gk = g ρ(xk), k = 1, 2, ..., N − 1,

where s is the force exerted by the supporting structure. Then we have τ N2A∗ Y − B = 0 ⇒ A ∗ Y = 1

τ N2 B,

where A = (−2 1 0 ... 0 1 )T, the omitted terms all being zero.

Taking the discrete Fourier transform and using the convolution prop- erty of the transform we have

NF(A) ⊗F(Y ) = 1

τ N2F(B) ⇒ F(Y )k = 1 τ N3

F(B)k

F(A)k, F(A)k = 0.

In this case, because 1 + (−2) + 1 = 0, the component F(A)0 = 0.

For consistency, then, we also must have F(B)0 = 0. But this last component is just g0− s + N−1k=1 gk, so we conclude that we must have

s =

N−1 k=0

gk,

which is just the statement that the magnitude of the supporting force s should be the sum of the magnitudes of he gravitational forces - very much to be expected from the principles of statics. Having made this choice, the component

F(Y )0 = 1 N

N−1 k=0

wk,

the average value of the vertical displacements, is arbitrary. But this is to be expected because we have not specified the height of the sup- porting structures.

For our computational treatment of this problem we will take τ = 1, g = 1, N = 16 and we will suppose that

ρ(x) =

1, 0 < x < 165 , 1116< x < 1, 4, 165 < x < 1116 .

(10)

This gives

B = ( 1− s 1 1 1 1 4 4 4 4 4 4 1 1 1 1 1 ) . The supporting force s is selected so the sum of the components of B is zero, i.e., s = 34. We used MATLABR to compute C = F2561 B ; because of the choice of s the first component of this discrete Fourier transform is zero. There is little point in providing the whole list of the components of C here. We also computed F(A); the first component is again zero and all other components are non-zero. We thus let

F(Y0)0 = 0, F(Y0)k = F(2561 B)k

16F(A)k , k = 1, 2, ..., 15.

At this point all components of F(Y ) have been determined except the first. Thus we can write F(Y ) =

F(Y0) + r ( 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )t, where r is yet to be determined. Then Y =

Y0 + rF−1(( 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )t)

= Y0 + r

16 ( 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 )t. It turns out in this example that Y0 =

( .2167 .1500 .0873 .0284 −.0265 −.0775 −.1129 −.1327

−.1368 −.1254 −.0983 −.0555 −.0089 .0416 .0961 .1544 )t. We suppose the height of the supporting posts is 1. Then we set 16r = 1− .2167 = .7833 to realize the value 1 as the first component of Y . To display the right hand supporting post we introduce a new component y16 = y0 = 1 and we plot the result in Figure 1.

(11)

Figure 1

0 0.2 0.4 0.6 0.8 1

0 0.2 0.4 0.6 0.8 1

−−> x

−−> y

Supported Cable as Constructed Using Discrete Fourier Transform

References

Related documents

The most important advantages using CFD modeling are: to obtain significant asymmetry in both metal flow and temperature fields, additionally it can be observed that the

Review of discrete-time signals and systems – Discrete Fourier Transform (DFT) and its properties, Circular convolution, Linear filtering using DFT, Filtering long

Furthermore, while symbolic execution systems often avoid reasoning precisely about symbolic memory accesses (e.g., access- ing a symbolic offset in an array), C OMMUTER ’s test

122 | P a g e concepts (X=2.84); adapting teaching methods to meet indiv iduals student’s needs (X=2.74); linking students’ ideas, values and beliefs to their classroom

Lam (The University of Hong Kong) ELEC4245 Jan–Apr, 2016 22 / 60 Convolution and discrete Fourier transform. Linear

Infants in both groups ex- perienced significantly more events of desatura- tion when compared with control infants who had 0.6 ± 0.4 episodes per 60 minutes of total record- ing

% The first half of the sampled values of x are the spectral components for % positive frequencies ranging from 0 to the Nyquist frequency 1/(2*dt) % The second half of the

Marie Laure Suites (Self Catering) Self Catering 14 Mr. Richard Naya Mahe Belombre 2516591 info@marielauresuites.com 61 Metcalfe Villas Self Catering 6 Ms Loulou Metcalfe