• Keine Ergebnisse gefunden

Digital Signal Processing

N/A
N/A
Protected

Academic year: 2021

Aktie "Digital Signal Processing"

Copied!
72
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Prof. Dr. V. Stahl

Heilbronn University of Applied Sciences

November 29, 2021

(2)

Contents

1 Foundations 3

1.1 Dirac Impulse . . . 3

1.2 Convolution . . . 5

1.3 Fourier Series . . . 7

1.4 Fourier Transform . . . 10

2 Sampling and Aliasing 11 2.1 Fourier Series of the Pulse Train . . . 11

2.2 Sampling . . . 12

2.3 Aliasing . . . 14

2.4 Band-Limited Signals . . . 16

3 Signal Reconstruction with Low Pass Filtering 17 3.1 Signal Reconstruction . . . 17

3.2 Low Pass Filter . . . 21

3.3 Windowing . . . 28

3.4 Discrete Time Fourier Transform . . . 32

4 Discrete Fourier Transform 34 4.1 Band-limited Periodic Signals . . . 34

4.2 Matrix Notation . . . 37

4.3 Examples . . . 41

5 Fast Fourier Transform 45 6 Properties of the DFT 54 6.1 Cyclic Shift . . . 55

6.2 Cyclic Convolution . . . 57

7 Fast Convolution with FFT 62 A Appendix 67 A.1 Properties of Convolution . . . 67

A.2 Fourier Transform Pairs . . . 68

A.3 Properties of Fourier Transform . . . 69

(3)

1 Foundations

1.1 Dirac Impulse

Consider a rectangular function in the time window 0 ≤t < εand amplitude 1:

dε(t) = 1

ε if 0≤t < ε 0 else

The area under this function is independent ofεalways 1, i.e.

Z

−∞

dε(t)dt = 1.

The function gets interesting whenεis very small. In that case the time duration approaches zero, the amplitude infinity. The result is the Dirac impulse or Delta functionδ:

δ(t) = limε→0

ε>0

dε(t).

Actually the limit is not a real function in R→ R. Therefore δ(t) is called a generalized function or distribution. The essential properties ofδ(t) are

δ(t) = 0 ift6= 0

∞ ift= 0 and

Z

−∞

δ(t)dt = 1.

We can do calculus with infinitely large numbers∞just as we do with infinitely small numbersdx. In both cases we merely use a simplified notation for a limit operation.

A rather useful property of the Dirac impulse is that it is an even function, i.e.

δ(t) = δ(−t).

As any other function we can shift the Dirac impulse to an arbitrary position t=aby

δ(ta) =

0 ift6=a

∞ ift=a As the Dirac impulse is an even function, it holds that

δ(ta) = δ(at).

If we multiply a functionf(t) with a shifted Dirac impulseδ(ta) we obtain f(t)δ(ta) = f(a)δ(ta)

(4)

for allt wheref(t) is continuous. We can convince ourselves easily that this is correct: For t6=aboth sides are zero and for t=a we havef(a)δ(0) on both sides. From this we can deduce the sifting property of the Dirac impulse.

Theorem 1.1 (Sifting Property) Letf ∈R→R. Then it holds that

Z

−∞

f(τ)δ(tτ) = f(t) for allt wheref(t)is continuous.

The proof is as follows:

Z

−∞

f(τ)δ(tτ) = Z

−∞

f(t)δ(tτ)

= f(t)Z

−∞

δ(tτ)

= f(t).

(5)

1.2 Convolution

The convolutionfg of two functionsf, g is defined by (fg)(t) = Z

−∞

f(τ)g(tτ)dτ.

Convolution is a binary function of functions like e.g. composition or addition of functions. Note that (fg)(t) is definined only if the convolution integral converges. This is always presumed in the following.

Convolution is commutative, i.e.

fg = gf.

This is obtained from

(fg)(t) = Z τ=−∞

f(τ)g(tτ) with the substitutionµ=tτ und =−dµ:

Z τ=−∞

f(τ)g(tτ) = Z −∞

µ=∞

−f(tµ)g(µ)

= Z µ=−∞

g(µ)f(tµ)

= Z τ=−∞

g(τ)f(tτ)

= (gf)(t).

What happens if we convolve a function f with a Dirac impulse δ? From Theorem 1.1 it follows that

(fδ)(t) = Z

−∞

f(τ)δ(tτ)

= f(t) and hence

fδ = f.

The Dirac impulse is therefore the neutral element of convolution.

When we attach an index ˆtat a function we mean from now on that the function is shifted by ˆt, i.e.

fˆt(t) = f(t−ˆt) for all t.

Convolving a function f with a shifted Dirac impulse has the effect that the

(6)

function is shifted:

(fδtˆ)(t) = Z

−∞

f(τ)δˆt(tτ)

= Z

−∞

f(τ)δ(t−ˆtτ)

= Z

−∞

f(t−ˆt)δ(t−ˆtτ)

