Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier...

70
Chapter 7 - DSP Based Testing

Transcript of Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier...

Page 1: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Chapter 7 - DSP Based Testing

Page 2: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Outline

Trigonometric Fourier Series (FS) Discrete-Time Fourier Series (DTFS)

– Relationship to FS– Working directly with samples– Complex form

Discrete Fourier Transform (DFT) Fast Fourier Transform (FFT)

– Applications

Equivalence of Time and Frequency Domains Frequency Domain Filtering Summary

Page 3: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Advantages of DSP Based Testing– Reduced Test Time

DSP in this class will be limited to discrete (i.e. sampled) waveforms of finite length.

Advantages of coherent DSP based testing– reduced test time since we can create signals with multiple

frequencies at the same time.– Once the output response of the DUT has been captured

using a digitizer or capture memory, DSP allows the separation of test tones to give individual gain and phase measurements.

– Also, by removing the input test tones, we can measure noise and distortion without running many separate tests.

Page 4: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Advantages of DSP Based Testing– Separation of Signal Components

By using coherent test tones, we are guaranteed that the harmonic distortion components will fall neatly into separate Fourier spectral bins rather than being smeared across many bins.

DSP based testing also has the major advantage in the elimination of errors and poor repeatability.

– Advanced Signal Manipulations DSP allows us to manipulate digitized output

waveforms to achieve a variety of results– We can apply mathematical filters to remove noise

thereby achieving better accuracy.

Page 5: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Digital Signal Processing– DSP and Array Processing

There is a slight difference between array processing and Digital Signal Processing.

– An array (or vector) is a series of numbers (i.e. height of students in class)

– A Digital Signal is also a series of numbers (i.e. voltages), yet the series is time stamped

– Thus digital signal processing is a subset of array processing using time-ordered samples.

All DSP is accomplished on a special computer called the array processor (so much for the difference)

Page 6: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Digital Signal Processing– DSP and Array Processing - cont.

Array processing functions that are useful in mixed-signal testing:

– averaging• To measure the RMS of a signal we must first remove

the DC offset - this is accomplished by averaging the signal and subtracting the result from the original

• Many functions like averaging are built into the ATE tester code set to allow easy use.

• Built in functions are set up to maximally utilize the available computational resources to reduce test time.

Page 7: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Digital Signal Processing– DSP and Array Processing - cont.

– Other built in functions include:• vector average - average value of an array• vector RMS - root mean square of the array values• max/min - maximum and minimum values in an array• vector add - add two arrays• add scalar to vector - add constant to each array value• subtract scalar from vector - subtract constant from each array value• vector multiply - multiply two arrays• multiply vector by scalar - multiply each array element by a constant• divide vector by scalar - divide each array element by a constant

Page 8: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete Fourier Analysis– Fourier Transform

Jean Baptiste Joseph Fourier– French mathematician that found that any periodic waveform

can be described as the sum of a series of sine and cosine waves at various frequencies plus a DC offset.

– Developed for the study of heat transfer in solid bodies– A sequence is assumed to be periodic with a period T such that

x(t) = x(t-T) for all values of t from minus infinity to plus infinity.

• x(t) = a0+a1*cos(w0t)+b1*sin(w0t)+a2*cos(2 w0t)… … + to infinity

Page 9: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete Fourier Analysis– Discrete Fourier Transform

Mathematical operation that allows us to split a composite signal into its individual frequency components.

– A DFT operation is equivalent to a series of very narrow band pass filters followed by peak-responding voltmeters. The filters are not only frequency selective but also phase selective to determine the sine and cosine contributions individually.

