Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 17 spectral analysis and power spectra. Part 1 What does a filter do to the spectrum of a time series?

Similar presentations


Presentation on theme: "Lecture 17 spectral analysis and power spectra. Part 1 What does a filter do to the spectrum of a time series?"— Presentation transcript:

1 Lecture 17 spectral analysis and power spectra

2 Part 1 What does a filter do to the spectrum of a time series?

3 Consider a filter f(t), such that y(t) = f(t) * x(t) In the frequency domain, convolution becomes multiplication y(  ) = f(  ) x(  ) and thus |y(  )| 2 = |f(  )| 2 |x(  | 2 frequency bands of x(  ) are amplified when |f(  )| 2 >1 frequency bands of x(  ) are attenuated when |f(  )| 2 <1

4 |x(  )| 2  |f(  )| 2 |y(  )| 2  

5 So how do we tell if a filter will amplify or attenuate a given range of frequencies?

6 Obviously, we could plot its spectrum … however, a more rigorous analysis of really simple filters offers some insight into what’s going on

7 Lets examine the DFT formula C k =  n=0 N-1 T n exp(-2  ikn/N ) with k=0, …N-1 or since  t=2  /N C k =  n=0 N-1 T n [exp(-ik  t )] n with k=0, …N-1 now let z = exp(-ik  t ) = exp(-i  t ) C k =  n=0 N-1 T n z n with k=0, …N-1 but that’s the z-transform of T So the discrete fourier transform C k of a timeseries T is its z- transform evaluated at z= exp(-ik  t ).

8 The discrete fourier transform C k of a timeseries T is its z- transform evaluated at z=exp(-ik  t )=exp(-2  ik  ) Note that |z| = 1, regardless of the value of k As you evaluate the coefficients, C k, k varies from 0 to (N-1), z varies from 0 to 2  along a circle in the complex plane real z imag z z

9 The discrete Fourier transform C k of a timeseries T is its z- transform evaluated at z=exp(-ik  t )=exp(-2  ik  ) As you evaluate the coefficients, C k, k varies from 0 to (N-1), z varies from 0 to 2  along a circle in the complex plane Hence the coefficients C k are going to be very sensitive to the locations of poles and zeros of T(z), especially when they are close to the unit circle real z imag z pole zero big C k here small C k here

10 Example f=[f 1, f 2 ] T =[1, -1.1] T f(z)=f 1 +f 2 z so has zero at z=-f 1 /f 2 f=[1, 1.1] T zero

11 n |f(  n )| 2 High Pass Filter n ny

12 Example f=[f 1, f 2 ] T = [1, 1.1] T zero

13 n |f(  n )| 2 Low Pass Filter n ny

14 Example f=[1, 1.1i] T *[1, -1.1i] T zeros

15 n |f(  n )| 2 n ny Suppress mid-range

16 Example: f=g inv with g=[1, 0.6*(1-1.1i)] T * [1, 0.6*(1+1.1i)] T poles

17 n |f(  n )| 2 n ny Narrow bandpass filter

18 Example f= [1, 0.9i] T * [1, -0.9i] T * inv([1, 0.8i] T ) * inv([1, -0.8i] T ) poles zeros

19 n |f(  n )| 2 n ny notch filter

20 upshot You can design really short filters that do simple but useful thing to the spectrum of a time series

21 Part 2 Computing spectra of indefinitely long timeseries

22 Suppose you cut a section out of a long timeseries, x(t) t How similar is the spectrum of the section to the spectrum of the whole thing? section

23 Lingo – Stationary Time Series When the statistical properties of an indefinitely long time series don’t change with time, the time series is said to be … … stationary

24 Power spectrum The standard FT formula C(  ) =  -  +  T(t) exp(-i  t) dt is not well defined when T(t) wiggles on forever, since T(t) has infinite energy. We need to adapt it.

25 Power spectrum C(  ) =  -T/2 +T/2 T(t) exp(-i  t) dt S(  ) = lim T  T -1 |C(  )| 2 S(  ) is called the power spectral density, the spectrum normalized by the length of the time series. Whenever I say ‘spectrum’ in the context of an indefinitely long stationary time series, I really mean ‘power spectral density’

26 Relationship of power spectral density to DFT To compute the Fourier transform, C(  ), you multiply the DFT coefficients, C k, by  t. So to get power spectal density T -1 |C(  )| 2 = (N  t) -1 |  t C k | 2 = (  t/N) |C k | 2 You multiply the DFT spectrum, |C k | 2, by  t/N.

27 Back to the question t You use convolution theorem to analyze the problem (but written ‘backward’) section

28 The transform of the convolution of two timeseries is the product of their transforms Convolution theorem The product of two timeseries Is the convolution of their two Fourier transforms Last week’s waytoday’s way Swapping the roles of time and frequency are allowed because the Fourier Transform is symmetrical in time and frequency

29 t boxcar t t windowed time series  timeseries =

30 So what’s the Fourier Transform of a boxcar of length, T?  -T/2 +T/2 1 exp(-i  t) dt =  -T/2 +T/2 { cos(  t) – i sin(  t) } dt = 2  0 T/2 cos(  t) dt = (2/  ) sin(  t)| 0 T/2 = T sin(  / (  /2) = T sinc(  T/2 )

31 recap Fourier transform of long timeseries convolved with a sinc function is Fourier transform of windowed timeseries

32 T sinc( wT/2 ) T sinc(  T/2)  small T big T

33 As window length T increases Central lobe gets narrower good Side lobes gets narrower good and closer to origin Side lobes get no smaller bad and never go away

34 Example: sinusoidal timeseries long time series boxcar windowed times series time, t

35  Spectrum of long time series Spectrum of window Spectrum of windowed time series Yuck!

36 What to do ? Choose a windowing function that has more desirable properties than a boxcar … Need … finite length in time narrow central lobe in frequency no (or smallish) frequency side lobes

37 Example: truncated Gaussian ±2  long time series truncated gaussian windowed times series time, t

38  Spectrum of long time series Spectrum of window Spectrum of windowed time series peaks a bit wider than with sinc

39 Example: Hamming Taper 0.54 - 0.46 cos{2  n/(N-1)} long time series Hamming taper windowed times series time, t

40  Spectrum of long time series Spectrum of window Spectrum of windowed time series

41 upshot 1. You can’t win. Ringing trades off with width of the central peak. But you can choose how you lose. 2. The spectrum of the windows time series is a ‘smoothed’ version of the true spectrum. The smoothing is being done by the convolution. Thus the error estimates for the windowed spectrum are different from (and generally better than) the error estimates for an unwindowed spectrum


Download ppt "Lecture 17 spectral analysis and power spectra. Part 1 What does a filter do to the spectrum of a time series?"

Similar presentations


Ads by Google