1 / 50

Correlation and Spectral Analysis

Correlation and Spectral Analysis. Application 4. Review of covariance. Autocorrelation (Autocovariance). Noise Power. Zero-Mean Gaussian Noise. Power Spectrum. E{P n ( k )} = s 2 = 1.12 = R n (0). Auto-correlation. R n (0) = s 2 = 1.12. >> for j = 1:256,

xia
Télécharger la présentation

Correlation and Spectral Analysis

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. Correlation and Spectral Analysis Application 4

  2. Review of covariance

  3. Autocorrelation (Autocovariance)

  4. Noise Power

  5. Zero-Mean Gaussian Noise

  6. Power Spectrum E{Pn(k)} = s2 = 1.12 = Rn(0)

  7. Auto-correlation Rn(0) = s2 = 1.12 >> for j = 1:256, R(j) = sum(n.*circshift(n',j-1)'); end

  8. Window Selection: Hamming y = filter(Hamming,1,n);

  9. Hamming Filtered Power Spectrum

  10. White Noise Auto-Covariance vs. Hamming Filtered Noise

  11. Filtered Noiseimage = imnoise(I,’gaussian’,0,10); N_autocov = xcorr2(Noiseimage); figure;imagesc(N_autocov/(128*128));colormap(gray);axis('image') Image Noise Field Autocovariance

  12. Unfiltered figure;imagesc(fftshift(abs(fft2(N_autocov/(128*128)))));colormap(gray);axis('image') Power Spectrum Image Noise Field

  13. Filtered (wc = 0.6; order 20; Hamming Window) N_autocov = xcorr2(Noiseimage_filtered); figure;imagesc(N_autocov/(128*128));colormap(gray);axis('image') Autocovariance Image Noise Field

  14. Filtered (wc = 0.6; order 20; Hamming Window) N_autocov = xcorr2(Noiseimage_filtered); figure;imagesc(N_autocov/(128*128));colormap(gray);axis('image') Power Spectrum Image Noise Field

  15. fMRI Simulation

  16. Windowing vs. Filtering • “Window” applied in temporal or spatial domain to reduce spectral leakage and ringing artifact • Windows fall into a specialized set of functions generally used for spectral analysis • “Filter” applied to reduce noise, i.e. noise matching, or to degrade or improve spatial resolution • Some cross-over: one method of filter design is the “window” method which uses window functions for frequency space modulating functions.

  17. Windowing vs. Filtering • Mathematically,

  18. Filtering MP 574

  19. Outline • Review of FIR/IIR Filters • Z-transform • Difference Equation • Filter Design by Windowing • Power Spectra • Correlation and Convolution • Example from Prof. Holden’s Notes • Windowing and Spectral Estimation • Weiner/Adaptive Filters • Deconvolution

  20. z-Transform as an Analysis Tool • Sampled version (discrete version) of the Laplace transform: • z esT, where T is the sampling period. • DFT and z-transform are related: z = eiwT where s  eiwT

  21. iw s Laplace to z-Transform Im(z) Non-causal signals unit circle Re(z) 0 ws Discrete FT Continuous FT

  22. f(n) g(n) h(n) T{f(n)} z-Transform and Linear Systems • Stated more generally:

  23. Difference Equation Implementation • Shift theorem of z-transform:

  24. Difference Equation Implementation • Shift theorem of z-transform: FIR

  25. FIR Coefficients and Impulse Response • FIR filter:

  26. FIR vs. IIR filters • Finite impulse response (FIR) implies a linear system that is always stable • There are no poles • Infinite impulse response (IIR) is only stable if poles are inside the unit circle or pole coincides with a zero.

  27. IIR System Im(z) Zeros (o) at: -1, 2 Poles (x) at: 0.5±0.5j, 0.75 unit circle x Re(z) o x o x

  28. IIR Stability

  29. fvtool(B,A) B = [1 -1 -2]; A=[1 -1.75 1.25 -0.375]

  30. fvtool(B,A)

  31. fvtool(B,A)

  32. Unstable B = [1 -1 -2]; A=[1 -1.75 1.25 -0.6]

  33. Unstable B = [1 -1 -2]; A=[1 -1.75 1.25 -0.6]

  34. Finite impulse response (FIR) B = [1 -1 -2]; A=[1]

  35. Definition of Stability

  36. FIR filter Design by Windowing • Simply truncate IIR filter • Rectangular Window:

  37. Matlab: fdatool

  38. filter() in Matlab FILTER One-dimensional digital filter. Y = FILTER(B,A,X) filters the data in vector X with the filter described by vectors A and B to create the filtered data Y. The filter is a "Direct Form II Transposed" implementation of the standard difference equation: a(1)*y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb) - a(2)*y(n-1) - ... - a(na+1)*y(n-na)

  39. Exporting Filter Coefficients

  40. Extension to 2D • Radial Transform • H(k)-> (H(k1)2+H(k2)2)1/2=T(k1,k2) • See Matlab script on filter design using radial transformation to 2D: Filter Design • http://zoot.radiology.wisc.edu/~fains/Code/MP574_FilterDesign.m • Parks-McClellan Transformation • Step 1: Translate specifications of H(w1,w2) to H(w) • Step 2: Design 1D filter H(w) • Step 3: Map to 2D frequency space cosw = - ½ + ½ cosw1 + ½ cosw2 + ½ cosw1 cosw2 = T(w1,w2) - Step 4: determine h(n1,n2) by 2D FT.

  41. Hamming Window Example

  42. Hamming Window Example >> w1 = -pi:0.01:pi; >> w2 = -pi:0.01:pi; >> [W1,W2] = meshgrid(w1,w2); >> H_2d = 0.54+0.46.*(-0.5+0.5.*cos(W1)+0.5.*cos(W2)+0.5.*cos(W1).*cos(W2)); >>figure;mesh(H_2d) filter2()

  43. 2D FIR Filter Design, Parks-McClellan

  44. “firdemo”

More Related