1 / 23

Practical Signal Processing Concepts and Algorithms using MATLAB

Practical Signal Processing Concepts and Algorithms using MATLAB. Spectral Analysis of Signals. __________________________________________________________________________________________________________ QMS Management Consultants Sdn Bhd (401766-U)

solada
Télécharger la présentation

Practical Signal Processing Concepts and Algorithms using MATLAB

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Practical Signal Processing Concepts and Algorithms using MATLAB Spectral Analysis of Signals __________________________________________________________________________________________________________ QMS Management Consultants Sdn Bhd (401766-U) 98-1-31 Prima Tanjung  Jalan Fettes  Tanjung Tokong  11200 Pulau Pinang  Malaysia Telephone +604 899 6020  Facsimile +604 899 4020  E-mail admin@qms-mal.com 11203 FM 2222 #801  Austin  Texas 78730

  2. Section Outline • Signal statistics • Discrete Fourier transform • Power spectral density estimation • Time-varying spectra

  3. Statistical Signal Processing time time ensemble System time

  4. Example: Crosscorrelation y x >> [c,lags] = xcorr(x,y) >> stem(lags,c)

  5. Correlation and Covariance The functions xcorr and xcov estimate the cross-correlation and cross-covariance sequences of random processes. The cross-correlation sequence is a statistical quantity defined as where xn and yn are stationary random processes, , and E{·} is the expected value operator which measures the similarity between the two waveforms.The covariance sequence is the mean-removed cross-correlation sequence                           ,

  6. or, in terms of the cross-correlation, • Example on xcorr • >> y = x; • >> x = [1 1 1 1 1]'; • >> xyc = xcorr(x,y) • >> stem(xyc) • Example on xcov >>ww = randn(1000,1); % Generate uniform noise with %mean = 1/2. >> [cov_ww,lags] = xcov(ww,10,'coeff'); >> stem(lags,cov_ww)

  7. Discrete Fourier Transform (DFT) Discrete Fourier Transform: Complex nth roots of unity Signal y (top) and transform Y (bottom)

  8. Fast Fourier Transform (FFT) FFT y Pad / Chop Efficient DFT Y Buffer Y = fft(y,n) Window length length(y) FFT length n fast

  9. Fast Fourier Transform (FFT) • The discrete Fourier transform, or DFT, is the primary tool of digital signal processing. • The foundation of the Signal Processing Toolbox is the fast Fourier transform (FFT), a method for computing the DFT with reduced execution time. • Many of the toolbox functions (including z-domain frequency response, spectrum and cepstrum analysis, and some filter design and implementation functions) incorporate the FFT.

  10. Cont. t = (0:0.001:1); %0.001 is sampling x = sin(2*pi*50*t) + 2*sin(2*pi*120*t); y = fft(x); %Compute DFT of x m = abs(y); %magnitude f = (0:length(y)/2-1)*1000/length(y); %Frequency vector plot(f,m(1:1:(length(m)-1)/2)) %before filter grid [b,a] = butter(9,100/500,'high'); %design filter c=filter(b,a,x); %implement filter figure(2) y = fft(c); %Compute DFT of c(filtered x) m = abs(y); % Magnitude f = (0:length(y)/2-1)*1000/length(y); %Frequency vector plot(f,m(1:1:(length(m)-1)/2)) %after filter Grid

  11. Spectral Analysis with the FFT ySampled signal FsSamples/unit time n = length(y)Number of samples t = (0:n-1)/Fs Principal range dt = 1/FsTime increment Y = fft(y)DFT of sampled signal abs(Y)Amplitude of DFT abs(Y).^2/length(Y)Power of DFT f = (0:n-1)*(Fs/n)Frequency (cycles/unit time) (n/2)*(Fs/n) = Fs/2Nyquist frequency p = 1./fPeriod (unit time/cycle)

  12. FFT Example >> Fs = 100; >> t = 0:1/Fs:10-1/Fs; >> y = sin(2*pi*15*t) + sin(2*pi*30*t); >> Y = fft(y,512); >> f = (0:length(Y)-1)*(Fs-1)/length(Y); >> Power = Y.*conj(Y)/length(Y); >> plot(f,Power) >> title('Periodogram') Symmetric about Fs/2 = 50 Use fftshift to center at 0

  13. FFT Demos >> sigdemo1 >> playshow fftdemo >> phone >> playshow sunspots

  14. Aliasing Revisited Original signal Spectral copy 5 Hz sine wave sampled at 15 Hz 5 Hz sine wave sampled at 7.5 Hz +Fs +Fs -Fs -Fs Principal range Principal range No overlap/aliasing Overlap/aliasing

  15. Power Spectral Density (PSD) Ryy( f ) Total signal power of analog signal y = Ryy( f ) is the DFT of the autocorrelation functionryy(t) Estimate PSD from a finite sample Nonparametric Parametric Subspace Welch pwelch Multitaper pmtm Burg pburg Yule-Walker pyulear EV peig MUSIC pmusic

  16. Periodogram >> [Pxx,w] = periodogram(x) Welch >> [Pxx,w] = pwelch(x) Multitaper >> [Pxx,w] = pmtm(x,nw) Nonparametric Methods

  17. Parametric Methods • Yule-Walker AR Method • >> [Pxx,f] = pyulear(x,p,nfft,fs) • Burg Method • >> [Pxx,f] = pburg(x,p,nfft,fs) • Covariance and Modified Covariance Methods • >> [Pxx,f] = pcov(x,p,nfft,fs) • >> [Pxx,f] = pmcov(x,p,nfft,fs) Order of AR model

  18. Parametric Methods (Continued)

  19. Subspace Methods • Eigenvector Method • >> [S,f] = peig(x,p,nfft,fs) • Multiple Signal Classification (MUSIC) Method • >> [S,f] = pmusic(x,p,nfft,fs)

  20. Spectrum Viewer in SPTool 1. Select signal in Signal Viewer in SPTool. 2. Select Create Spectra Spectrum Viewer. Analysis method Display window

  21. Time-Varying Spectra >> [B,f,t] = specgram(x,nfft,fs,window,numoverlap)

  22. Spectrogram Demos >> specgramdemo >> xpsound

  23. Example: Reduced Sampling Rate >> HAL9000

More Related