Periodogram Method of Power Spectral Estimation Richard Hayes Introduction to Non Parametric Power Spectrum Estimation Given a set of discrete-time data obtain an estimate of the Power Spectral Density of the original signal. amplitude 10 5 0 -5 0 100 200 300 time seconds 400 500 600 amplitude 5 0 Power Spectral Density (dB/Hz) -5 0 10 20 30 40 0 0.05 0.1 0.15 0.2 50 time seconds 60 70 80 90 100 0.35 0.4 0.45 0.5 30 20 10 0 -10 0.25 0.3 Frequency (Hz) Figure 1. Methods of Power Spectrum Estimation include Non Parametric and Parametric methods. Non parametric Estimates of Power Spectral Density. Estimate the spectrum directly from the data using either the Autocorrelation of the data or the periodogram of the data. Bartlett Welch Periodogram Method Blackman-Tukey Autocorrelation method We can examine a signal (either random or deterministic) either in the time domain using the auto-correlation function, or in the frequency domain using the Power Spectral density function of the signal. Page 1 of 7 Periodogram Method of Power Spectral Estimation Richard Hayes Stochastic Processes. For a finite set of data taken from a signal x(t), x(n), n=1,2,3,…., we can write the following expressions: E x ( n ) Mean: 1 N N 1 x ( n) n 0 Variance: V x ( n ) E x ( n ) 2 Autocovariance: c xx (m) E [ x(n) ] [ x(n m) ] Autocorrelation Function: rxx (m) E{x(n) x(n m)} rxx ( m) 2 N 1 x(n ) x(n m) Lt N 2 N 1 n N An estimate of the acf is obtained from N samples 1 N 1 rxx ( m) x ( n ) x ( n m) N n 0 A second version can be expressed as N m 1 1 rxx (m) x ( n) x ( n m) 1 N m 1 n 0 (Eq1) i Power Spectral Density is the (Discrete Time) Fourier Transform of the Autocorrelation function. Power Spectral Density; Pxx ( ) N 1 m n 0 rxx (m)e jm ; Pxx (k ) rxx (n)e j 2N nk (Eq2) This result is not immediately obvious. We will show it very simply below. This is the Wiener-Kintchine Theorem. Obviously the autocorrelation function is the inverse Fourier transform of the PSD. Autocorrelation Function: 1 rxx (m) 2 jm Pxx ( )e d ; rxx ( m) 1 N N 1 P xx ( k )e j 2N mk (Eq3) k 0 This presents one method of determining the PSD: Obtain the acf and take its FT. 1 See program for this form of the acf in footnote at end of document Page 2 of 7 Periodogram Method of Power Spectral Estimation Richard Hayes Relation between The Autocorrelation Function and Power Spectral Density. We can write N 1 rxx ( m) Lt x(n ) x(n m) N 2 N 1 n N N 1 rxx (0) Lt x 2 (n ) 2 N 2 N 1 n N The acf for zero shift gives the variance which is also the mean power of the signal. But we have from Wiener Kintchine rxx ( m ) 1 2 P xx ( )e jm d 1 1 rxx (0) Pxx ( )e j 0 d Pxx ( )d 2 2 2 This tell us that the integral over all frequencies of the function, Pxx(ω), adds up to the Mean Power of the signal then Pxx(ω) must be the power at each frequency. Periodogram The expression for the estimate of the Power Spectral Density obtained from Equation N 1 1 above, Pxx ( k ) rxx ( n )e j 2N nk , is called the periodogram. It is obtained directly by n 0 calculating the acf af the data and obtaining the fourier transform of the acf. Manipulation of Equations 1 and 2 above results in a second expression for the PSD: 2 1 N 1 Power Spectral Density: Pxx ( ) x(n)e jn N n 0 This gives us a second method of determining the PSD. Obtain the FT of the data and sqare it. Statistical Estimation. We make an ESTIMATE of the PSD based on a SAMPLE of data taken from a process. This sample is a time series. The assumption of an ergodic stationary stochastic process should be understood. Validity of the Estimate. This is a statistical analysis of the confidence in the result. How good is the estimate. How close is it to the TRUE spectrum. The estimate is based on one set of random or noisy data taken from the process. Other sets would provide different results. Thus the estimate itself is a random variable. The behaviour is investigated using the MEAN and VARIANCE of the estimate. Page 3 of 7 Periodogram Method of Power Spectral Estimation Richard Hayes Bias: It is desirable that the estimate of the PSD approach its true value as the number of data points approaches . i.e. PExx ( ) Pxx ( ) ; The estimate approaches the ttrue vale bias Pxx ( ) PExx ( ) If the mean of the estimate equals the true value of the estimate the the estimate is unbiased. Variance: It is desirable that the variance of the estimate approach zero as the number od data points used approaches . Statistical Properties of the Periodogram 1 Power Spectral Density: PExx ( ) N N 1 x ( n )e 2 jn n 0 The Periodogram is unbiased only for large numers of data. The periodogram is inconsistant ie successive realizations yield fluctuating estimates and the variance does not tend to zero as N increases. These two results are expressed more rigorously: Bias: ( ) E P( ) m N ( ) . sin 2fn Consistancy: V P( ) P ( ) 1 N sin 2f 2 Quality Factor: QP 2 2 E Pxx ( f ) xx ( f ) 2 Var Pxx ( f ) xx ( f ) 2 Page 4 of 7 1 Periodogram Method of Power Spectral Estimation Richard Hayes The Bartlett and Welch Methods. Improvements in the consistancy of the periodogram are obtained (at the expense of resolution in frequency discrimination) by averaging periodograms of either sequential or overlapped sections of the original data. This is illustrated below. Bartlett Method. No overlap, rectangular window on data sections. M data M data M data M data N data points K=N/M Sections Bias: E PxxB ( f ) xx ( f ), as N and M ∞. Therefore Unbiased asymptotically. Variance: sin( 2fM ) 2 1 1 2 V P ( f ) xx ( f ) 1 xx ( f ) 2 (where K N / M ) K K M sin( 2f ) B xx i.e. variance does not reduce to zero as N,M ∞. Quality Factor: QB E Pxx ( f )2 xx ( f ) 2 K 1 2 xx ( f ) K 1 xx ( f ) 2 K N QB K M The quality factor, QB is K , the number of sections. Page 5 of 7 Periodogram Method of Power Spectral Estimation Richard Hayes Welch Method. Sectioned data windowed with other than rectangular window, possibly overlapping data sections. M data M data M data M data L=N/(M-ol) Sections M data M data M data M data N data points Consistancy: Bartlett: V PW E ( f ) (9 / 8L) P 2 ( f ) where L N /( M ol ) . Welch: Welch is less than Bartlett by the factor 9/16 = 0.56. MATLAB Laboratory Example: Title. Periodogram method of Power Spectrum Estimation Investigate Non-Parametric Power Spectrum Estimation using methods based on the Periodogram. Objectives: 1. To generate suitable test signal. 2. To obtain an estimate of the spectrum of the signal based on the Periodogram. 3. To investigate the improvements of the estimate using the Bartlett and Welsh methods using different section lengths and different windows. 4. To investigate the frequency resolving characteristics of the periodogram methods. Tasks: a. Generate a 216 element test signal by passing white noise through a band-pass elliptic filter. Page 6 of 7 Periodogram Method of Power Spectral Estimation Richard Hayes % Design Filter Wp = [.2 .7], Ws = [.1 .8]; Rp=1,Rs=30; [N,Wn]=ellipord(Wp,Ws,Rp,Rs); [b,a]=ellip(N,Rp,Rs,Wn); [h,w]=freqz(b,a); plot(w/2/pi,20*log10(abs(h)),'r') % Generate Data n=randn(size(t)); y=filter(b,a,n); b. Calculate the Periodogram of the data by using the MATLAB function spectrum. c. Compare the obtained spectrum with the frequency response of the filter. d. Adjust the ‘settings’ of the spectrum function to implement the Bartlett and Welch methods for different section lengths. i Programming the autocorrelation function. A function m-file file directly implementing this equation is listed here function Rxy=myxcorr(x,y,nlags) N=length(x); for m=0:N-1 sum=0; for n=0:N-m-1 sum=sum+x(n+1)*y(n+1+m)/(N-m+1); end Rxy(m+1)=sum; end Page 7 of 7