+ All Categories
Home > Documents > Lecture 16 Basic properties of Fourier Transforms.

Lecture 16 Basic properties of Fourier Transforms.

Date post: 21-Dec-2015
Category:
View: 223 times
Download: 4 times
Share this document with a friend
Popular Tags:
47
Lecture 16 Basic properties of Fourier Transforms
Transcript
Page 1: Lecture 16 Basic properties of Fourier Transforms.

Lecture 16

Basic properties of Fourier Transforms

Page 2: Lecture 16 Basic properties of Fourier Transforms.

MatLab Code% setupN=256;dt=1.0;tmax=dt*(N-1); t=dt*[0:N-1]; fmax=1/(2.0*dt);df=fmax/(N/2);f=df*[0:N/2,-N/2+1:-1]'; dw=2*pi*df;w=dw*[0:N/2,-N/2+1:-1]';

% a sample function, p(t)w0 = 2*pi*fmax/10;p = sin(w0*t).*exp(-0.25*w0*t);

pt=fft(p); % fourier transformpr=ifft(pt); % inverse transform

Page 3: Lecture 16 Basic properties of Fourier Transforms.

p(t)

t

t

ifft(fft(p))

Page 4: Lecture 16 Basic properties of Fourier Transforms.

1: Relationship to integral transforms

Integral transforms:

C() = -+

T(t) exp(-it) dt

T(t) = (1/2) -+

C() exp(it) d

Discrete transforms

Ck = n=-N/2N/2 Tn exp(-2ikn/N ) with k=-½N, …, ½N

Tn = N-1k=-N/2N/2 Ck exp(+2ikn/N ) with n=-½N, …, ½N

(this agrees with definition in MatLab HELP)

Page 5: Lecture 16 Basic properties of Fourier Transforms.

kk and tn = nt and = 2/(Nt)

so t = 2/N

Ck = C(k) = -+

T(t) exp(-ikt) dt

t n=-N/2N/2 T(tn) exp(-iktn)

= t n=-N/2N/2 Tn exp(-i k nt)

= t n=-N/2N/2 Tn exp(-2i kn )

So forward integral transform is t times discrete forward transform

Page 6: Lecture 16 Basic properties of Fourier Transforms.

kk and tn = nt and = 2/(Nt)

so t=2/N and = 1/(Nt)

T(tn) = (1/2) -+

C() exp(itn) d

(/2) k=-N/2N/2 C(k) exp(iktn)

= (1/t) N-1 k=-N/2N/2 Ck exp(i k nt)

= (1/t) N-1 k=-N/2N/2 Ck exp(2i kn )

So inverse integral transform is 1/t times inverse discrete transform

Page 7: Lecture 16 Basic properties of Fourier Transforms.

So …

Except for a normalization factor of t,

The discrete transform is just the “Riemann Sum” approximation to the integral transform, with particular choice t=2/N

Properties of the integral transform carry over to the discrete transform (well, more-or-less)

Page 8: Lecture 16 Basic properties of Fourier Transforms.

Error Estimates for the DFTAssume uncorrelated, normally-distributed data, dn=Tn, with

variance d2

The matrix G in Gm=d is Gnk=N-1 exp(+2ikn/N )

The problem Gm=d is linear, so the unknowns, mk=Ck, (the coefficients of the complex exponentials) are also normally-distributed.

Since exponentials are orthogonal, GHG=N-1I is diagonaland Cm= d

2 [GHG]-1 = N-1d2I is diagonal, too

Apportioning variance equally between real and imaginary parts of Cm, each has variance 2= N-1d

2/2.The spectrum sm

2= Crm

2+ Cim

2 is the sum of two uncorrelated, normally distributed random variables and is thus

2-distributed.

The 95% value of 2 is about 5.9, so that to be significant, a

peak must exceed 5.9N-1d2/2

Page 9: Lecture 16 Basic properties of Fourier Transforms.

examplef(t) = exp(-a2t2)

f() = -+ exp(-a2t2) exp(-it) dt

= 2 0+ exp(-a2t2) cos(t) dt

= exp( -2/4a2 ) / a

See integral 679 of CRC Math Tables

Note, by the way, that the Fourier transform of a Gaussian is a Gaussian …Furthermore, the wider in t, the narrower in .

Page 10: Lecture 16 Basic properties of Fourier Transforms.

t fft( exp(-a2t2) ) with a=0.05