= f(ttˆ)Z

−∞

δ(ttˆ−τ)

= f(ttˆ). Therefore it holds that

fδˆt = fˆt.

Convolution has many other properties, some of which are summarized in the following theorem.

Theorem 1.2 (Convolution)

fδ = f fδˆt = fˆt

fg = gf (fg)∗h = f∗(gh)

a(fg) = (af)∗g

(f1+f2)∗g = (f1g) + (f2g) fˆtg = (fg)ˆt.

Convolution has a neutral elementδ. Convolution with a shifted Dirac impulse causes shifting. Convolution is commutative and associative. The next two properties express that convolution is a linear operation. The last property is called time invariance. The proofs are not difficult and almost trivial if we use the convolution theorem of Fourier Transform.

(7)

1.3 Fourier Series

Theorem 1.3

Letf(t)be a piece wise continuousT-periodic signal. Then there exist Ak andϕk such that

f(t) = A0+

X

k=1

Akcos(kωt+ϕk), ω=2π T for allt wheref(t)is continuous.

A T-periodic signal can be presented as an overlay of harmonic oscillations whose frequencies are entire multiples of the fundamental frequencyω= 2π/T. We can simplify this sum somewhat with complex numbers.

f(t) = A0+

X

k=1

Akcos(kωt+ϕk)

= A0+

X

k=1

re

Akej(kωt+ϕk)

= A0+

X

k=1

re Akekejkωt

= A0+1 2

X

k=1

Akekejkωt+Akekejkωt

= A0+1 2

X

k=1

Akekejkωt+Ake−jϕke−jkωt

= A0+

X

k=1

1

2Akekejkωt+

X

k=1

1

2Ake−jϕke−jkωt

= A0

|{z}

z0

+

X

k=1

1 2Akek

| {z }

zk, k=1,2,...

ejkωt+

−∞

X

k=−1

1

2A−ke−jϕ−k

| {z }

zk, k=−1,−2,...

ejkωt

= z0+

X

k=1

zkejkωt+

−1

X

k=−∞

zkejkωt

=

X

k=−∞

zkejkωt where

z0 = A0

zk = 1

/2Akek f"urk >0

1/2A−ke−jϕ−k f"urk <0.

(8)

For example

z3 = 1 2A3e3 z−3 = 1

2A3e−jϕ3

= z3.

The Fourier coefficientszk appear in conjugate complex pairs, i.e.

z−k = zk.

From Fourier coefficient zk we can obtain amplitude and phase of the k-th harmonic:

A0 = z0

Ak = 2|zk|

ϕk = ^(zk), k= 1,2, . . .

In order to compute the n-th Fourier coefficient zn of function f(t) we begin with the equation

f(t) =

X

k=−∞

zkejkωt and multiply both sides withe−jnωt:

f(t)e−jnωtdt =

X

k=−∞

zkejkωte−jnωtdt.

Integration fromt= 0, . . . , T on both sides gives Z T

0

f(t)e−jnωtdt = Z T 0

X

k=−∞

zkejkωte−jnωtdt

=

X

k=−∞

zk

Z T 0

ej(k−n)ωtdt.

The integral can be solved as follows:

• If k=nwe have Z T

0

ej(k−n)ωtdt = Z T 0

1dt = T.

(9)

• If k6=nwe have Z T

0

ej(k−n)ωtdt = 1 j(kn)ω

hej(k−n)ωtiT

0

= 1

j(kn)ω

ej(k−n)ωT −1

ω= 2π/T

= 1

j(kn)ω

e2πj(k−n)−1

kn∈Z

= 1

j(kn)ω(1−1)

= 0 Hence

Z T 0

ej(k−n)ωtdt =

T ifk=n 0 else.

and therefore Z T

0

f(t)e−jnωtdt =

X

k=−∞

zk Z T

0

ej(k−n)ωtdt

| {z } T ifk=n, 0 else

= znT or

zn = 1 T

Z T 0

f(t)e−jnωtdt.

Theorem 1.4 (Fourier Series)

Letf ∈R→Rbe aT-periodic funcion and zk = 1

T Z T

0

f(t)e−jkωtdt whereω= 2π/T. Then it holds that

f(t) =

X

k=−∞

zkejkωt

for allt wheref(t)is continuous.

(10)

1.4 Fourier Transform

The decomposition into a Fourier series is only defined forT-periodic functions f(t). In order to analyze also non-periodic functions in the frequency domain we take the limitT → ∞. A periodic function whose period duration is infinitely long is actually a non-periodic function. This is the basic idea behind the transition from Fourier series to Fourier Transform.

Definition 1.5 (Fourier Transform) The function

F(ω) = Z

−∞

f(t)e−jωtdt is called Fourier Transform off(t). Inversely

f(t) = 1 2π

Z

−∞

F(ω)ejωt is called inverse Fourier Transform ofF(ω).

The most important properties of the Fourier Transform are summarized in the appendix.