– x(n) = a0+a1*cos(2n/N)+b1*sin(2n/N)+a2*cos(2n/N)… … +a(N/2)*cos(2(N/2)n/N) + b(N/2)*sin (2(N/2)n/N)

)*1**2cos(*)(2

1N

tpitf

Na

t

Page 10: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

The DFT corresponds to a bank of filters and meters

Page 11: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete Fourier Analysis– Discrete Fourier Transform - cont.

Digitizing spectrum analyzers and mixed-signal testers accomplish the filter and peak measurements using the DFT. The DFT uses a frequency sensitive correlation calculation for each value of a and b.

– Functions that have zero correlation are called orthogonal– Superposition and orthogonality of coherent sine and

cosine components allows us to extract the value of all a’s and b’s, even in the presence of other coherent test tones. The cosine correlation function is equivalent to a filter and peak measurement. Therefore we can measure many signals simultaneously, reducing test time.

Page 12: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Frequency and Phase Selectivity of DFT Correlations

Page 13: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.
Page 14: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete Fourier Analysis– Complex form of the DFT

Most traditional DSP books use the Euler’s transform to convert sinusoids into exponentials.

– e-j t = cos(t) – j*sin(t)

0

1

/2)(1

)()(k

N

Npiknjkk enx

NbjakX

Page 15: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete Fourier Analysis– Complex form of the DFT

Notice that the complex form of the DFT correlates with a negative sine wave instead of a positive sine wave in the sine/cosine version.

– This causes problems in the phase shift calculations!!!– Some testers will give the straight imaginary value, while

others multiple by minus one to compensate for the difference. – The test engineer will need to find out whether the tester is

reporting sine amplitudes or imaginary components before phase measurements can be made!!!

Page 16: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Fourier Analysis Of Periodic SignalsTrigonometric Form

For any periodic signal with a finite number of discontinuities, the signal can be represented by a Fourier Series:

x(t) a0 ak cos k 2fo t bk sin k 2fo t k 1

x(t) x t T

T

DC f 2 f 3 f k f

Page 17: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Computing Fourier Coefficients

Coefficients are found from the following integral equations:

a0 1T

x(t)dt0

T

ak 2

Tx(t)cos k

2T

t

dt

0

T

bk 2

Tx(t)sin k

2T

t

dt

0

T

x(t) a0 ak cos k 2fo t bk sin k 2fo t k 1

Page 18: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Fourier Series RepresentationMagnitude & Phase Form

x(t) ck cos k2fo t k k0

ck ak2 bk

2

k tan 1 bk

ak

x(t) a0 ak cos k 2fo t bk sin k 2fo t k 1

Rectangular Form:

Magnitude&Phase Form:

where

Page 19: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Spectral Plot

x(t) ck cos k2fo t k k0

Time/Frequency

Amplitude (or RMS Value)

ffo 2fo 3fo 4fo 5fo

00

co

c1

c2 c3=

Phase

f

fo 2fo 3fo 4fo 5fo

0

0

1

2

3

Page 20: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Fourier Series ExampleClock Signal

5 V

0 V

10-4 s

t

x(t)

0

ak 2

10 4

0cos k104 2 t dt0

0.510 4

5cos k 104 2 t dt0.510 4

10 4

10

k2sin k 104 2 t

0.510 4

10 4

0

bk 2

10 4

0sin k 104 2 t dt0

0.5104

5sin k 104 2 t dt0.510 4

10 4

5

k cos k104 2 t

0.5104

104

5

k cos k cos k 2

5k

1 k 1

a0 1

10 40dt

0

0.510 4

5dt0.510 4

10 4

1

10 4 510 4 0.510 4 2.5

Page 21: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Fourier Series ExampleClock Signal

5 V

0 V

10-4 s

t

x(t)

0

bk 0; k even

10

k ; k odd

x(t) 2.5 10kk1,k odd

sin k 2 104 t

2.5 10

kk1,k odd

cos k 2 104 t 2

ak 0 for all k

Page 22: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Spectrum of Clock Signal Example

5 V

0 V

10-4 s

t

x(t)

0ck

0 10 20 30 40 50 60

-

1010

2.5

10

0 10 20 30 40 50 60

k

f (kHz)f (kHz)

Page 23: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Actual Vs. FS Representation

Increasing the number of terms in the FS increases the accuracy of the representation. Gibbs phenomenon (overshoot at discontinuity) is a result of the finite sum of terms.

0 0.5 1x 10

-4

-1

0

1

2

3

4

5

6

time, (sec)x(t

)

50 Terms

0 0.5 1x 10

-4

-1

0

1

2

3

4

5

6

time, (sec)

x(t

)10 Terms

Page 24: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Outline

Trigonometric Fourier Series (FS) Discrete-Time Fourier Series (DTFS)

– Relationship to FS– Working directly with samples– Complex form

Discrete Fourier Transform (DFT) Fast Fourier Transform (FFT)

– Applications

Equivalence of Time and Frequency Domains Frequency Domain Filtering Summary

Page 25: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier SeriesFirst Principles

Consider sampling x(t):

x(t) tnTSa0 ak cos k2fo nTS bk sin k 2fo nTS

k1

x(t) tnTsa0 ak cos k

2fo

Fs

n

bk sin k

2fo

Fs

n

k1

TS

But, FS=1/TS, allowing us to write

Page 26: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier SeriesCoherent Sampling

• Generally, we are interested in only those sample sets that are derived from a signal that satisfies T=NTS or fo=FS/N:

x(t) tnTsa0 ak cos k

2fo

Fs

n

bk sin k

2fo

Fs

n

k1

x[n]a0 ak cos k2N

n

bk sin k

2N

n

k1

TS

T

Page 27: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier SeriesPeriodic Sample Sets

• The fact that we are using coherent sample sets, implies periodicity in n. However, due to the symmetry of the formulation, x[n] is also periodic with respect to k with period N:

x[n]a0 ak cos k2N

n

bk sin k

2N

n

k1

TS

T

x[n]x[n N]

Page 28: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier SeriesRe-Grouping Formulation

x n a0mN akmN cos k2N

n

bk mN sin k

2N

n

k1

N 1

m0

x[n] a0mNm0

akmN cos k2N

n

bk mN sin k

2N

n

k1

N2 1

m0

aN kmN cos N k 2N

n

bN kmN sin N k 2

N

n

k 1

N2 1

m0

aN2 mN

cos N2 2

N

n

bN

2mNsin N

2 2N

n

m0

cos N k 2N

n

cos k

2N

n

;

sin N k 2N

n

sin k

2N

n

;

sin N2 2

N

n

0

To simplify further, use trig. substitutions:

Split into 2 parts:

Page 29: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier SeriesRe-Grouping Formulation

x n a0mNm0

ak mN aN kmN cos k2N

n

k1

N2 1

m0

bkmN bN kmN sin k2N

n

aN

2mNcos N

2 2N

n

m0

x n a0mNm0

akmN aN kmN m0

cos k

2N

n

k 1

N2 1

bk mN bN k mN m0

sin k

2N

n

aN

2 mNm0

cos N

2 2N

n

˜ a 0 a0 mNm0

˜ a k akmN aN kmN m0

˜ b k bkmN bN kmN m0

˜ a N2 aN

2mNm0

x n ˜ a 0 ˜ a k cos k2N

n

˜ b k sin k

2N

n

k1

N2 1

˜ a N2

cos n

Replace infinite summations with single

parameter:

DTFS:

Page 30: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier SeriesMagnitude & Phase Notation

x n ˜ a 0 ˜ a k cos k2N

n

˜ b k sin k

2N

n

k1

N2 1

˜ a N2cos n

Magnitude&Phase Form:

where

Rectangular Form:

x n ˜ c k cos k2N

n

˜ k

k0

N2

˜ c k ˜ a k2 ˜ b k

2

˜ k tan 1˜ b k˜ a k

Used for spectral plot purposes

Page 31: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

DTFS ExampleClock Signal

5 V

0 V

10-4 s

t

x(t)

0

10-5 s

Evaluate Infinite Summations:

˜ a 0 a010mm0

a0 2.5

˜ a k ak10m a10 k10m m0

0 k 1,2,3,4

˜ a 5 a510mm0

0

˜ b k bk10m b10 k10m m0

0;

10

1

k 10m 1

10 k 10m

m0

k even

k odd

˜ b 1 3.07516; ˜ b 2 0; ˜ b 3 0.72528; ˜ b 4 0

After 100 terms:

Page 32: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

DTFS ExampleClock Signal

0 2 4 6 8 10-1

0

1

2

3

4

5

6

sample, n

x[n

]

samples

clock signal

DTFS interpolation

x[n]2.5 3.07516 sin 1

210

n

0.72528sin 3

210

n

2.5 3.07516cos 1210

n

2

0.72528cos 3

210

n

2

DTFS:

Page 33: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

0 2 4 6 8 10-1

0

1

2

3

4

5

6

sample, n

x[n

]

samples

clock signal

DTFS interpolation

FS Versus DTFSClock Signal Example

Unlike a FS that attempts to represent the periodic function over all time, a DTFS only attempts to represent the N periodic samples

– Hence, a much simpler mathematical expression.

Page 34: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Working Directly With DTFS

A DTFS has N unknown parameters corresponding to N degrees of freedom. A DTFS is a representation for a coherent sample set consisting of N

samples.

TS

T

x n ˜ a 0 ˜ a k cos k2N

n

˜ b k sin k

2N

n

k1

N2 1

˜ a N2

cos n

Strategy to solve for unknown parameters:

-Each sample must satisfy the DTFS for x[n]

Page 35: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Solving N Equations In N Unknowns

x 0 ˜ a 0 ˜ a k cos 0 ˜ b k sin 0 k1

N2 1

˜ a N2cos 0

˜ a 0 ˜ a 1 ˜ a N2 1

˜ a N2

x 1 ˜ a 0 ˜ a k cos k2N

˜ b k sin k

2N

k1

N2 1

˜ a N2

cos

˜ a 0 ˜ a 1 cos2N

˜ b 1 sin

2N

˜ a 2 cos 2

2N

˜ b 2 sin 2

2N

˜ a N2 1

cos N2 1 2

N

˜ b N

2 1sin N

2 1 2N

˜ a N

2cos

x N 1 ˜ a 0 ˜ a k cos N 1 k 2N

˜ b k sin N 1 k 2

N

k 1

N2 1

˜ a N2

cos N 1

˜ a 0 ˜ a 1 cos N 1 2N

˜ b 1 sin N 1 2

N

˜ a 2 cos 2 N 1 2

N

˜ b 2 sin 2 N 1 2N

˜ a N

2 1cos N

2 1 N 1 2N

˜ b N2 1

sin N2 1 N 1 2

N

˜ a N

2cos N 1

1st sample:(n=0)

2nd sample:(n=1)

Nth sample:(n=N-1)

Page 36: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Matrix Formulation & Solution

x[0]

x[1]

x[2]

x[N 1]

1 cos (1)(0)2N

sin (1)(0)2N

sin (N2 1)(0)

2N

cos (N2)(0)

2N

1 cos (1)(1)2N

sin (1)(1)2N

sin (N2 1)(1)

2N

cos (N2)(1)

2N

1 cos (1)(2)2N

sin (1)(2)2N

sin (N2 1)(2)

2N

cos (N2)(2)

2N

1 cos (1)(N 1)2N

sin (1)(N 1)

2N

sin (N

2 1)(N 1)2N

cos (N

2)(N 1)2N

a0

a1

b1

a2

b2

bN /2 1

aN / 2

X WC

C W 1X

Compact notation:

Unknown parameters:

Page 37: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Method of Orthogonal Basis

Even before Fourier’s development in the 1800’s , the famous mathematician, Euler had developed a closed-form solution for finding the unknown coefficients of the DTFS.

– involves projections onto a set of orthogonal basis functions (harmonically-related sinusoids).

– his efforts were dropped in the direction of Fourier analysis because of the conceptual difficulties that occurred with the step discontinuities in the signal.

The importance of this method is that it forms the basis of all modern methods related to Fourier Analysis, Wavelets, etc.

x n ˜ a 0 ˜ a k cos k2N

n

˜ b k sin k

2N

n

k1

N2 1

˜ a N2

cos n

Page 38: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Method of Orthogonal Basis

The above formulae are found by multiplying the DTFS by (i) cos[k(2/N)n] (ii) sin[k(2/N)n], then summing n from 0 to N-1.

x n ˜ a 0 ˜ a k cos k2N

n

˜ b k sin k

2N

n

k1

N2 1

˜ a N2cos n

˜ a k

1

Nx n cos k

2N

n

, k = 0, N

2 n0

N 1

2N

x n cos k2N

n

, k =1,2,, N

2 1n0

N 1

˜ b k

2

Nx n sin k

2N

n

n 0

N 1

, k = 1,2,, N2 1

DTFS Coefficients:

Page 39: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

DTFS ExampleClock Signal

x 2.5 0 0 0 0 2.5 5 5 5 5 5 V

0 V

10-4 s

t

x(t)

0

10-5 s

˜ a 0 1

102.5 0 0 0 0 2.5 5 5 5 5 2.5

˜ a 1 2

102.5cos (1)

210

(0)

2.5cos (1)210

(5)

5cos (1)

210

(6)

5cos (1)210

(7)

5cos (1)

210

(8)

5cos (1)

210

(9)

0

˜ b 1 210

2.5sin (1)210

(0)

2.5sin (1)210

(5)

5sin (1)

210

(6)

5sin (1)210

(7)

5sin (1)

210

(8)

5sin (1)

210

(9)

3.0777

ak coefficients

bk coefficients

˜ b 2 210

2.5sin (2)210

(0)

2.5sin (2)210

(5)

5sin (2)

210

(6)

5sin (2)210

(7)

5sin (2)

210

(8)

5sin (2)

210

(9)

0

˜ b 3 210

2.5sin (3)210

(0)

2.5sin (3)210

(5)

5sin (3)

210

(6)

5sin (3)210

(7)

5sin (3)

210

(8)

5sin (3)

210

(9)

.07265

10 samples

All other coefficients are zero.

Page 40: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Spectral PlotClock Signal Example

0

3.0777

0.072650.07265

2.5

ck

k (Bin)

0 1 2 3 4 5 6 7 8 9

Eqn. Error! No text of specified style in

3.0777

0 0 1 2 3 4 5

Eqn. Error! No text ofspecified style indocument.-0

k

k (Bin)6 7 8 9

Eqn. Error! Notext ofspecified stylein document.-0

Page 41: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Complete Frequency SpectrumHarmonics from k = 0, …, infinity

0 N 2N

Nck

k

3N

3N2NN

0

k (Bin)

k (Bin)

N

0

0

Page 42: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Frequency Denormalization

DTFS is expressed in normalized time and frequency.– To return to proper time scale:– To return to proper frequency scale:

0

3 .0 7 7 7

0 .0 7 2 6 50 .0 7 2 6 5

2 .5

c k

k ( B in )

0 1 2 3 4 5 6 7 8 9

3 .0 7 7 7

0

3 .0 7 7 7

0 .0 7 2 6 50 .0 7 2 6 5

2 .5

f ( H z )

3 .0 7 7 7c k

0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0 7 0 0 0 8 0 0 0 9 0 0 0

F s

N 1 0 0 0

n nTs

k kFs

N

FS = 100 kHzN =10

Page 43: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Complex Form of the DTFS Through the application of Euler’s identity, we can convert the

DTFS in trigonometric form to the complex form of the DTFS,

x n ˜ a 0 ˜ a k cos k2N

n

˜ b k sin k

2N

n

k1

N2 1

˜ a N2cos n

cos k2N

n

ej k

2N

n

e

j k2N

n

2

sin k2N

n

ej k

2N

n

e

j k2N

n

2 j

x n X(k )ejk

2N

n

k1

N 1

X(k)

˜ a 0 k = 0 ˜ a k j ˜ b k

2 k = 1,2,, N

2 1

˜ a N2 k = N

2

˜ a N k j ˜ b N k

2 k = N

2 1,, N 1

where

Page 44: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Complex Form of the DTFSSeveral Examples

x[n]0.251.0cos210

n

0.5sin

210

n

0.2cos3

210

n

0.2sin3

210

n

0.2cos5

210

n

Example 1:

x n 0.25 0.5 j0.25 ej

210

n

0.1 j0.1 ej3

210

n

0.2ej 5

210

n

0.1 j0.1 ej 7

210

n

0.5 j0.25 ej 9

210

n

Example 2:

x n 2 1 j1 ej

28

n

1 j1 ej 3

28

n

1 j1 ej 5

28

n

1 j1 ej 7

28

n

x[n]2 2.0 cos28

n

2.0sin

28

n

2.0 cos 3

28

n

2.0 sin 3

28

n

Page 45: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Outline

Trigonometric Fourier Series (FS) Discrete-Time Fourier Series (DTFS)

– Relationship to FS– Working directly with samples– Complex form

Discrete Fourier Transform (DFT) Fast Fourier Transform (FFT)

– Applications

Equivalence of Time and Frequency Domains Frequency Domain Filtering Summary

Page 46: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier Transform Fourier greatest invention was the Fourier Transform (FT).

– provides a frequency description (known as a Fourier transform) of an aperiodic signal (transient signal)

If y[n] exists for only finite time, then we can represent it by the following periodic function x[n] with period N (periodic extension of y[n]): 0

y[n]

n0N-1 0 N 2N

x[n]

n0

N

y[n]

Page 47: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier TransformAperiodic Signal Description

• Given some aperiodic signal y[n] that can be described in terms of a periodic signal x[n], then we can write

• As x[n] is a periodic function, we can write y[n] asy n

x[n] n = 0,1,,N -1

0 otherwise

y n X(k)ejk

2N

n

k 1

N 1

n = 0,1,, N - 1

0 otherwise

0 N 2N

x[n]

n0

N

y[n]

Page 48: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier TransformInvestigating Impact of N->

• As the period N is made larger, a better match is made between y[n] & x[n]. As N->, y[n]=x[n] for all finite values of n.

• Due to limiting argument, the infinite sum eqn. changes into an integral eqn:

y n limN

X(k)ejk

2N

n

k 1

N 1

1

2Y (e j )e( jn)

d

0 N 2N

x[n]

n0

N N

Y (e j ) y n e jn

n

add zeros

• The term Y(ej) is called the D.T. Fourier Transform of y[n], given by

Page 49: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Discrete-Time Fourier TransformExample Consider a set of samples from a unit-height rectangular pulse

signal, the F.T. would be computed as follows:

F.T.

Y (e j ) Y(e j )e j y n e jn

n

y n e jn

n0

4

e jn

n0

4

1 e j5

1 e j

n

y[n]

40

1

0

Note:Spectrum iscontinuous.

()

0

|Y()|

0 2/5

5

4/5-2/5-4/5

-2/5-4/5

2/5 4/5

-

Page 50: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Relationship Between DTFS & FT

• The spectral coefficients of an N-point DTFS are samples of the FT:

• Substituting the appropriate values for Y(ej) gives

X(k) =Y (e j )

N 2N

k

X(k) 1

Ny n e

jk2N

n

n0

N 1

|Y()|

0 2/5

5

4/5-2/5-4/5

2N

Page 51: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

X(k) 1

Ny n e

jk2N

n

n0

N 1

Discrete Fourier Transform (DFT)

The DTFS representation of the periodic extension of an aperiodic signal y[n] is referred to as a Discrete Fourier Transform (DFT) of y[n].

– In essence, we are working with a DTFS, just attaching different meaning to the underlying result.

– The coefficients {X(0), X(1), …, X(N-1)} are referred to as the DFT of y[n].

Page 52: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Outline

Trigonometric Fourier Series (FS) Discrete-Time Fourier Series (DTFS)

– Relationship to FS– Working directly with samples– Complex form

Discrete Fourier Transform (DFT) Fast Fourier Transform (FFT)

– Applications

Equivalence of Time and Frequency Domains Frequency Domain Filtering Summary

Page 53: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Fast Fourier Transform (FFT)– In the early 1960’s James Tukey invented a new

algorithm for calculating the DFT in a much more efficient manner.

– An IBM programmer J.W. Cooley generated the computer code for Tukey’s algorithm and the Cooley-Tukey Fast Fourier Transform was created. Uses a folding principle called a butterfly to reduce the

number of calculations required. Decimation in frequency or Decimation in Time

Page 54: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Fast Fourier Transform

The Fast Fourier Transform, or FFT, is a highly efficient procedure for computing the DFT/DTFS.

For N samples, the FFT requires Nlog2N complex additions and (N/2)log2N complex multiplication, whereas the DFT requires N(N-1) complex addition and N2 complex multiplications.

– With N=512, the FFT has a 50 to 1 advantage over the DFT.

N is selected as a power-of-two (i.e., 2n), but other algorithms exist that can work other factors.

Y (k) | Y (k) | e j(k ) y(n)e jk(2N)n

n0

N 1

Page 55: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Interpreting the FFT Output

Most software packages, including Matlab, implements the following FFT algorithm:

To determine the spectral coefficients of the corresponding DTFS, we must perform the scaling operation on the samples of the Fourier Transform:

Y (k) y(n)e jk (2N)n

n0

N 1

X(k) Y(k)

N

Page 56: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Interpreting the FFT Output DTFS in complex form:

To convert DTFS back into rectangular form, we use:

x n ˜ a 0 ˜ a k cos k2N

n

˜ b k sin k

2N

n

k1

N2 1

˜ a N2cos n

x n X(k )ejk

2N

n

k1

N 1

X(k) Y(k)

N

where˜ a k

Re X(k) k = 0,N 22 Re X(k) k =1,2,, N

2 1

˜ b k 0 k = 0, N

2 2Im X(k) k = 1,2,,N 2 1

and

Page 57: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Interpreting the FFT Output

To convert DTFS into magnitude and phase form, we use:

For RMS Value:

where

x n ˜ c k cos k2N

n

˜ k

k0

N2

˜ c k

X(k) k 0,N 2

2 X(k) k 1,,N 2 1

˜ k tan 1 Im X(k) Re X(k)

˜ c k rms ˜ c k2

Page 58: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Interpreting the FFT OutputExample

Y FFT x

0

0

0 j 4.0000

0.5657 j0.5657

0

0.5657 j0.5657

0 j 4.0000

0

X Y

8

0

0

0 j 0.5000

0.0707 j0.0707

0

0.0707 j0.0707

0 j0.5000

0

˜ a 0˜ a 1˜ a 2˜ a 3˜ a 4

0

0

0

0.1414

0

and

˜ b 0˜ b 1˜ b 2˜ b 3˜ b 4

0

0

1.0

0.1414

0

x = 0.1414, 1.0, - 0.1414, - 0.8, - 0.1414, 1.0, 0.1414, -1.2 Time-Domain:

Frequency-Domain:

Spectral Coefficients:˜ c 0 rms

˜ c 1 rms

˜ c 2 rms

˜ c 3 rms

˜ c 4 rms

0

0

0.7071

0.1414

0

and

˜ 0˜ 1˜ 2˜ 3˜ 4

0

0

2

40

or

Page 59: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Spectrum(dB)

BIN

Noise Power Calculation

Include only the noise power; ignore the power contained in the signal bin and its harmonics (say, contained in S bins):

Pn 1

2

N

N S

ck

2

k1ksignalharmonics

N / 2

Correction factor

signal

harmonics

noise floor

0 50 100 150-100-90-80-70-60-50-40-30-20-10

0

Page 60: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Spectral Behavior of a Coherent versus Non-Coherent Sinusoidal Signal

0 20 40 60-1

-0.5

0

0.5

1

sample, n

x(n

)

0 20 40 60-400

-300

-200

-100

0

Bin

Sp

ect

rum

of

x(n

) in

dB

0 20 40 60-1

-0.5

0

0.5

1

sample, n

z(n)

0 20 40 60-50

-40

-30

-20

-10

0

Bin

Spe

ctru

m o

f z(n

) in

dB

dB 20 log10 ck Coherent case(M=3, =0, N=64)

Incoherent case(M=, =0, N=64)

Spectral leakage

Logarithmic Scale

f FS

N

Freq. Resolution

FS/2

FS/2

Page 61: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Outline

Trigonometric Fourier Series (FS) Discrete-Time Fourier Series (DTFS)

– Relationship to FS– Working directly with samples– Complex form

Discrete Fourier Transform (DFT) Fast Fourier Transform (FFT)

– Applications

Equivalence of Time and Frequency Domains Frequency Domain Filtering Summary

Page 62: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Equivalence of Time and Frequency Domain Information

X WC

C W 1X

X W W 1X WW 1X X

The samples of a periodic signal can be described in matrix form as:

From which the spectral coefficients are found from:

Conversely, given the spectral coefficients, the original samples can be

determined through an inverse operation given by

This inverse operation can be computed using an inverse FFT.

Page 63: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Inverse FFT ApplicationExample

˜ c 0˜ c 1˜ c 2˜ c 3˜ c 4

1

0

2

0.5

0

and

˜ 0˜ 1˜ 2˜ 3˜ 4

0

0

40

0

X

1

0

0.7071 j0.7071

0.25

0

0.25

0.7071 j0.7071

0

Y 8X

8

0

5.6568 j5.6568

2

0

2

5.6568 j5.6568

0

x IFFT Y

2.9142

0.7678

0.4142

2.7678

1.9141

0.0606

0.4142

2.0606

Time-Domain Samples:

Fourier Transform Samples (N=8):

Spectral Coefficients:

Page 64: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Parseval’s Theorem

Parseval’s theorem states the power of the signal in either the time or frequency domain is a constant.

– In the time-domain, both signal and noise occur at the same time, whereas in the frequency-domain, most of the noise occurs at frequency locations not occupied by signal.

1

Nx 2[n]

n0

N 1

c02

1

2ck

2

k1

N2

1

Nx 2[n]

n0

N 1

X(k)2

k0

N 1

Trigonometric Form for DTFS Complex Form for DTFS

Page 65: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Applications of Inverse FFTImproving Time Resolution of Rise/Fall Time

Knowledge of the spectral distribution of a signal can be exploited to improve the SNR of the overall measurement.

Here the clock signal is known to consists of only odd harmonics, hence, by setting all even Bins to zero, improves SNR measurement by 3 dB.

0 200 4000

0.5

1

sample, n

data

0 20 40-100

-50

0

Bin

Spe

ctru

m o

f dat

a in

dB

0 20 40-100

-50

0

BinSpe

ctru

m o

f filt

er d

ata

in d

B

0 200 4000

0.5

1

sample, n

filte

r da

ta

Noisy signal

Improved Signal(1/2 Noise)

Page 66: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Applications of Inverse FFTTime-Domain Interpolation

Zero-padding with Nz zeros a frequency spectrum consisting of N samples, followed by an IFFT, improves the time resolution by the factor (N+NZ)/N.

0 20 40 60-1

-0.5

0

0.5

1

sample, n

x(n

)

0 20 40 60-400

-300

-200

-100

0

Bin

Sp

ect

rum

of

x(n

) in

dB

0 100 200-400

-300

-200

-100

0

BinMo

difi

ed

Sp

ect

rum

in d

B

0 100 200-1

-0.5

0

0.5

1

sample, n

Inte

rpo

late

d D

ata

Add NZ zeros

Freq. Res=FS/N

Freq. Res=FS/(N+NZ)

N Samples

N+NZ Samples

Page 67: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Outline

Trigonometric Fourier Series (FS) Discrete-Time Fourier Series (DTFS)

– Relationship to FS– Working directly with samples– Complex form

Discrete Fourier Transform (DFT) Fast Fourier Transform (FFT)

– Applications

Equivalence of Time and Frequency Domains Frequency Domain Filtering Summary

Page 68: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Applications of Inverse FFTFrequency-Domain Filtering

0 200 4000

0.5

1

sample, n

data

0 20 40-100

-50

0

Bin

Spe

ctru

m o

f dat

a in

dB

0 20 40-100

-50

0

BinSpe

ctru

m o

f filt

er d

ata

in d

B

0 200 4000

0.5

1

sample, n

filte

r da

ta|H(ej)|

Xout k H k X in k

H(k ) H(k)e j ̃k H

X in(k)1

2˜ c k ine

j ̃k in

Xout(k) 1

2˜ c k oute

j ̃k out

˜ c k out H k ˜ c k in

k out k in k H

x(n) |c(k)|

xfilter(n)|c(k)||H(ej)|

Page 69: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Noise A-Weighting Filtering

Audio measurements often call for noise measurement to be weighted in a manner that more closely approximates the frequency behavior of the ear.

– only the magnitude of the spectrum is of interest. ˜ c k out H k ˜ c k in

Page 70: Chapter 7 - DSP Based Testing. Outline n Trigonometric Fourier Series (FS) n Discrete-Time Fourier Series (DTFS) – Relationship to FS – Working directly.

Summary

Coherent DSP-based testing allows AC measurements to be performed in near-optimum test time.

DSP techniques involving FS, DTFS, DFT and FFTs were described.– DSP-based test techniques enable test techniques not

available with bench-top equipment, i.e., Frequency-domain filtering Time-domain interpolation Noise-reduction