exp( -2/4a2 ) / a with a=0.05

Page 11: Lecture 16 Basic properties of Fourier Transforms.

C() is the area under T(t)

2: area under T(t)

0

T(t)

area

Page 12: Lecture 16 Basic properties of Fourier Transforms.

C() = -+

T(t) exp(-it) dt

C()

= -+

T(t) exp(0) dt

= -+

T(t) dt = area

Page 13: Lecture 16 Basic properties of Fourier Transforms.

area = dt sum(p) = 18.2245

t

t

area = t real(fft(p)) = 18.2245

Page 14: Lecture 16 Basic properties of Fourier Transforms.

Multiplying C() by

exp(-it0)

shifts the timeseries T(t) by t0.

3: Time shift

0t

T(t)

0 t0

T(t-t0)

Page 15: Lecture 16 Basic properties of Fourier Transforms.

C() = -+

T(t) exp(-it) dt

Transform(shifted) =

-+

T(t-t0) exp(-it) dt =

-+

T(t’) exp{-it’+t0)} dt’ =

exp(-it0) -+

T(t’) exp(-it’) dt’ =

exp(-it0) Transform(unshifted)

t’ = t-t0 so t=t’+t0

and dt’=dtand t’ as t

Page 16: Lecture 16 Basic properties of Fourier Transforms.

p(t)

ifft(exp(-it0)fft(p(t))) with t0=50

t

t

Page 17: Lecture 16 Basic properties of Fourier Transforms.

Multiplying C() by

i

Gives the transform of dT/dt

4: derivative

Page 18: Lecture 16 Basic properties of Fourier Transforms.

transform(dT/dt) =

-+

dT/dt exp(-it) dt