Analogy between Fourier Series and Fourier Transform.

• In the Fourier Series of a T-periodic function f(t) the Fourier coefficient zktells us the amplitude and phase of thek-th harmonic in the frequency decomposition off(t).

• In analogy

1

2πF(ω)

tells us the amplitude and phase of the oscillation with frequency ω in the frequency decomposition of f(t). Because of factor every single oscillation has only infinitesimal amplitude provided thatF(ω) is finite.

In analogy to the physical mass density function we call F(ω) therefor spectral density function: Every point has only infinitesimal mass. In order to obtain the mass of an object we have to integrate his density function.

(11)

2 Sampling and Aliasing

2.1 Fourier Series of the Pulse Train

Let

p(t) =

X

n=−∞

δ(tnT).

Visuallyp(t) is an of an infinte sequence of Dirac pulses with distanceT. There- forep(t) is also called pulse train Dirac comb.

−T

−2T

−3T T 2T 3T

p(t)

t

· · ·

· · ·

As the pulse train isT-periodic, we can decompose it into a Fourier series p(t) =

X

k=−∞

zkejkωt, ω=2π T .

In order to avoid that during the computation of Fourier coefficient zk pulses appear at the integration limits we do not integrate from 0 to T but rather from −T/2toT/2. If a periodic function is integrated over an entire period it is irrelevant where to start.

zk = 1 T

Z T 0

p(t)e−jkωtdt

= 1

T Z T /2

−T /2

p(t)e−jkωtdt

= 1

T Z T /2

−T /2

δ(t)e−jkωtdt

= 1

T Z T /2

−T /2

δ(t)e0dt

= 1

T Z T /2

−T /2

δ(t)dt

= 1

T.

The Fourier coefficients zk of the pulse train are all equal 1/T. Therefore the Fourier series of the pulse train is

p(t) = 1 T

X

k=−∞

ejkωt.

(12)

2.2 Sampling

Time continuous signalsf(t) can be processed by a digital computer only after sampling. This means that we consider only function values off(t) at discrete points in time nTs whereTsis the sampling interval. The sampled values are

fn = f(nTs), n∈Z.

Sampling is often carried out by multiplication with a puse train p(t) =

X

n=−∞

δ(tnTs). The result is

fp(t) = f(t)p(t)

= f(t)

X

n=−∞

δ(tnTs)

=

X

n=−∞

f(t)δ(tnTs)

=

X

n=−∞

f(nTs)δ(tnTs)

=

X

n=−∞

fnδ(tnTs)

The sampled signalfp(t) consits of a sequence of pulses with distanceTswhere the pulse at time nTs is multiplied by samplefn.

t

· · · fp(t)

· · ·

f2

f1

f1

f2

f3

f3

f0

3Ts

2Ts

Ts

−T s

−2Ts

−3Ts

Probably you wonder why sampling is done in such a complicated way: The sampled signalfp(t) is an intermediate step between analogue and discrete. On the one hand sidefp(t) is still a time continuous function oft, on the other side fp(t) depends only on the samplesfn. This way we can apply all theory from analog functions and especially Fourier Transform tofp(t) and thereby transfer it to discrete signals. Further, f(t) and fp(t) are actually not as different as it seems at a first glance. For smallTsthe area underf(t) andfp(t) is almost the

(13)

same:

Z

−∞

fp(t)dt = Z

−∞

X

n=−∞

fnδ(tnTs)

=

X

n=−∞

fn

Z

−∞

δ(tnTs)

=

X

n=−∞

fn

= 1

Ts

X

n=−∞

fnTs

≈ 1 Ts

Z

−∞

f(t)dt.

This does not only hold for the entire area from−∞to∞but also for the area over finite intervals.

(14)

2.3 Aliasing

What is the effect of sampling f(t) in the frequency domain? If we use the Fourier series of the pulse train as derived in Section 2.1, we obtain

fp(t) = f(t)p(t)

= f(t) 1 Ts

X

k=−∞

ejkωst

= 1

Ts

X

k=−∞

f(t)ejkωst.

The Fourier Transform Fp(ω) of fp(t) is obtained from the Fourier Transform F(ω) off(t) and the correspondence

f(t)ejωtˆ c s F(ωωˆ). With ˆω=swe have

f(t)ejkωst c s F(ωs). From linearity of Fourier Transform it follows that

1 Ts

X

k=−∞

f(t)ejkωst

| {z } fp(t)

c s 1 Ts

X

k=−∞

F(ωs)

| {z } Fp(ω)

.

This result can be interpreted as follows: F(ωs) is the Fourier Transform F(ω) of the original functionf(t) shifted bys. The sum

X

k=−∞

F(ωs)

consists of infinitely many copies of F(ω) shifted by ωs on the frequency axis.

Hence

Fp(ω) = 1 Ts

X

k=−∞

F(ωs)

