Filters and Noise Optional Assessment of Practical Importance Rubin H Landau Sally Haerer, Producer-Director Based on A Survey of Computational Physics by Landau, Páez, & Bordeianu with Support from the National Science Foundation Course: Computational Physics II 1 / 1
Problem: Cleaning Up Noisy a Signal 0 2 4 6 8 1 0 1 2 t (s) Problem: What is pure signal? Two Simple Approaches Autocorrelation functions 1 Digital Filters 2 Both wide applications More filters in Wavelet Analysis & Data Compression 2 / 1
Noise Reduction via Autocorrelation (Theory) Assumption: Noise just adds to signal Measure = Signal + Noise y ( t ) = s ( t ) + n ( t ) 0 2 4 6 8 1 0 1 2 t (s) s ( t ) = ? Science: assume simplest (+) Science: noise ≃ random ( ∞ o F) Recall “random” sequence; r i r i + 1 � ⇒ n ( t ) not correlated with s ( t ) , n ( t ) 3 / 1
Correlation Function c ( t ) How measure correlation? y ( t ) = sin ω, x ( t ) = sin ( n ω t + φ ) correlated � + ∞ dt y ∗ ( t ) x ( t + τ ) c ( τ ) = (Correlation Function) −∞ Correlated ( τ = lag time = variable): Integrand > 0 for some τ ⇒ Constructive interference ⇒ c ( τ ) → ∞ Not correlated: 2 functions oscillate independently +, - equally likely ⇒ Destructive interference ⇒ c ( τ ) ≃ 0 4 / 1
More Correlation Function Properties Express c , y ∗ , x via FT & substitute: � + ∞ d ω ′ C ( ω ′ ) e i ω ′ τ c ( τ ) = √ (FT) (1) 2 π −∞ � + ∞ c ( τ ) def dt y ∗ ( t ) x ( t + τ ) (Def) = (2) −∞ √ 2 π Y ∗ ( ω ) X ( ω ) ⇒ C ( ω ) = (3) Requires convergence to rearrange Related to convolution theorem (soon) 5 / 1
Special Correlation Function: Autocorrelation Measure Correlation with Itself: a ( τ ) � + ∞ a ( τ ) def dt y ∗ ( t ) y ( t + τ ) = −∞ To compute: fold or convolute with self: y ( t ) = measured signal Average over time for “all” τ values a ( 0 ) = “large” 6 / 1
Averaging Removes Random Noise from a ( t ) Proof by substitution y ( t ) = s ( t ) + n ( t ) (Noisy Signal) (4) � + ∞ a y ( τ ) def dt y ∗ ( t ) y ( t + τ ) = (Def a ( t ) ) (5) −∞ � + ∞ = dt [ s ( t ) s ( t + τ ) + s ( t ) n ( t + τ ) + n ( t ) n ( t + τ )] −∞ � + ∞ ⇒ a y ( τ ) ≃ dt s ( t ) s ( t + τ ) = a s ( τ ) QED Magic (6) −∞ √ 2 π | S ( ω ) | 2 ∝ Power Spectrum So A s ( ω ) ≃ (7) 7 / 1
0.6 1.0 4 6 8 10 12 Functiony(t)+NoiseAfterLowpassFilter t(s) y tau(s) 0.4 D 0.8 1.2 0 1.4 x10 2 0 2 4 6 8 10 12 AutocorrelationFunctionA(tau) A C 2 10 A 10 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 x10 3 0 5 15 8 20 25 30 35 40 45 PowerSpectrum(withNoise) Frequency P 0 2 4 6 B How Apply to Data? Start with Noisy signal In itia l F u n c tio n y (t) + N o ise 1 0 8 6 y 4 2 0 0 2 4 6 8 1 0 1 2 t (s) 2 DFT: a ( t ) ⇒ A ( ω ) Compute autocorrelation 1 3 ⇒ power spectrum w/o function random noise 8 / 1
Autocorrelation Function Exercises ( Noise.java ) Example 1 − 0 . 9 sin t ≃ 1 + 0 . 9 sin t + ( 0 . 9 sin t ) 2 · · · 1 Signal: s ( t ) = 1 DFT ⇒ S ( ω ) , Plot | S ( ω ) | 2 . 2 Autocorrelation function a ( t ) of s ( t ) ? 3 Power spectrum a ( t ) vs | S ( ω ) | 2 ? 4 Add noise y ( t i ) = s ( t i ) + α ( 2 r i − 1 ) , 0 fuss ≤ α ≤ hide 5 Plot y ( t ) , Y ( ω ) , Power spectrum. 6 a ( t ) → A ( ω ) . 7 Compare A ( ω ) to power spectrum. 8 9 / 1
Filtering with Transforms (Theory) Action of Filter � + ∞ g ( t ) = d τ f ( τ ) h ( t − τ ) (8) −∞ def = f ( t ) ∗ h ( t ) (9) (analog filter) h ( t ) def = unit impulse Greens function response h ( 0 ) = max, h ( < 0 ) = 0 � + ∞ h ( t ) = −∞ d τ δ ( τ ) h ( t − τ ) ∗ = Convolution 10 / 1
Convolution Theorem Filter as Convolution � + ∞ g ( t ) = d τ f ( τ ) h ( t − τ ) (10) −∞ √ G ( ω ) = 2 π F ( ω ) H ( ω ) (11) � Proof: FT, δ , Lowpass: ↓ high ω Simpler in ω than t Highpass: ↓ low ω Digital: response ( ω n ) 11 / 1
Digital Filters Filter Coefficients c n = Complete Description � + ∞ g ( t ) = d τ f ( τ ) h ( t − τ ) (12) Filter Def: −∞ N � h ( t ) = c n δ ( t − n τ ) (13) Digital Transfer: n = 0 N � ⇒ g ( t ) = c n f ( t − n τ ) (14) n = 0 c n : integration wts N point DFT + response 12 / 1
3 0.8 e 0.0 0.5 1.0 1.5 e 0.0 0.2 0.4 0.6 1.0 u 1.2 1.4 Windowed-sincfilterkernel Time A m p l i t d t d 0.20 0.0 0.2 0.4 0.6 0.8 1.0 0.00 0.05 0.10 0.15 0.25 i 0.30 0.35 0.40 0.45 0.50 Idealfrequencyresponse Frequency A m p l u Exploration: Windowed Sinc Filters (Filter.java) ⊙ Lowpass Filter to Reduce Noise, Aliasing Ideal lowpass Y ( ω ) = rectangular pulse ⇒ y ( t ) = sinc function � t � + ∞ � sin ( π t / 2 ) def d ω e − i ω t rect ( ω ) = sinc = 2 π t / 2 −∞ ⇒ filter out high ω : convolute with sin ( ω c t ) / ( ω c t ) Exercise: Repeat random noise addition using sinc filter 13 / 1
Recommend
More recommend