Wiener Filtering. EE264: Lecture 12

Similar documents
ECE534, Spring 2018: Solutions for Problem Set #5

EE482: Digital Signal Processing Applications

ECE4270 Fundamentals of DSP Lecture 20. Fixed-Point Arithmetic in FIR and IIR Filters (part I) Overview of Lecture. Overflow. FIR Digital Filter

III.C - Linear Transformations: Optimal Filtering

Massachusetts Institute of Technology

EE482: Digital Signal Processing Applications

EE538 Final Exam Fall 2007 Mon, Dec 10, 8-10 am RHPH 127 Dec. 10, Cover Sheet

Discrete-time signals and systems

Lecture 19 IIR Filters

2. Typical Discrete-Time Systems All-Pass Systems (5.5) 2.2. Minimum-Phase Systems (5.6) 2.3. Generalized Linear-Phase Systems (5.

Use: Analysis of systems, simple convolution, shorthand for e jw, stability. Motivation easier to write. Or X(z) = Z {x(n)}

UNIT-II Z-TRANSFORM. This expression is also called a one sided z-transform. This non causal sequence produces positive powers of z in X (z).

EE538 Final Exam Fall :20 pm -5:20 pm PHYS 223 Dec. 17, Cover Sheet

EE 225a Digital Signal Processing Supplementary Material

EEL3135: Homework #4

ECE503: Digital Signal Processing Lecture 5

Nonparametric and Parametric Defined This text distinguishes between systems and the sequences (processes) that result when a WN input is applied

ECE 438 Exam 2 Solutions, 11/08/2006.

Each problem is worth 25 points, and you may solve the problems in any order.

Linear Optimum Filtering: Statement

Chapter 2 Wiener Filtering

Lecture 7 Discrete Systems

Digital Signal Processing:

Solutions. Number of Problems: 10

ELEN E4810: Digital Signal Processing Topic 2: Time domain

Machine Learning. A Bayesian and Optimization Perspective. Academic Press, Sergios Theodoridis 1. of Athens, Athens, Greece.

INTRODUCTION Noise is present in many situations of daily life for ex: Microphones will record noise and speech. Goal: Reconstruct original signal Wie

EE 521: Instrumentation and Measurements

Complement on Digital Spectral Analysis and Optimal Filtering: Theory and Exercises

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science. Fall Solutions for Problem Set 2

MMSE System Identification, Gradient Descent, and the Least Mean Squares Algorithm

6.02 Fall 2012 Lecture #11

The Z-Transform. Fall 2012, EE123 Digital Signal Processing. Eigen Functions of LTI System. Eigen Functions of LTI System

Complement on Digital Spectral Analysis and Optimal Filtering: Theory and Exercises

Lesson 1. Optimal signalbehandling LTH. September Statistical Digital Signal Processing and Modeling, Hayes, M:

Adaptive Systems Homework Assignment 1

Lecture 18: Stability

Very useful for designing and analyzing signal processing systems

Discrete-Time Signals and Systems. The z-transform and Its Application. The Direct z-transform. Region of Convergence. Reference: Sections

Today. ESE 531: Digital Signal Processing. IIR Filter Design. Impulse Invariance. Impulse Invariance. Impulse Invariance. ω < π.

CHAPTER 2 RANDOM PROCESSES IN DISCRETE TIME

The goal of the Wiener filter is to filter out noise that has corrupted a signal. It is based on a statistical approach.

Solutions: Homework Set # 5

Let H(z) = P(z)/Q(z) be the system function of a rational form. Let us represent both P(z) and Q(z) as polynomials of z (not z -1 )

Z Transform (Part - II)

26. Filtering. ECE 830, Spring 2014

5 Kalman filters. 5.1 Scalar Kalman filter. Unit delay Signal model. System model


ECE503: Digital Signal Processing Lecture 4

Practical Spectral Estimation

Lecture 7 - IIR Filters

Basics on 2-D 2 D Random Signal

Lecture 2 OKAN UNIVERSITY FACULTY OF ENGINEERING AND ARCHITECTURE

A. Relationship of DSP to other Fields.

Least Square Es?ma?on, Filtering, and Predic?on: ECE 5/639 Sta?s?cal Signal Processing II: Linear Es?ma?on

Digital Signal Processing Lecture 9 - Design of Digital Filters - FIR

Digital Signal Processing Lecture 4

Digital Signal Processing. Midterm 1 Solution

Analysis of Finite Wordlength Effects

HST.582J / 6.555J / J Biomedical Signal and Image Processing Spring 2007

X n = c n + c n,k Y k, (4.2)

EE 123: Digital Signal Processing Spring Lecture 23 April 10

Stability Condition in Terms of the Pole Locations

LECTURE NOTES DIGITAL SIGNAL PROCESSING III B.TECH II SEMESTER (JNTUK R 13)

EE482: Digital Signal Processing Applications

NEW STEIGLITZ-McBRIDE ADAPTIVE LATTICE NOTCH FILTERS

Ch. 7: Z-transform Reading

Solutions. Number of Problems: 10

Responses of Digital Filters Chapter Intended Learning Outcomes:

Statistical and Adaptive Signal Processing

Lecture 04: Discrete Frequency Domain Analysis (z-transform)

z-transform Chapter 6

Parametric Signal Modeling and Linear Prediction Theory 1. Discrete-time Stochastic Processes (cont d)

Topic 4: The Z Transform

ELEG-636: Statistical Signal Processing

Transform Analysis of Linear Time-Invariant Systems

Discrete Time Systems

EE482: Digital Signal Processing Applications

Digital Filter Structures. Basic IIR Digital Filter Structures. of an LTI digital filter is given by the convolution sum or, by the linear constant

Discrete Time Systems

CCNY. BME I5100: Biomedical Signal Processing. Stochastic Processes. Lucas C. Parra Biomedical Engineering Department City College of New York

Z - Transform. It offers the techniques for digital filter design and frequency analysis of digital signals.

Z-Transform. 清大電機系林嘉文 Original PowerPoint slides prepared by S. K. Mitra 4-1-1

EE123 Digital Signal Processing. M. Lustig, EECS UC Berkeley

Optimal and Adaptive Filtering

EE102B Signal Processing and Linear Systems II. Solutions to Problem Set Nine Spring Quarter

Digital Signal Processing Lecture 5

Advanced Signals and Systems

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science Discrete-Time Signal Processing Fall 2005

Transform analysis of LTI systems Oppenheim and Schafer, Second edition pp For LTI systems we can write

Probability Space. J. McNames Portland State University ECE 538/638 Stochastic Signals Ver

The Cooper Union Department of Electrical Engineering ECE111 Signal Processing & Systems Analysis Final May 4, 2012

Laboratory Project 2: Spectral Analysis and Optimal Filtering

Lecture - 30 Stationary Processes

Lecture 2 Discrete-Time LTI Systems: Introduction

ECE503: Digital Signal Processing Lecture 6

ECE 8440 Unit 13 Sec0on Effects of Round- Off Noise in Digital Filters

Discrete-Time Fourier Transform (DTFT)

MITIGATING UNCORRELATED PERIODIC DISTURBANCE IN NARROWBAND ACTIVE NOISE CONTROL SYSTEMS

Dominant Pole Localization of FxLMS Adaptation Process in Active Noise Control

Transcription:

EE264: Lecture 2 Wiener Filtering In this lecture we will take a different view of filtering. Previously, we have depended on frequency-domain specifications to make some sort of LP/ BP/ HP/ BS filter, which would extract the desired information from an input signal. Now, we wish to filter a signal x[n] to modify it such that it approximates some other signal d[n] in some statistical sense. That is, the output of the filter y[n] is a good estimate of d[n]. The output error e[n] represents the mismatch between y[n] and d[n]. This can be considered a time-domain specification of the filter. x[n] FILTER y[n] e[n] Why would we want to do this? Well, consider the problem of predicting the stock market. Assume that x[n] represents the price of a particular stock on day n and d[n] is the price of that stock one day in the future. The goal is to find a filter that will predict d[n] given x[n]. Moreover, we would like to find the best such linear predictor. Q: Is there an obvious solution for this case? A: Sure, pick H(z) z, but this is worthless for this real-time example! In order to talk about an optimal filter which estimates d[n] from x[n], we must have a method of measuring how good a job the filter does. A cost function is used to judge the performance, and could take on many different forms. d[n] Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

2 Wiener Filtering Lect. 2 For example, Mean Threshold Error ξ E[u[ e[n] k]] error Mean Absolute Error ξ E[ e[n] ] error Mean Square Error ξ E[e 2 [n]] error We most commonly use the mean square error (MSE) as our cost function. where E[ ] represents statistical expectation, and E[e 2 [n]] ξ E[e 2 [n]] x 2 p e (x) dx where p e (x) is the probability density function of the error. The filter that is optimum in the MSE sense is called a Wiener filter. In all our analyses here we will assume:. x[n] is wide-sense stationary, i.e. it has constant (and finite) mean and variance, and a correlation function which is a function of time shift only: E[x[m ] x[m n]] E[x[m 2 ] x[m 2 n]] m, m 2 Incidentally, a stronger condition would be to assume that x[n] is strong-sense stationary, i.e. all of its moments are constant and finite. An even stronger condition would be to assume that x[n] is ergodic, i.e. all of its sample averages converge to the true moments. Fortunately, these latter two conditions are not necessary for the present development. 2. All of the signals are zero-mean.. We use MSE as our error criterion. Correlation The definition of correlation between two random processes x[n] and y[n] (when x and y are wide sense stationary) is: φ xy [k] E[x[n]y[n k]] Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

Lect. 2 Wiener Filtering It is a measure of the similarity between two random variables, and is related to the amount of information that one random variable contains about another. Example: φ xx φ xx Highly Correlated Uncorrelated (white) Two-Sided (Unconstrained) Wiener Filters ξ E[e 2 [n]] E[(d[n] y[n]) 2 ] E[d 2 [n]] 2E[y[n]d[n]] E[y 2 [n]] φ dd [0] 2φ yd [0] φ yy [0] So, the cost function is itself a function of the correlation and cross correlation of the output of the filter and the desired output. We know that: y[n] h[m]x[n m] Observe that, in general, h[m] represents a non-causal filter with infinite impulse response (IIR). (Later, we consider the special case where h[m] is either a causal IIR filter or a causal FIR filter.) Substituting the definition for y[n] into the previous result, we get: φ yd [0] E[y[n]d[n]] [ ] E h[m]x[n m]d[n] h[m]φ xd [m] φ yy [0] E[y[n]y[n]] E h[m]x[n m] l [ ξ φ dd [0] 2 l h[m]h[l]φ xx [l m] h[m]φ xd [m] h[l]x[n l] ] l Our goal is to find h[n] which minimizes ξ. The solution is to take the derivative h[m]h[l]φ xx [l m] d ξ d h[n i ] and set it to zero: d ξ d h[n i ] 0 2φ xd [n i ] 2 h opt [m]φ xx [n i m] 0 Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

4 Wiener Filtering Lect. 2 h opt [m]φ xx [n i m] φ xd [n i ] which must be satisfied for all n i. This equation specifies the impulse response of the optimal filter. Observe that it depends on the cross correlation between x[n] and d[n] and the autocorrelation function of x[n]. The optimal filter is known as the Wiener solution. Observing that the left hand side of the equation is equal to the convolution of h opt [n] and φ xx [n], Note: H opt (z)φ xx (z) Φ xd (z) H opt (z) Φ xd (z)φ xx (z) The filter obtained may be non-causal! ξ min φ dd [0] h opt [n]φ xd [n] 0 n in general. Example: Noise Canceling: x[n] s[n] v[n] Noise Canceler y[n] e[n] d[n] s[n] Assuming that s[n] and v[n] are uncorrelated, zero mean: We notice two properties from this solution: E[x[n]x[n k]] E[(s[n] v[n])(s[n k] v[n k])] φ ss [k] φ vv [k] Φ xx (z) Φ ss (z) Φ vv (z) E[x[n]d[n k]] E[(s[n] v[k])s[n k]] φ ss [k] Φ xd (z) Φ ss (z) Φ ss (z) Thus, H opt (z) Φ ss (z) Φ vv (z). At frequencies where Φ vv (z) 0 (i.e. the noise is zero) there is no need to filter the signal and H opt (z). 2. At frequencies where Φ vv (z) (i.e. where the noise dominates) the filter is turned off and H opt (z) 0. Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

Lect. 2 Wiener Filtering 5 Numerical Example: Assume that the autocorrelation function of the input signal is: φ ss [k] 0 27 and that the autocorrelation of the (white) noise source is: ( ) k 2 φ vv [k] 2 δ[k] The signal and noise are assumed to be uncorrelated with each other. φ ss φ vv To find the Wiener filter, we need to obtain Φ xd (z) and Φ xx (z). We can first find φ xd [k] and φ xx [k], and then z-transform them. Since the signal and noise are uncorrelated with each other, The z-transform of the noise autocorrelation is φ xx [k] φ ss [k] φ vv [k] 0 ( ) k 2 27 2 δ[k], Φ xx (z) Φ ss (z) Φ vv (z). Φ vv (z) 2. The z-transform of the signal autocorrelation (after some math) is Φ ss (z) 5/8 ( 2 z )( 2 z). Combining these: Φ xx (z) 5/8 ( 2 z )( 2 z) 2 20 6z 6z 8( 2 z )( 2 z). We saw earlier, Combining these results: H opt (z) φ xd [k] φ ss [k], Φ xd (z) Φ ss (z). 5/8 ( z )( z) h opt [n] 5 ( ) n, n 6 Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

6 Wiener Filtering Lect. 2 Q: How did we pick this h opt [n] without knowing the ROC of H opt (z)? A: We need a stable noise canceller. Clearly this resulting filter is non-causal. We have two recourses:. Limit the filter to be a causal IIR filter. 2. Compute the optimal FIR filter instead. Causal (Shannon-Bode) Wiener Filters Our interest now focuses on the realization of causal Wiener filters, whose impulse responses are constrained to be zero for negative time. The optimal causal impulse response has zero response for negative time and has zero derivatives of ξ with respect to impulse response for all times equal to and greater than zero. The causal Wiener equation becomes: h opt causal [m]φ xx [n m] φ xd [n], n 0 m0 h opt causal [n] 0, n < 0. This is not a simple convolution like the unconstrained Wiener equation, and special methods will be needed to find useful solutions. The approach developed by Shannon and Bode will be used. We begin with a simple case. Let the filter input be white with zero-mean and unit variance, so that φ xx [n] δ[n]. For this input, the causal Wiener equations become h opt causal [m]φ xx [n m] h opt causal [n] φ xd [n], n 0 m0 h opt causal [n] 0, n < 0 With the same white input, but without the causality constraint, the Wiener equation would be h opt [m]φ xx [n m] h opt [n] φ xd [n], n. From this we may conclude that when the input to the Wiener filter is white, the optimal solution with a causality constraint is the same as the optimal solution without the constraint, except that with the causality constraint the impulse response is set to zero for negative time. With a white input, the causal solution is easy to obtain, and it is key to Shannon-Bode. You find the unconstrained two-sided Wiener solution and remove the non-causal part in the time domain. You don t do this if the input is not white. Usually, the input to the Wiener filter is not white. Therefore the first step in the Shannon-Bode realization is to whiten the input signal. A whitening filter can always be designed to do this, using a priori knowledge of the input autocorrelation function or its z-transform. Assume that the z-transform of the autocorrelation function is a rational function of z that can be written as the ratio of a numerator polynomial in z to a denominator polynomial in z. Factor both the numerator and denominator polynomials. The autocorrelation function is symmetric, and its z-transform has the following symmetry: φ xx [n] φ xx [ n], Φ xx (z) Φ xx (z ). Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

Lect. 2 Wiener Filtering 7 Accordingly, there must be symmetry in the numerator and denominator factors: Φ xx (z) A ( az )( az)( bz )( bz)... ( αz )( αz)( βz )( βz).... With no loss in generality, assume that all the parameters a, b, c,..., α, β,... have magnitudes less than one. We can then factor Φ xx (z) as where Φ xx (z) Φ xx (z) Φ xx (z), Φ xx(z) A ( az )( bz )... ( αz )( βz )... Φ xx(z) ( az)( bz)... A ( αz)( βz).... All poles and zeros of Φ xx (z) will be inside the unit circle in the z-plane. All poles and zeros of Φ xx (z) will be outside the unit circle in the z-plane. Furthermore, Φ xx (z) Φ xx (z ), Φ xx (z ) Φ xx (z). The whitening filter can now be designed. Let it have the transfer function H whitening (z) Φ xx(z). To verify its whitening properties, let its input be x[n] with autocorrelation function φ xx [n], and let its output be x[n] with autocorrelation function φ x x [n]. The transform of the output autocorrelation function is The autocorrelation function of the output is Φ x x (z) H whitening (z ) H whitening (z) Φ xx (z) Φ xx(z ) Φ xx(z) Φ xx(z) Φ xx(z) Φ xx(z) Φ xx(z). φ x x [n] δ[n]. Therefore the output is white with unit mean square. It is important to note that the whitening filter is both causal and stable, since the zeros of Φ xx(z) are all inside the unit circle in the z-plane. Furthermore, using this whitening filter does nothing irreversible to the signal. The inverse of the whitening filter has a transfer function equal to Φ xx(z), which is also stable and causal because Φ xx(z) has all of its poles inside the unit circle. The whitening filter can be readily utilized since it is causal, stable, and invertible with a causal, stable filter. The only case not included involves zeros of Φ xx(z) exactly on the unit circle. This is a special case and it requires special treatment. These zeros are assumed to be somewhere off the unit circle, and they are placed back on it by a limiting process. Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

8 Wiener Filtering Lect. 2 x[n] Φ xx (z) x[n] Y opt (z) y[n] e[n] - The subsequent filter is easily designed, since its input is white. We represent its transfer function by Y opt causal (z) and can design it by first obtaining Y opt (z) disregarding causality, and then removing the non-causal part of its impulse response. We wish to find Y opt (z) disregarding causality in terms of the autocorrelation of x[n] and crosscorelation with d[n]. To do so, we could work out expressions for Φ x x (z) and Φ xd (z) in terms of Φ xx (z) and Φ xd (z) and then use the formula for the uncostrained Wiener filter. However, there is an easier way; notice that the cascading of and Y Φ opt(z) should be equal to the unconstrained Wiener filter given by Φ xd(z) xx(z) Φ, hence xx(z) Y opt (z) Φ xd(z) Φ xx (z) Φ xx(z) Φ xd(z) Φ xx(z) To obtain Y opt causal (z), we first inverse transform Y opt (z) into the time domain, remove the non-causal part, and then z-transform the causal part obtained. This operation cannot be done with z-transforms alone. A special notation has been devised to represent taking the causal part: [ ] Φxd (z) Y opt causal (z) [Y opt (z)] Φ. xx(z) d[n] The Shannon-Bode realization of the causal Wiener filter can now be formulated: [ ] Φxd (z) H opt causal (z) Φ xx(z) Φ. xx(z) Example: An example helps to illustrate how this formula is used. We will rework the above noise filtering example, only in this case the Wiener filter will be designed to be causal. The first step is to factor Φ xx : Therefore, Φ xd (z) was found before. Thus: Φ xx (z) ( z)( z ) ( 2 z)( 2 z ). Φ xx ( z ) ( 2 z ), Φ xx ( z) ( 2 z). Φ xd (z) 5/8 ( 2 z )( 2 z). Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

Lect. 2 Wiener Filtering 9 Y opt (z) Φ xd(z) Φ xx(z) 5/8 ( 2 z )( [ z) ] 6 z 2 z z. The filter Y opt (z) is generally two-sided in the time domain. In order for it to be stable, its two terms must correspond to time domain components as follows: 6 z 2 z (right-handed time function). z (left-handed time function). 6 2 24 6 z 2 z 27 9 z 27 9 6 2 24 [ ] 6 z 2 z z Y opt (z) 6 2 24 [ ] 6 z 2 z z Y opt causal (z) Y opt causal (z) 6 z 2 z 2... ( ). 2 z Including the whitening filter, the transfer function of the causal Wiener filter is ( ) ( ) 2 H opt causal (z) z z 2 z h opt causal [n]. ( ) z n, n 0. Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

40 Wiener Filtering Lect. 2 9 27 8 z z H opt causal(z) It is expected that the causal Wiener filter would not perform as well as the unconstrained non-causal Wiener filter. This is indeed the case, and can be verified with a little math. ξ min causal φ dd [0] h opt causal [n]φ xd [n]. n0 Optimal FIR Wiener Filters For an FIR realization, we make the following changes in the derivation: y[n] N k0 This time, we will solve the system using matrix notation: Filter H [h 0, h,..., h N ] T Input X [x n, x n,..., x n N ] T Output y[n] H T X X T H (scalar) Error e[n] d[n] y[n] d[n] H T X h[k]x[n k] ξ E[e 2 [n]] E[d 2 [n]] 2E[H T Xd[n]] E[H T XX T H] φ dd [0] 2H T E[Xd[n]] H T E[XX T ] H }{{}}{{}}{{} σd 2 P R Note: ξ is a quadratic function of the filter H. This implies (among other things) that there is a unique global optimum. If X and d[n] are uncorrelated, then P 0. P E[Xd[n]] E[x[n]d[n]]. E[x[n N ]d[n] p[0]. p[n ] R E[X(X) T ] E[x[n]x[n]] E[x[n N ]x[n]]..... E[x[n]x[n N ] E[x[n N ]x[n N ]] Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores

Lect. 2 Wiener Filtering 4 r[0] r[n ]..... r[n ] r[0] If x[n] is a white noise process with unit variance, then R I, the identity matrix. Solution: The minimum error location will be where: [ ] ξ ξ(h opt ) 0 where ξ(h) h[0],..., ξ T h[n ] As a result, 2P 2RH opt 0 RH opt P A correlation matrix R is always positive semi-definite, so unless R 0, its inverse will exist: H opt R P The minimum error can be found too: R T ξ min ξ(h opt ) and since R is positive semi-definite, Without filtering, the error is σd 2, so we do better! σ 2 d 2P T R T P P T R T RR P σ 2 d P T R P σ 2 d P T H opt ξ min σ 2 d R since R is a cov. matrix Copyright c 995 996 by G. Plett. Copyright c 998 2004 by M. Kamenetsky. Copyright c 2005 by A. Flores