consists of infinitely many copies ofF(ω) shifted byωsand scaled by1/Ts. If the copies overlap, the overlapping parts are summed up. In that case F(ω) can no longer be obtained fromFp(ω) by cutting out one copy and scale it with Ts. This phenomenon is called Aliasing. The higher the sampling frequencyωs

is, i.e. the more samples per second we take, the farther lie the copies of F(ω) apart and the less likely overlapping occurs.

Let’s keep in mind:

Sampling withTs c s Periodic continuation withωs

and scaling with1/Ts.

(15)

f(t)

t

Ts t

Ts

t ω

ω

ω 1

−ωˆ ωˆ

ωs

ωs

2

−ωs

−ωs

2

Fp(ω)

−ωs ωs ωs

−ωs 2 2 fp(t)

fp(t)

1/Ts

1/Ts

Fp(ω) F(ω)

Figure 2.1: Top: Band limited signal f(t) with cutoff frequency ˆω and Fourier Transform F(ω). Middle: Sampled signal fp(t) =f(t)p(t). The sampling rate ωs = 2π/Ts ist larger than 2ˆω, therefore no aliasing. The copies of F(ω) do not overlap. Bottom: Sampling rate ωs ist smaller than 2ˆω, therefore aliasing occurs. The copies ofF(ω) overlap.

(16)

2.4 Band-Limited Signals

A functionf ∈R→Ris called band-limited with cutoff frequency ˆω if F(ω) = 0 for allω with|ω| ≥ω.ˆ

Informally this means that f(t) has no oscillation components with frequency above or equal ˆω.

Aliasing, i.e. an overlap in the frequency domain after sampling is avoided if the copies of F(ω) have distance more than 2ˆω on the frequency axis. The conditions to avoid aliasing are therefore:

• The signal f(t) has to be band-limited with cutoff frequency ˆω.

• The sampling rateωshas to be sufficiently high, i.e.

ωs>ω.

(17)

3 Signal Reconstruction with Low Pass Filter- ing

After the samples of a signal have been processed in a digital computer an analog signal has to be reconstructed from the resulting, discrete samples. This step is called digital-analog conversion.

With a small modification of the theory presented in this chapter we can also build frequency selective digital filters. Filtering is done in a digital computer by discrete convolution.

3.1 Signal Reconstruction

As shown above, the Fourier Transform offp(t) consists of infinitely many copies ofF(ω) shifted byωs. We assume in the following that the signalf(t) was band- limited with cutoff frequency ˆωand the sampling frequencyωswas high enough, i.e.

ωs/>ω.

This means that the assumptions of the sampling theorem are satisfied and the copies ofF(ω) inFp(ω) do not overlap.

For signal reconstruction we merely have to cut out one of these copies, scale it with Ts and transform it with the inverse Fourier Transform back into time domain.

Cutting out a copy in the frequency range

ωs

2 < ω < ωs

2

and scaling withTsis accomplished by multiplication with a rectangular func- tionG(ω) in the frequency domain

G(ω) =

Ts if|ω|< ωs/2 0 else.

Multiplying Fp(ω) and G(ω) in the frequency domain gives the Fourier Trans- form F(ω) of the original time signalf(t):

F(ω) = Fp(ω)G(ω)

= 1

Ts

X

k=−∞

F(ωs)

| {z }

Fp(ω)

G(ω).

The signalf(t) usually comes from a sensor and is not given by a closed math- ematical term. ThereforeF(ω) cannot be computed analytically and the multi- plication withG(ω) has to be done by convolution in time domain. Acoording to the convolution theorem we have

(fpg)(t) c s F(ω)G(ω).

(18)

The inverse Fourier Transform g(t) ofG(ω) is obtained as follows:

g(t) = 1 2π

Z

−∞

G(ω)ejωt

= Ts 2π

Z ωs/2

−ωs/2

ejωt

= Ts

2πjt

ejωtωs/2

−ωs/2

= Ts πt

1 2j

est/2+e−jωst/2

= Ts

πt im

est/2

= Ts

πt sin(ωst/2)

= Ts πtsin

πt Ts

daωs=2π Ts

= siπt Ts

= sinc(t/Ts). where

si(x) = sin(x)/x fallsx6= 0 1 fallsx= 0 sinc(x) = si(πx).

From the samples

fk = f(kTs)

we can reconstruct now the continuous signalf(t) for everyt∈Ras follows by convolution in time domain.

f(t) = (fpg)(t)

=

X

k=−∞

fkδ(tkTs)

!

| {z }

fp(t)

∗g(t)

=

X

k=−∞

fk(g(t)∗δ(tkTs)) (Linearity of convolution)

=

X

k=−∞

fkg(tkTs) (Convolution with shifted impulse)

=

X

k=−∞

fk sinc

tkTs Ts

=

X

k=−∞

fk sinc (t/Tsk).

(19)

Theorem 3.1 (Sampling Theorem)