T exp(it |-+

+i -+

T exp(it dt

= -i transform(T)

Integration by parts

u dv = uv - v du

u= exp(it) dv=(dT/dt) dt

du = -i exp(-it) dt

v = dv = T

assuming T exp(it |-+

= 0

Page 19: Lecture 16 Basic properties of Fourier Transforms.

p(t)

dp/dt

ifft( i fft(p))

Page 20: Lecture 16 Basic properties of Fourier Transforms.

Dividing C() by

i

Gives the transform of T dt

but note that you must set the zero-frequency element manually, since 1/ is undefined at =0. Furthermore, this process is not very stable, since 1/can be very large for small ’s.

5: integral

Page 21: Lecture 16 Basic properties of Fourier Transforms.

p(t)

tcumsum(p)

ifft(fft(p)/(i))a bit of drift, presumably

due to round off error

t

t

t

Page 22: Lecture 16 Basic properties of Fourier Transforms.

The transform of

the convolution of two timeseries

is the product of their

transforms

6: convolution

Page 23: Lecture 16 Basic properties of Fourier Transforms.

transform( f(t)*g(t) ) =

-+

-+

f(t-) g() d exp(it) dt

-+

g() -+

f(t-) exp(it) dt d

-+

g() -+

f(t’) exp{it’+)} dt’ d

-+

g() exp(i) d -+

f(t’) exp(it’) dt’

transform(g(t)) transform(f(t))

t’=t-sot=t’+dt’ = dt

Page 24: Lecture 16 Basic properties of Fourier Transforms.

t

t

t

f(t)g(t)

conv(g,f)

ifft(fft(g)fft(f))

Page 25: Lecture 16 Basic properties of Fourier Transforms.

7: FFT of a spike at t=0 is a constant

C() = -+

(t) exp(-it) dt = exp(0) = 1

Page 26: Lecture 16 Basic properties of Fourier Transforms.

t

p(t) is a spike at t0=0

imag(fft(p))

real(fft(p))

Page 27: Lecture 16 Basic properties of Fourier Transforms.

7: FFT of a spike at t=t0 is sinusoidal

C() = -+

(t-t0) exp(-it) dt = exp(-it0)

= cos(t0) - i sin(t0)

Page 28: Lecture 16 Basic properties of Fourier Transforms.

t

p(t) is a spike at t0=5

imag(fft(p))=sin(t0)

real(fft(p))=cos(t0)

5

Page 29: Lecture 16 Basic properties of Fourier Transforms.

8: FFT of a sinusoid cos(1t) is a pair of spikes at w=±1

Note rule -+

exp(-it) exp(it) dt = (1-2)

cos(t) = ½ { exp(it) + exp(-it) }

-+

cos(t) exp(-it) dt =

½ -+

exp(it) exp(-it) dt + ½ -+

exp(it) exp(-it) dt

= ½{ (-1) + (+1) }

Page 30: Lecture 16 Basic properties of Fourier Transforms.

t

p(t)=cos(1t)

imag(fft(p))=0real(fft(p))

±1

Page 31: Lecture 16 Basic properties of Fourier Transforms.

Aliasing

the tendency in a digital world for high frequencies to look like low

frequencies

Page 32: Lecture 16 Basic properties of Fourier Transforms.

MatLab Script to evaluate cosines at ever increasing frequency

L = 0; % make plots in groups of 10 starting at frequency L+1for k = [1:10]w1= (L+k)*dw;p=cos(w1*t);

subplot(10,1,k);plot(t,p,'b');hold on;axis( [0, tmax, -1.5, 1.5] );

end

Page 33: Lecture 16 Basic properties of Fourier Transforms.

t

cos(kt)

k

k

Page 34: Lecture 16 Basic properties of Fourier Transforms.

t

cos(kt)

k

k

knyquist

same!

Page 35: Lecture 16 Basic properties of Fourier Transforms.

t

cos(kt)

k

kfrequencies seem to be getting lower!

Page 36: Lecture 16 Basic properties of Fourier Transforms.

t

cos(kt)

k

kbut now higher again!

Page 37: Lecture 16 Basic properties of Fourier Transforms.

in a digital world we have chosen t = 2/N

sin(ntk) = sin(knt) = sin(knt) = sin(2kn/N)cos(ntk) = cos(knt) = cos(knt) = cos(2kn/N)

let m=n+Nsin(mtk) = sin{k(n+N)wt} = sin{2k(n+N)}

= cos(2knsin(2k) sin(2kncos(2k)

cos(mtk) = cos{k(n+N)wt} = cos{2k(n+N)} = cos(2kncos(2k) sin(2knsin(2k)

but sin(2k)=0 and cos(2k)=1 for all integers k, so

sin(mtk)=sin(ntk) and cos(mtk)=cos(ntk)

Page 38: Lecture 16 Basic properties of Fourier Transforms.

in a digital world n+N = n

andsince time and frequency play symmetrical roles in exp(-it)

tk+N = tk

Page 39: Lecture 16 Basic properties of Fourier Transforms.

Example: cos(0t) with 0=ny/20 sampled with frequency 0=ny/32

Page 40: Lecture 16 Basic properties of Fourier Transforms.

Now connect the dots the resulting function has a lower frequency

Page 41: Lecture 16 Basic properties of Fourier Transforms.

n+N = n

let n=-m, then

-m = N-m

Page 42: Lecture 16 Basic properties of Fourier Transforms.

This is why the fourier coefficientsof ‘negative frequencies’

are placed at the ‘high frequency’ end of the transform vector

they “are” the high frequency coefficients

Page 43: Lecture 16 Basic properties of Fourier Transforms.

lets reconsider the example where we computed the Fourier Transform of

p(t) = exp(-a2t2)

this function is non-zero at negative times

0

p(t)

t

Page 44: Lecture 16 Basic properties of Fourier Transforms.

you must not just leave out the values of the function at negative times

you’d be leaving out half the information

instead, you must wrap them to large times using the rule

t-m = tN-m

Page 45: Lecture 16 Basic properties of Fourier Transforms.

so you must put the negative values at the right and end of the vector, p

N=256;dt=0.5;tmax=dt*(N/2); tmin=dt*(-N/2+1);t=dt*[0:N/2,-N/2+1:-1]'; % note put negative times on the end ...fmax=1/(2.0*dt);df=fmax/(N/2);f=df*[0:N/2,-N/2+1:-1]'; dw=2*pi*df;w=dw*[0:N/2,-N/2+1:-1]';

a=0.05;p = exp( -(a*t).^2 );

pt=fft(p);

0

p(t)

t

0

p(t)

t

Page 46: Lecture 16 Basic properties of Fourier Transforms.

Multiplying C() by exp(-it0) shifts the timeseries T(t) by t0.

What if we try to shift it by more than the length of the time-series?

It just wraps around …

Remember the Time shift ?

Page 47: Lecture 16 Basic properties of Fourier Transforms.

with N=256, trying to shift it 280t just shifts it 280-256=24

24


Recommended