nca-6: tutorial on adaptive filteringfiles.asme.org/divisions/ncad/16129.pdfnca-6: tutorial on...
TRANSCRIPT
NCA-6: Tutorial on Adaptive Filtering:
With applications for Active Control
Jeffrey S. Vipperman ([email protected])Assoc. Professor of Mech. Engr.
Director, Sound, Systems, and Structures Laboratory
University of PittsburghPittsburgh, PA 15228
IMECE ‘06Nov. 9, 2006Chicago, IL
OutlineBackground on Active ControlLinear Systems and SignalDigital FiltersAdaptive AlgorithmsSome Practical Considerations
Active Control• Add energy through a secondary source to cancel
or dissipate energy from a primary or disturbance force
• Types of Active Control:– Active Noise Control (ANC) and Active Noise
Reduction (ANR) headsets– Active Vibration Control (AVC)– Active Structural-Acoustic Control (ASAC)
Active Versus Passive Control
(+) Works Well at High Frequencies (> 500 Hz)(+) No System Model Required(–) Typically heavier (CLD, Insulation, lead, etc.)Simple, but some knowledge of system/physics still required(+) Generally failsafe(+) Requires no power
(+) Works Well at Low Frequencies (< 500 Hz)(–) System Model may be required(+) Weight Savings can often be gained(–) Increased Complexity & Cost (transducers, computation, electronics)(–) May fail(–) Requires power
Passive Active
Control Topologies
Feedback (FB) - Uses a measured system variable to create control signal
Feedforward (FF) - Uses a coherent signal to create control signal
"Hybrid" FB + FF Blends the best of both worlds
G
K
K
H
GK
G
Feedback Versus Feedback Control
(–) System may become unstable(+) Controls unknown disturbances(+) Better for random or impulsive disturbances (n) Typically fixed gain; adaptive possible, but harder(–) Performance often limited to modest increases in damping(–) Often requires a System ID or model of plant
(+) System always Stable(–) Requires a priori, coherent reference signal(+) Excellent for harmonic and deterministic disturbances(+) Very amenable to adaptive methods(+) Complete attenuation possible (at point, plane waves)(–) Can also require System ID or model (for FXLMS)
Feedback Feedfoward
Additional Features of Feedforward Control
Most popular for adaptive controlPotential for complete control of plane waves (duct) or at a point in space, since many signals are deterministicGlobal control in 2 or 3 dimensions is difficultRequires Coherent Reference Signal (deterministic or a priori knowledge)System is always stable, but adaptive algorithms can go unstableRepresents the bulk of commercial applications: – (Active Headsets: Sony, NCT, BBN, aviation headsets); – Active mounts for vibration isolation (DC-9, car engines); – Active noise control (high end autos - sound system, and aircraft
Saab 340b).Works by Superposition
Physics of Feedfoward Noise Control – 1-d Noise Fields
Cancellation of a plane wave or 1-d field in an ∞ duct
Primary Field:
Secondary Field:
Resulting Field:
Constructive Interference
Destructive Interference
Requirements:1. Need Coherent
Reference Signal2. Frequency must be
below the cut-off frequency of the duct (1-d plane waves) roughly c/(2*L), where L is the largest cross sectional dim.
+ +
= =
First Active Control Patent 1936
Paul Leug (1936). Process of Silencing Sound
Oscillations, US Patent No. 2,043,416
Physics of Feedfoward Noise Control – 2d Noise Fields
Primary Field
Secondary Field (separated by
λ/10)
Total Field
-1 -0.5 0 0.5 1
-1-0.5
00.5
1-2
0
2
Primary Field 500 Hz: (x,y)=(0,0)
-2
-1
0
1
2
-1 -0.5 0 0.5 1
-1-0.5
00.5
1-2
0
2
Secondary Field (x,y)=(0.0686,0) or λ/10 spacing
-2
-1
0
1
2
-1 -0.5 0 0.5 1
-1-0.5
00.5
1-2
0
2
x-dimension (m)
Primary + Secondary Fields
y-dimension (m)
-2
-1
0
1
2
+
=
Physics of Feedfoward Noise Control – 2d Noise Fields
Primary Field
Secondary Field (separated by
λ/2)
Total Field
-1 -0.5 0 0.5 1
-1-0.5
00.5
1-2
0
2
Primary Field 500 Hz: (x,y)=(0,0)
-0.5
0
0.5
-1 -0.5 0 0.5 1
-1-0.5
00.5
1-2
0
2
Secondary Field (x,y)=(0.343,0) or λ/10 spacing
-0.5
0
0.5
-1 -0.5 0 0.5 1
-1-0.5
00.5
1-2
0
2
x-dimension (m)
Primary + Secondary Fields
y-dimension (m)
-1
0
1
+
=
Feedforward Control RequirementsSpacing between primary and secondary sources must be ≤ 1/3-1/6 of a wavelength apart for global controlThus, physics limits performance to low frequency (<500 Hz)Control of 3-d spaces become more difficult – at best, notch out zones of silence (e.g. around the head of a passenger)Coherent, apriori reference signal
Signals and Linear Systems: Time Domain
g(t)x(t) y(t)
x(t) – input signalg(t) – impulse response of linear systemy(t) – output of system
domain) (time )()()(*)()(0∫ −==t
dhtgtxtgty τττ
Convolution integral – continuous time filtering process
G(s)X(s) Y(s)
)]([)( transform Laplace)]([)(
tyLsYtxLsX
==
Function)(Transfer )()()(
sXsY
inputouputsG ==
)]([)(or tgLsG =
(FRF) )()]([)( Also ωωjs
sGtgG=
=ℑ=
Signals and Linear Systems: Laplace Domain
Relationship between Discrete and Continuous Time Signals
Time Domain
“Frequency”Domain
Continuous
Discrete
x(t)
x(k) X(z)
X(s)Laplace Transform
z-transform
z-transform: ( ) [ ] ∑=
−==M
k
kzkxkxZzX0
)()(
Finite Impulse Response (FIR) Digital Filtera.k.a. Moving Average (MA)
z-1
w0 w1 w2 w3
Σ
x(k)Input
(Unit sample delay)
(Filter coeffs.)
W(z)= w0 + w1 z-1 + w2 z-2 + ... (z-domain){W} = {w0 w1 w2 ...} (vector rep.)
...
...
Filter representations:
y(k)Output
z-1 z-1 z-1
Σ Σ Σ Σ
...)()( 11 ++== −zwwzWzG o
y(k) = w(k) * x(k) (time-domain, convolution)Y(z) = W(z)X(z) (z-domain, multiplication)y(k) = {W}{X}T (vector multiplication)
FIRs, Cont.Filter Output Representations:
Unit Impulse Response, h(k)h(k) = w(k), Impulse response is finite and
equal to the number of filter coefficients, w(k)
Frequency Response of FIR
Discrete Fourier Transform (DFT)DFT[k-1] = e-jωT
k-1 is unit sample delayT is sample periodω is frequency of excitation
j is (-1)½
where:
Example, 2-coefficient FIR:W(z) = w0 + w1 z-1
W(ω) = w0 + w1 e-jωT
= [w0 + w1cos(ωT)] + j [w1 sin(ωT)]= Re[W(ω)] + j Im[W(ω)]
Frequency Response, cont
From complex math:Mag = [Re2 + Im2]½
Phase = –tan-1[Im/Re] (lin. phase – prop. delays)A 2-coefficient FIR filter can change the phase
and magnitude at a single frequency!
b0 b1 b2 b3
x(k)Input
y(k)Output
(Unit sample delay)
(B(z) coeffs.)...
...
Infinite Impulse Response (IIR) Digital Filtera.k.a. Auto-regressive, Moving Average (ARMA)
a4 a1a2a3...
...
(Autoregressive or feedback portion added)
z-1 z-1 z-1 z-1
z-1 z-1 z-1 z-1
)()()(
zAzBzG = Σ Σ Σ Σ Σ
(A(z) coeffs.)
MA Portion
Filter, W(z)IIRs, cont.
Poles introduce stability requirementImpulse response, h(k) is infinite in duration due to FBAn infinite length FIR has an infinite impulse response, but numerical effects limit the practical length to a few hundred coefficientsMost adaptive feedforward control systems use FIRs since they are inherently stable
Notes
nn
z
mm
zazaazbzbzbbzW
zAzBzW
−−−
−−−
+++++++=
=
...1...)(
)()()(
22
11
22
110
G(z)Plant
W(z)
+
_
System Identification Problem:
e(k), error
x(k),input
d(k), desired response
y(k), filter output
Example: Finding the Optimal Filter Solution, Wopt
)()( ,0)( As zGzWke →→
TXWkdkxkwkdkekykdke
}}{{)()(*)()()()()()(
−=−=−=
Finding the Optimal Filter Solution, Wopt, cont.
The filter output, y(k)={X}{W}T, is linear combination of the filter weight vector {W}Assuming stationarity, the error is characterized statisticallyA “cost function from the mean-square error (MSE) as:
C=E[e(k)2]whereE[·] represents the expected value, which for N samples is:
Consider:
[ ] ∑=
=N
k
kekeE1
22 )()(
Finding the Optimal Filter Solution, Wopt, cont.
The MSE, C=E[(d(k)-{X}{W}T)2], is a quadratic function of the filter weights, {W}There is a unique minimum of C corresponding to Wopt(k)The minimum is found through differentiation:
Solve the above equation for {W}opt
In real life, we don't have the luxury of the equation for C
}0{}{
=∂∂WC
Solving for {Wopt}, {Wopt} = [R]-1 {P}
Finding the Optimal Filter Solution, Wopt, cont.
( )[ ] 0}{
}}{{)(}{
2
=∂−∂=
∂∂
WxWkdE
WC T
( )[ ] 0}{}}{{}){(2}{
=+−=∂∂ XXWXkdEWC TT
(gradient) }0{]}[{2}{2}{
=+−=∂∂ RWPWC
•[R] is the input autocorrelation matrix (symmetric Toeplitz, positive definite)•{P} is the cross correlation vector
Performance or Error SurfaceA 2-Coefficient FIR Filter Perf. Surf. is 3-d:
{Wopt} is at the minimum
Adaptive algorithms search along this surface
Adaptive Minimization Methods (Finding {Wopt})
1. Random Search2. Adaptive Newton's Method3. Time Averaged Gradient (TAG)4. RLS5. Steepest Descent6. Least Mean Square (LMS)7. Variations of LMS (FXLMS, PC-LMS)
1. Random SearchPerturb each filter coefficient, wi, and see if the measured cost, C({W})=E[e(k)2], increases or decreasesIf C({W}) decreases, keep the changeRemember the direction of perturbation and the result
Adaptive Minimization Methods, cont.
One Iteration to the Optimal SolutionDon't know C(k) explicitly, so must estimate C′(k) and C″(k)in practiceCould compute C′ and C″ from expected value definitions, but they are noisyMust ensure that C″ is always positive-valued Forms the basis of Time Averaged Gradient (TAG) algorithm
2. Discrete form of Newton's Method
[ ] )(21)()1( 1 kCRkwkw ii ′−=+ −
)()()()1(
kCkCkwkw ii ′′
′−=+
Measure cost function, C, at three points: {wi–δwi, wi, wi + δwi}
μ controls convergence rate and stabilityδwi must be large enough for accuracy but small enough not to excessively excite the plantΤhis is an approximation to Newton's MethodΝο System ID required!Typically much slower to converge though -particularly for MIMO
3. Time Averaged Gradient (TAG)
Adaptive Minimization Methods, cont.
[ ][ ])()(2)(2
)()()()1(iiiii
iiiiiii wwCwCwwC
wwCwwCwkwkwδδ
δδδμ−+−+
−−+−=+
Recursive Least Squares (RLS)ComplexFast ConvergenceComputational intensive (L2 calculations for filter with L coefficients
Adaptive Minimization Methods, cont.
Adaptive Minimization Methods, cont.
5. Steepest Descent
μ is again a learning rate parameter that controls convergence rate and stability of the adaptive algorithmMarch down the gradient towards the optimal solution {Wopt}
WkCkwkw ii ∂
∂−=+ )(2
)()1( μ
[ ]( )}{)}({)}({)1}({ PkWRkWkW −−=+ μ
[ ] [ ]( ) }{)}({)1}({ PkWRIkW μμ −−=+
Adaptive Minimization Methods, cont.
This is actually Steepest Decent with a stochastic approximation to the gradientμ controls convergence rate and stability0 < μ < 2/λmax, λmax is max eig.value of [R]March down the gradient (in a very noisy manner) towards the optimal solution {Wopt}Converges (“noisily”) to the optimal Wiener filter solutionExcess MSE as a result of noiseVery simple and robust
6. LMS Algorithm
)()(2)()1( kxkekwkw ii μ−=+
Adaptive Control Using PC-LMS7. Filter-x LMS (FXLMS) Algorithm for System Control:
Will examine in more detail soonThe plant dynamics in the control path, Gc(z), affect weight update
Sign change in updatexfx(k) is the “Filtered-x” (filtered ref.) signal
)(*)()()()(2)()1(
kxkgkxkxkekwkw
cfx
fxii
=
+=+ μ
Disturbance/Echo cancellation
W(z)_
e(k), errorx(k), input
d(k), desired signal
y(k), filter output
Adapt. Alg.x(k) and n(k)
coherent
Uses for Adaptive Signal Processing, cont.
n(k), noise
)()( ),( minimize As kdkeke →
G(z)Plant
W(z)
+
_
System Identification:
e(k), error
x(k),input
d(k), desired response
y(k), filter output
Adapt. Alg.
ReferenceSignal
Uses for Adaptive Signal Processing, cont.
)()()( ,0)( zGzWzWkeAs opt =→→
Uses for Adaptive Signal Processing, cont.
G(z)Plant
W(z)+
_
Inverse Modeling:
e(k), error
x(k),input
y(k)d(k)
1)()()( ,0)( As −=→→ zGzWzWke opt
FXLMS Algorithm for Adaptive Control:
Gd(z)
W(z)
+
+
x(k),input e(k)
y(k) Gc(z)
Plant
Adaptive Control Using FX-LMS
)()()()()()( zXzWzGzXzGzE cd +=
)()()()( zXzG
zWzE
c=∂∂
)()()(
zGzGzWopt
c
d−=
Need for filtered-x signal
Need forsign change
in LMS update
Adaptive Control Using FXLMS, cont.
LMS update equation becomes:
where xfx(k) = gc(k) * x(k) is the so-called "filtered-x" signalNote the gradient based on control path transfer function, Gc(z)Therefore a model or system ID (SID) of the control path is required to implementSID can be a priori, or simultaneous with controlModel dependent, but really only need the correct phase of the Gc(z) path
)()(2)()1( kxkekwkw fxii μ+=+
Controlling Harmonic SignalsA 2-coefficient FIR filter can change the magnitude and phase of a sine wave
If 4x oversampling or separate sine and cosine ref. signals are used, then the two filter coeffs are orthogonal
Can use a Hilbert filter to perform quadrature on a signal
)sin()sin()cos( φωωω +=+ tMtBtA
k-1
w0 w1
Σ
x(k)Input
Σ
w0 w1
Σ
sin(ωnΤ)
Σ
cos(wnT)
y(k)Output
y(k)Output
Orthogonal filter
Controlling Multiple Frequencies
Two distinct ways to perform multi-frequency control: (a) with large FIR filters or (b) with parallel 2-coefficient filters
(a) Large FIR filters (easier but not as good)Use an FIR filter having twice the number of coefficients as there are frequenciesCareful! This only works for higher-harmonic control when the sampling rate is twice the frequency of the highest harmonic (bad idea - 4x oversampling is ideal)Otherwise, there are Time-varying parts to the LMS solution which will oscillate about the Wiener solutionUse more filter coefficients to compensateSum all frequencies to make the reference signal
Using P-Parrallel 2-Coefficient FIR filters (Best way)
Multi-frequency Adaptive Control Using FX-LMS, cont.
Gd(z)
Wf1(z)
++
xf1(k)
e(k)
Gc(z)
Plant
xf2(k)
xfP(k)
Wf2(z)
WfP(z)
Gc,f1(z)
Gc,f2(z)
Gc,fP(z)
(Controlling P harmonics of the fundamental frequency)
Controlling Broadband (Random) Signals
Use a large (20-200 coefficient) FIR filter for the compensator, W(z)If the plant is non-reverberant (e.g. high-damping, acoustic free-field, etc.) an FIR can be used to model Gc(z) since it will essentially be a pure delayFor reverberant systems, an IIR is required to model the control path, Gc(z)May require IIR for control filterThe reference signal must be known ahead of time (i.e. the Wiener solution must be “causal”)Otherwise, control is limited to the deterministic portion of the plant responseCan also get transient control (training an issue)
Multichannel FX-LMS ControlGd1(z)Gd2(z)GdL(z)
GC11(z)GC12(z)GC1L(z)
GC11(z)GC12(z)GC1L(z)
GCM1(z)GCM2(z)GCML(z)
Plant
e1(k)
e2(k)
eL(k)
M Control Channels L error signals
x(k)
w1(z)
w2(z)
wM(z)
Multichannel FX-LMS, cont.Define C=E[e1(k)2 + e2(k)2 + ... + eL(k)2]L ≥M, otherwise an overdetermined solution resultsChoose L (number of error sensors) very large, especially for acoustic control in order to get representative energy of systemMust identify L·M control path transfer functionsWeight update for each of the M filters depends on all L error signals and L filtered-x signals as
MikgkxkekwkwL
jijcjii ,...2,1 ,)(*)()(2)()1(
1, =−=+ ∑
=
μ
Principle Component LMS (PCLMS)Principal Component LMS (PC-LMS) Algorithm for Control:
Perform SVD to decouple each control channel
Gc = V S UH
Compute control signals and update compensator, ν(k), in PC's and convert back to physical coordinates before sending out of dig. sig. proc. (DSP) board
Gc = U S VH (SVD)
ζ(k) = UH e(k) (PC - error)
ν(k) = VH w(k) (PC-filter coefficient)
Adaptive Control Using PC-LMS, cont.
Limited to single and multifrequency control, since Gc(z) is represented as a matrix of complex numbers at each frequencyAfter SVD, find 2-coefficient FIR filters for V and UH
Less computationally intensive than FXLMSCan easily incorporate control effort penalties into the
weight update (like LQR control)
Obtaining the Coherent Reference Signal
Use optical encoded disk Tachometer Directional mics (duct)
FB removal techniques (filtering, phase-locked loop devices)
Sometimes reference is filtered by other dynamics, but still coherent with disturbance
Internally generate deterministic signalsUse an “upstream” sensor with little feedback
Obtaining the Coherent Reference Signal
jω
Active Vibration Isolation Problem:
e(k)
x(k)*href(k)
minimize e(k) tostop the base from
movingbase
"filtered" referencesignal
ground
Feedforward System Control with filtered ref. sig.
Gd(z)
W(z)
+
+
x(k),input
e(k)
y(k)
•Requires knowledge of Gc(z) to update adaptive filter, W(z)
Gc(z)
Href(z)
Plant
Coherent Ref. Signal
)()()()()(,0)( As
zGzHzGzWzWke
cref
dopt =→→
Uses for Adaptive Signal Processing, cont.
Other Issues for Active ControlStability of adaptive algorithmsRobust stability of controlled plantRobust performance and reliabilityCost/benefitTake advantage of existing infrastructure (e.g. car audio systems)?Control is often only as good as your model and your algorithm and your transducers and ...