Letf(t)be band-limited with cutoff frequencyωˆ and fk =f(kTs), k=−∞, . . . ,∞, Ts=2π

ωs. Let the sampling rateωs be big enough, i.e.

ωs>ω.

Thenf(t)can be reconstructed exactly from the samplesfk by f(t) =

X

k=−∞

fksinc (t/Tsk).

(20)

t

f(t)

fp(t)

ω

ω

ω F(ω)

ˆ

−ωˆ ω

t

−ωs

2

ωs

−ωs ωs

2 Fp(ω)

G(ω)

ωs

−ωs 2 2 Ts

1/Ts

1

Ts

Figure 3.1: Top: Band-limited signalf(t) with cutoff frequency ˆω and Fourier Transform F(ω). Middle: Sampled signal fp(t) =f(t)p(t). The sampling rate ωs= 2π/Tsis higher than 2ˆω, hence the copies ofF(ω) do not overlap. Bottom:

Rectangular function G(ω), which is multiplied with Fp(ω) to obtain F(ω) in frequency domain.

(21)

3.2 Low Pass Filter

With the results of the previous section we will show now how to do realize a low pass filter with a given cutoff frequencyωc. Filteringf(t) means that its Fourier Transform F(ω) has to be set to zero for allω with|ω| ≥ωc. As according to the Sampling Theoremf(t) is already band-limited with cutoff frequencyωs/2, low pass filtering makes only sense for

ωc< ωs

2 .

In order to implement this operation in time domain on samples we merely have to adapt the rectangular functionG(ω), which was used in the previous section for signal reconstruction by replacing the cut out range

h−ωs

2 s

2 i with

[−ωc, ωc].

We obtain a new rectangular function for low pass filtering G(ω) =

Ts if|ω|< ωc

0 else.

The product

H(ω) = Fp(ω)G(ω)

is now the Fourier Transform of the low pass filtered signal h(t).

As in the previous section multiplication in frequency domain has to be done with convolution in time domain. As before we obtaing(t) with inverse Fourier Transform:

g(t) = 1 2π

Z

−∞

G(ω)ejωt

= Ts

2π Z ωc

−ωc

ejωt

= Ts

2πjt ecte−jωct

= Ts

πtsin(ωct)

= 2

ωstsin(ωct)

= 2ωc

ωs 1

ωctsin(ωct)

= 2ωc

ωs si(ωct)

The low pass filtered signal h(t) is obtained by convolution h(t) = (fpg)(t).

(22)

ωc

−ωc

ωc

−ωc

ωc

−ωc

ωc

−ωc

f(t)

ω ω

ω

ω F(ω)

fp(t)

t

t

G(ω) Fp(ω)

H(ω) =Fp(ω)G(ω) 1/Ts

Ts

1 1

Figure 3.2: From top to bottom: Band limited signalf(t) and F(ω). Sampled signalfp(t) andFp(ω). Transfer functionG(ω) of the low pass filter with cutoff frequencyωc. Low pass filtered signalH(ω).

(23)

A low pass filter is a linear time invariant system with impulse response g(t).

For the practical computation there are two problems:

• The impulse response has infinite length which makes a practical compu- tation impossible.

• The system is non-causal, i.e. g(t)6= 0 fort <0. Low pass filtering can therefore not be done in real time without delays.

Both problems are solved as follows:

• Asg(t) is a si-function, its function values are small for absolutely larget and can be set to zero fort >ˆtfor some suitable ˆt. This is done in time domain by multiplication with a rectangular functionr(t) where

r(t) =

0 if|t| ≥ˆt 1 else.

By replacing the impulse response g(t) with g(t)r(t) we have a system withfiniteimpulse resonse.

Instead of cutting the impulse response “hard” at±ˆt with a rectangular functionr(t) we can also use a soft window function. A common choice is the Hamming Window:

˜

r(t) = 0 if|t| ≥ˆt 0.54 + 0.46 cos(πt/ˆt) else.

1

−ˆt ˆt

t

˜ r(t)

• The impulse responseg(t)r(t) is now limited to the range−ˆt,ˆt

but still not causal. This can be rectified if we shift it by ˆt. As shifting one factor in a convolution has the effect that the result of the convolution is shifted by the same amount we get merely a shift in the low pass filtered signal h(t) by ˆt. A short time delay is often acceptable in practical applications.

Summarizing, instead of the original impulse response g(t) we work with the modified causal and finite impulse response

x(t) = g(t−ˆt)r(t−ˆt) withx(t) = 0 fort6∈0,t.

(24)

The choice of ˆt requires a compromise: A big value of ˆt causes small errors as only small function values ofg(t) are set to zero. On the other hand a big value of ˆt causes large delays and high computation costs as shown below.

The (approximately) low passed filtered and by ˆtdelayed signalh(t) is obtained in the same way as for signal reconstruction in the previous section.

h(t) = (fpx)(t)

=

X

k=−∞

fkδ(tkTs)

!

x(t)

=

X

k=−∞

fk(δ(tkTs)∗x(t))

=

X

k=−∞

fkx(tkTs).

From this continuous signalh(t) we now take samplesh`. h` = h(`Ts)

=

X

k=−∞

fkx(`TskTs)

=

X

k=−∞

fkx((`k)Ts)

=

X

k=−∞

fkx`−k

= (fx)`.

The convolution in the last line is calleddiscreteconvolution of the samplesfk andxk of the signalsf(t) and the impulse responsex(t).

Definition 3.2 (Discrete Convolution)

The discrete convolution of two sequencesf` andg`is defined as (fg)` =

X

k=−∞

fkg`−k.

In order to obtain a simple representation of the filter coefficients xk, let ˆ

t = n

2Ts

for some integern. From

x(t) = g(t−ˆt)r(t−ˆt)

= 2ωc

ωs si(ωcttˆ)r(t−ˆt)

(25)

we obtain

xk = x(kTs)

= 2ωc

ωs si(ωc(kTs−ˆt))r(kTstˆ)

= 2ωc

ωs si(ωc(kn/2)Ts)r((kn/2)Ts)

= 2ωc ωs si

2πωc

ωs (kn/2)

rk−n/2

= 2ωc ωs sinc

2ωc

ωs (kn/2)

rk−n/2

= ˆωcsinc(ˆωc(kn/2))rk−n/2 where

ˆ

ωc = 2ωc ωs

is the normalized cutoff frequency with−1ˆc <1.

As the impuse response x(t) has finite length due to windowing, only finitely many filter coefficients xk are non-zero. Which ones is determined as follows:

For the window function it holds that

r(t) = 0 for|t| ≥ˆt . Replacingt by (kn/2)Ts on both sides we obtain

r((kn/2)Ts) = 0 for

kn 2

Tsn

2Ts and hence

rk−n/2= 0 for kn

2 ≥n

2 or

rk−n/2= 0 forknoderk <0.

Therefore only filter coefficientsxk are non-zero fork= 0, . . . , n−1.

For the rectangular window we have

rk−n/2 = 1, k= 0, . . . , n−1

and the multiplication with 1 can be ignored during the computation of the

(26)

filter coefficients. For the Hamming Window we have

˜

rk−n/2 = r((kn/2)Ts)

= 0.54 + 0.46 cosπ(kn/2)Ts

ˆ t

= 0.54 + 0.46 cosπ(kn/2)Ts

nTs/2

= 0.54 + 0.46 cos

π(2kn) n

= 0.54 + 0.46 cos 2πk

nπ

= 0.54−0.46 cos 2πk

n

, k= 0, . . . , n−1.

Summary. The filter coefficients of the low pass filter with cutoff frequency ωc of lengthnare given by

xk = ˆωcsinc(ˆωc(kn/2)), k= 0, . . . , n−1 where ˆωc is the normalized cutoff frequency

ˆ

ωc = 2ωc

ωs .

The low pass filter causes an additional delay of the signal by ˆ

t = n

2Ts

or n/2 cycles.

As the impulse response was cut out to obtain finite length we merely obtain an approximation which is more accurate the more coefficientsnthe filter uses.

In addition we can improve the result by using a Hamming Window. Doing so we have to multiplyxk with

wk = 0.54−0.46 cos 2πk

n

, k= 0, . . . , n−1.

The samplesh` of the low pass filtered signal are computed by discrete convo- lution

h` =

X

k=−∞

fkx`−k

=

X

k=−∞

f`−kxk

=

n−1

X

k=0

f`−kxk.

(27)

xk

ˆ ωc

wk

1 ˆ ωc

k

k

k n−1

n−1

n−1 n

2 n 2

n 2

Figure 3.3: Coefficients of the low pass filter xk of length n= 32 for ˆωc = 0.3 (top) und ˆωc = 0.8 (middle). The lower figure shows the weights wk of the Hamming window.

(28)

3.3 Windowing

Probably you wondered in the last section why Hamming Windowing should be an improvement over a simple rectangular window and why of all things the Hamming Window is chosen and not some other window function.

The purpose of windowing was to truncate the infinite impulse responseg(t) to a finite interval [−ˆt,ˆt]. This is accomplished by multiplication with a window functionr(t). What is the effect iff(t) is not convolved with the ideal, infinite impulse responseg(t) but with a truncated versiong(t)r(t)?

Let us compare g(t) and g(t)r(t) in the frequency domain. While G(ω) is an ideal rectangle and hence cuts out the desired frequency range precisely, we have to compute the Fourier Transform of g(t)r(t) by convolution in the frequency domain:

g(t)r(t) c s 1

2π(GR)(ω).

If R(ω) = 2πδ(ω) were an impulse, windowing with r(t) would not cause any distortion. However, in this case we would haver(t) = 1 and thus would not be limited to [−ˆt,ˆt]. A “good” windowing functionr(t) should therefore have the property that its Fourier Transform R(ω) is as close as possible to 2πδ(ω).

For the rectangular window r(t) =

0 if|t| ≥tˆ 1 else the Fourier Transform is

R(ω) = 2ˆtsi(ωˆt).

The constant factor 2ˆt causes merely scaling. The shape of the curve is de- termined by the factor si(ωˆt), which does not look like an impulse. For large values ofωˆtthe function value is very small. Hence, if ˆtis large, the magnitude of R(ω) is significant only near ω = 0. Near ω = 0 the value ofR(ω) is very large due to the multiplication with 2ˆt. Thus for large ˆt it is in fact true that R(ω) converges to an impulse. This was expected as for a large window width ˆt only very small values ofg(t) are truncated.

Let us consider now the Hamming Window

˜ r(t) =

0 falls|t| ≥tˆ

a+bcos(πt/ˆt) sonst witha= 0.54 andb= 0.46. Its Fourier Transform is

R˜(ω) = atsi(ωˆt)

| {z }

R(ω)

+bˆt si(ωˆtπ) + si(ωˆt+π) .

We obtain a weighted sum ofR(ω) and two by ±π shifted si-functions. These additional summands are chosen such that the disturbing side lobes in R(ω)

(29)

cancel out and a much smoother curve results, see picture 3.4. Hence the ideal transfer functionG(ω) is much less distorted by a Hamming Window than it is by a rectangular window.

The figure below shows a comparison between the rectangular window (solid line) and the Hamming Window (dashed line). A signal is filtered with cutoff frequency ωc = 2π×8kHz. The impulse response of the filter is truncated at ˆ

t= 0.2ms. Depicted is the audible frequency range up to 20kHz.

(30)

1

2π(G∗R)(ω) R(ω)

r(t)

−0.2 0.2 1

−1

t[ms℄

−20 20

−8

−20 20

f[kHz℄

f[kHz℄

8

Figure 3.4: Top: Window functions r(t) in time domain. Middle: Fourier TransformsR(ω) of the window functions. Bottom: The distorted transfer func- tions by windowing, which would ideally be a rectangle. Rectangular window:

solid line, Hamming Window: dashed line.

(31)

1

2π(G∗R)(ω) R(ω)

r(t)

−1 1

t[ms℄

−20 20

−8

−20 20

f[kHz℄

f[kHz℄

−0.6 0.6

8

Figure 3.5: Same figure as above, except that the window width has been increased from 0.2ms to 0.6ms. G(ω) is now closer to an impulse and the transfer function is much less distorted.

(32)

3.4 Discrete Time Fourier Transform

There is a second way to compute the Fourier TransformFp(ω) offp(t).

Starting with

fp(t) =

X

n=−∞

fnδ(tnTs) we obtain from the correspondence

δ(tnTs) c s e−jnωTs the Fourier Transform

fp(t) c s X

n=−∞

fne−jnωTs

| {z } Fp(ω)

.

We can computeFp(ω) either directly from the samples fn or fromF(ω):

Fp(ω) =

X

k=−∞

F(ωs)

=

X

n=−∞

fne−jnωTs

From both presentations we see immediately thatFp(ω) is periodic with period ωs, i.e.

Fp(ω+ωs) = Fp(ω) for allω.

By rescaling the frequency axis we can normalize the sampling interval to 1.

ForTs= 1 it holds that

Fp(ω) =

X

n=−∞

fne−jnω.

This transformation of a sequence fn is called discrete time Fourier Transform (DTFT). Hence Fp(ω) ist nothing but the z-Transform of fn for z =e, i.e.

forz on the unit circle.

FromFp(ω) we obtain by inverse Fourier Transform the original pulse train fp(t) and thus the samples fn. However, there is also a direct way: First, we multiply both sides withejkω

Fp(ω)ejkω =

X

n=−∞

fne−jnωejkω and then integrate forω from 0 to 2π:

Z 0

Fp(ω)ejkω = Z 0

X

n=−∞

fne−jnωejkω

=

X

n=−∞

fn

Z 0

ej(k−n)ω

(33)

As

Z 0

ej(k−n)ω = 2π ifk=n 0 else it follows that

Z 0

Fp(ω)ejkω = 2πfk

or

fk = 1 2π

Z 0

Fp(ω)ejkωdω.

The difference to the invese Fourier Transform of Fp(ω) which would have re- sulted in the impulse trainfp(t) is, that we integrate only from 0 to 2πand not from −∞bis∞.

Summarizing, the DTFT and its inverse are defined as follows. The corre- spondence is also valid if the assumptions of the Sampling Theorem are violated.

We can obtain fromFp(ω) always the samplesfkexactly but notf(t) if the sam- pling rate was too low.

Definition 3.3 (Discrete Time Fourier Transform)

The Discrete Time Fourier Transform (DTFT) of the sequence fk is defined by

Fp(ω) =

X

k=−∞

fke−jkω.

Its inverse is

fk = 1 2π

Z 0

Fp(ω)ejkω.

(34)

4 Discrete Fourier Transform

4.1 Band-limited Periodic Signals

Letf(t) be aT0-periodic signal with Fourier series f(t) =

X

k=−∞

zkejkω0t, ω0= 2π/T0.

Further, assumef(t) is band-limited with cutoff frequency ˆω. This means that only finitely many Fourier Coefficientszkare non-zero, which is shown as follows:

With the correspondence

ejkω0t c s 2πδ(ω0) we obtain the Fourier Transform F(ω) off(t):

F(ω) = 2π

X

k=−∞

zkδ(ω0). Asf(t) is band-limited,F(ω) = 0 forωωˆ and hence

zk= 0 if 0ωˆ i.e. if kωˆ ω0

.

The signal is sampled during one period atnequidistant places. The sampling rate is therefore

ωs = 0.

The conditions of the Sampling Theorem hold, i.e. we assume ωs>ω.

It follows that

n 2 > ωˆ

ω0

and therefore

zk = 0 if kn 2.

In the Fourier series only finitely many summands remain and it holds that

f(t) =

n/2−1

X

k=−n/2+1

zkejkω0t

=

n/2−1

X

k=−n/2+1

zkejkωst/n.

(35)

For the samples f`=f(`Ts) we have

f` =

n/2−1

X

k=−n/2+1

zkejk`ωsTs/n

=

n/2−1

X

k=−n/2+1

zke2πjk`/n.

Cosmetics. For rewriting this formula in vector notation, the sum f` =

n/2−1

X

k=−n/2+1

zke2πjk`/n has to be transformed into a sum

f` =

n−1

X

k=0

. . . .

For this puropse we define Fourier Coefficientszk fork=n/2, . . . , n−1, which do not appear in the original sum and which were zero so far as

zn/2 = 0

zk = zk−n, k=n/2 + 1, . . . , n−1,

see figure 4.1. This way we can rewrite the summands with negativek.

−1

X

k=−n/2+1

zke2πjk`/n =

n−1

X

k=n/2+1

zk−ne2πj(k−n)`/n

=

n−1

X

k=n/2+1

zke2πjk`/ne−2πjn`/n

=

n−1

X

k=n/2+1

zke2πjk`/ne−2πj`

| {z }

=1

=

n−1

X

k=n/2+1

zke2πjk`/n.

(36)

For the entire sum it holds that

f` =

n/2−1

X

k=−n/2+1

zke2πjk`/n

=

−1

X

k=−n/2+1

zke2πjk`/n+

n/2−1

X

k=0

zke2πjk`/n

=

n−1

X

k=n/2+1

zke2πjk`/n+

n/2−1

X

k=0

zke2πjk`/n

=

n−1

X

k=0

zke2πjk`/n.

2

1 3

−1

−2

−3

5 6 7

z1

z2

z3

z1

z2

z3

z1

z2

z3

z1

z2

z3

k k

2

1 3 4

Figure 4.1: Example for n = 8. The coefficients zk with k = −1,−2,−3 are shifted tok= 7,6,5.

Abbildung

Figure 2.1: Top: Band limited signal f ( t ) with cutoff frequency ˆ ω and Fourier Transform F ( ω )
Figure 3.1: Top: Band-limited signal f ( t ) with cutoff frequency ˆ ω and Fourier Transform F ( ω )
Figure 3.2: From top to bottom: Band limited signal f ( t ) and F ( ω ). Sampled signal f p ( t ) and F p ( ω )
Figure 3.3: Coefficients of the low pass filter x k of length n = 32 for ˆ ω c = 0 . 3 (top) und ˆω c = 0
+7

Referenzen

ÄHNLICHE DOKUMENTE

Lussardi: An approximation result for free discontinuity functionals by means of non-local

The amino acid sequence identity between the catalytic domains of LmjPDEB1 and LmjPDEB2 and the corresponding regions of the human PDEs 1 – 11 varies between 41.7% (to HsPDE3A) to

The substrate GTP is bound to the active site (A-site) located 5 AA upstream of the identified allosteric product inhibition site (I-site) (47). B) Homology model of the EAL domain

This approach gives us better running times for both the problem of finding optimal solutions and for testing feasibility only.. We complete our study by giving (almost)

Motivation Convolution Pyramids Application 1 - Gaussian Kernels Application 2 - Boundary Interpolation Application 3 - Gradient Integration Summary..

The proof of Theorems 1.9 and 1.10 follows standard lines: We split one of the divisor functions and use the Voronoi summation formula to deal with the divisor sums in

While we use the parsing problem as a running example in this paper, kernels over NLP structures could be used in many ways: for example, in PCA over discrete structures, or

In con- trast to the crystal structure, the structure in CDCl 3 solution, as previously determined in an elaborate NMR-spectroscopic study [9], shows a compactly folded conformation,