51
On-off Control: Audio Applications Graham C. Goodwin Day 4: Lecture 3 16th September 2004 International Summer School Grenoble, France Centre for Complex Dynamic Systems and Control

On-off Control: Audio Applications...On-off Control: Audio Applications Graham C. Goodwin Day 4: Lecture 3 16th September 2004 International Summer School Grenoble, France Centre for

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

  • On-off Control: Audio Applications

    Graham C. Goodwin

    Day 4: Lecture 3

    16th September 2004

    International Summer SchoolGrenoble, France

    Centre for Complex DynamicSystems and Control

  • 1 Background

    In this lecture we address the issue of control when the decisionvariables must satisfy a finite set constraint.

    Finite alphabet control occurs in many practical situationsincluding: on-off control, relay control, control where quantisationeffects are important (in principle this covers all digital controlsystems and control systems over digital communicationnetworks), and switching control of the type found in powerelectronics.

    Centre for Complex DynamicSystems and Control

  • Exactly the same design methodologies can be applied in otherareas; for example, the following problems can be directlyformulated as finite alphabet control problems:

    quantisation of audio signals for compact disc production;

    design of filters where the coefficients are restricted to belongto a finite set (it is common in digital signal processing to usecoefficients that are powers of two to facilitate implementationissues);

    design of digital-to-analog [D/A] and analog-to-digital [A/D]converters.

    Centre for Complex DynamicSystems and Control

  • 2. Finite Alphabet Control

    Consider a linear system having a scalar input uk and state vectorxk ∈ Rn described by

    xk+1 = Axk + Buk . (1)

    A key consideration here is that the input is restricted to belong tothe finite set

    U = {s1, s2, . . . , snU}, (2)

    where si ∈ R and si < si+1 for i = 1, 2, . . . , nU − 1.

    Centre for Complex DynamicSystems and Control

  • We will formulate the input design problem as a receding horizonquadratic regulator problem with finite set constraints. Thus, giventhe state xk = x, we seek the optimising sequence of present andfuture control inputs:

    u(x) , arg minuk∈UN

    VN(x,uk ), (3)

    where

    uk ,

    ukuk+1...

    uk+N−1

    , UN, U × · · · × U. (4)

    Centre for Complex DynamicSystems and Control

  • VN is the finite horizon quadratic objective function

    VN(x,uk ) , ‖xk+N‖2P +k+N−1∑

    t=k

    (‖xt‖2Q + ‖ut‖

    2R ), (5)

    with Q = Q > 0, P = P > 0, R = R > 0 and where xk = x.

    Centre for Complex DynamicSystems and Control

  • Following the usual receding horizon principle, only the first controlaction, namely

    u(x) ,[

    1 0 · · · 0]

    u(x), (6)

    is applied. At the next time instant, the optimisation is repeatedwith a new initial state and the finite horizon window shifted by one.

    Centre for Complex DynamicSystems and Control

  • 3. Nearest Neighbour Characterisation of the Solution

    Since the constraint set UN is finite, the optimisation problem (3) isnonconvex. Indeed, it is a hard combinatorial optimisation problemwhose solution requires a computation time that is exponential inthe horizon length. Thus, one needs either to use a relatively smallhorizon or to resort to approximate solutions. We will adopt theformer strategy based on the premise that, due to the recedinghorizon technique, the first decision variable is all that is of interest.Moreover, it is a practical observation that this first decisionvariable is often insensitive to increasing the horizon length beyondsome relative modest value.

    Centre for Complex DynamicSystems and Control

  • We vectorise the objective function as follows:Define

    xk ,

    xk+1xk+2...

    xk+N

    , Φ ,

    B 0 . . . 0 0AB B . . . 0 0...

    .... . .

    ......

    AN−1B AN−2B . . . AB B

    , Λ ,

    AA2...

    AN

    ,

    (7)

    Centre for Complex DynamicSystems and Control

  • Given xk = x the predictor xk satisfies

    xk = Φuk + Λx. (8)

    Hence, the objective function can be re-written as

    VN(x,uk ) = V̄N(x) + uk Huk + 2u

    k Fx, (9)

    where

    H , ΦQΦ + R ∈ RN×N , F , ΦQΛ ∈ RN×n,

    Q , diag{Q , . . . ,Q ,P} ∈ RNn×Nn, R , diag{R , . . . ,R} ∈ RN×N ,

    and V̄N(x) does not depend upon uk .

    Centre for Complex DynamicSystems and Control

  • By direct calculation, it follows that the minimiser, without takinginto account any constraints on uk , is

    u

    (x) = −H−1Fx. (10)

    Centre for Complex DynamicSystems and Control

  • Definition: Nearest Neighbour Vector Quantiser

    Given a countable set of nonequal vectors B = {b1, b2, . . . } ⊂ RnB ,the nearest neighbour quantiser is defined as a mappingqB : RnB → B that assigns to each vector c ∈ RnB the closestelement of B (as measured by the Euclidean norm), that is,qB(c) = bi ∈ B if and only if c belongs to the region

    {

    c ∈ RnB : ‖c − bi‖2 ≤ ‖c − bj‖

    2 for all bj , bi , bj ∈ B}

    \{

    c ∈ RnB : there exists j < i such that ‖c − bi‖2= ‖c − bj‖

    2}

    .

    (11)

    Centre for Complex DynamicSystems and Control

  • In order to simplify the problem, we introduce the same coordinatetransformation utilised earlier, that is, the one that turns the costcontours into (hper) spheres.

    ũk = H1/2uk , (12)

    which transforms the constraint set UN into ŨN.

    Centre for Complex DynamicSystems and Control

  • The optimiser u(x) can be defined in terms of this auxiliaryvariable as

    u(x) = H−1/2 arg minũk∈Ũ

    NJN(x, ũk ), (13)

    whereJN(x, ũk ) , ũk ũk + 2ũ

    k H−/2Fx. (14)

    Centre for Complex DynamicSystems and Control

  • The level sets of JN are spheres in RN, centred at

    (x) , −H−/2Fx. (15)

    Centre for Complex DynamicSystems and Control

  • Hence, the constrained optimiser (3) is given by the nearestneighbour to ũ

    (x), namely

    arg minũk∈Ũ

    NJN(x, ũk ) = q

    ŨN (−H−/2Fx). (16)

    Centre for Complex DynamicSystems and Control

  • Summary Theorem: Closed Form Solution

    Let UN = {v1, v2, . . . , vr }, where r = (nU)N. Then the optimiser

    u(x) in (3) is given by

    u(x) = H−1/2qŨ

    N (−H−/2Fx), (17)

    where the nearest neighbour quantiser qŨ

    N (·) maps RN to ŨN,

    defined as

    ŨN, {ṽ1, ṽ2, . . . , ṽr }, ṽi = H

    1/2vi , vi ∈ UN . (18)

    Centre for Complex DynamicSystems and Control

  • The receding horizon controller satisfies

    u(x) =[

    1 0 · · · 0]

    H−1/2qŨ

    N (−H−/2Fx). (19)

    This solution can be illustrated as the composition of the followingtransformations:

    x ∈ Rn−H−

    2 F−−−−−−−→ ũ

    ∈ RN

    H−12 qŨ

    N (·)−−−−−−−−−−→ u ∈ UN

    [1 0 · · · 0]−−−−−−−−−−→ u ∈ U .

    (20)

    Centre for Complex DynamicSystems and Control

  • 4. State Space Partition

    The optimal expression partitions the domain of the quantiser intopolyhedra, called a Voronoi partition.Since the constrained optimiser u(x) is defined in terms ofqŨ

    N (·), an equivalent partition of the state space can be derived.

    Centre for Complex DynamicSystems and Control

  • Theorem

    The constrained optimising sequence u(x) can be characterisedas

    u(x) = vi ⇐⇒ x ∈ Ri ,

    where

    Ri ,{

    z ∈ Rn : 2(vi − vj)Fz ≤ ‖vj‖

    2H − ‖vi‖

    2H for all vj , vi , vj ∈ U

    N}

    \{

    z ∈ Rn : there exists j < i such that 2(vi − vj)Fz = ‖vj‖

    2H − ‖vi‖

    2H

    }

    .

    (21)

    Centre for Complex DynamicSystems and Control

  • 5. Examples: 5.1 Open Loop Stable Plant

    Consider an open loop stable plant described by

    xk+1 =

    [

    0.1 20 0.8

    ]

    xk +

    [

    0.10.1

    ]

    uk , (22)

    and the binary constraint set U = {−1, 1}. The receding horizoncontrol law with R = 0 and

    P = Q =

    [

    1 00 1

    ]

    , (23)

    partitions the state space into the regions depicted in the nextfigure, for constraint horizons N = 2 and N = 3.

    Centre for Complex DynamicSystems and Control

  • −80 −60 −40 −20 0 20 40 60 80

    −0.5

    0

    0.5

    1

    2

    3

    4

    −80 −60 −40 −20 0 20 40 60 80

    −0.5

    0

    0.5

    1

    23

    4

    5

    6

    7

    8

    x1k

    x2k

    x2k

    N = 2

    N = 3

    R

    RR

    R

    R

    RR

    R

    R

    R

    R

    R

    Figure: State space partition for the plant (22).

    Centre for Complex DynamicSystems and Control

  • The receding horizon control law is

    u(x) =

    −1 if x ∈ X1,

    1 if x ∈ X2,

    where

    X1 =⋃

    i=2N−1+1,2N−1+2,...,2N

    Ri , X2 =⋃

    i=1,2,...,2N−1

    Ri .

    Centre for Complex DynamicSystems and Control

  • 5.2 Open Loop Unstable Plant

    Consider

    xk+1 =

    [

    1.02 20 1.05

    ]

    xk +

    [

    0.10.1

    ]

    uk , (24)

    controlled with a receding horizon controller with parameters U, P,Q and R as above. The constraint horizon is chosen to be N = 2.

    Centre for Complex DynamicSystems and Control

  • The following figure illustrates the induced state space partitionand a closed loop trajectory, which starts at x = [−10 0]. As canbe seen, due to the limited control action available, the trajectorybecomes unbounded.

    Centre for Complex DynamicSystems and Control

  • −40 −20 0 20 40 60 80−5

    −4

    −3

    −2

    −1

    0

    1

    2

    1

    2

    3

    4

    x1k

    x2k

    R

    R

    R

    R

    Figure: State trajectories of the controlled plant (24) with initial conditionx = [−10 0].

    Centre for Complex DynamicSystems and Control

  • The situation is entirely different when the initial condition ischosen as x = [0.7 0.2]. As depicted in the following figure, theclosed loop trajectory now converges to a bounded region, whichcontains the origin in its interior. Within that region, the behaviouris not periodic, but appears to be random, despite the fact that thesystem is deterministic. Neighbouring trajectories diverge due tothe action of the unstable poles of the plant. However, the controllaw manifests itself by maintaining the plant state ultimatelybounded.

    Centre for Complex DynamicSystems and Control

  • −1 −0.5 0 0.5 1

    −0.3

    −0.2

    −0.1

    0

    0.1

    0.2

    0.3

    1

    2

    3

    4

    x1k

    x2k

    R

    R

    R

    R

    Figure: State trajectories of the controlled plant (24) with initial conditionx = [0.7 0.2].

    Centre for Complex DynamicSystems and Control

  • Centre for Complex DynamicSystems and Control

    Application: Quantization of Audio Signals

    Modern music recording equipment use digital recording – typically 16 bit:

    Naïve idea:

    Round toQuantized

    LevelsAnalogue Audio

  • Centre for Complex DynamicSystems and Control

    CD Mastering Stations

  • Centre for Complex DynamicSystems and Control

    Audio in Quantizer Quantized Output

    Error Feedback

    Noise Shaping Quantizer

    More Conventional Form (after block diagram manipulation)

  • Centre for Complex DynamicSystems and Control

    Reformulation as Novel Optimization Problem

    H(ρ)

    Incorporation of a perception filter

  • Centre for Complex DynamicSystems and Control

    Design Criterion: Finite Horizon Constrained Optimization

    1 2 ( ).k N

    Nt k

    V e t+ −

    == ∑

    Perception Filter:

    1

    1( ) 1 ,i

    iH hρ ρ

    ∞−

    == + ∑

    then the overall perceived error is given by:

    ( )( ) ( ) ( ) ( ) .e t H a t u tρ= −

  • Centre for Complex DynamicSystems and Control

    Block Optimization

    ( ) ( ) ( 1) ... ( 1) .T

    u k u k u k u k N⎡ ⎤= + + −⎣ ⎦r

    ( ) ( )21

    ( ) ( ) ( ) ( ) .k N

    Nt k

    V u k H a t u tρ+ −

    =

    ⎛ ⎞= −⎜ ⎟

    ⎝ ⎠∑

    r

    ( )*( )

    ( ) arg min ( ) .NNu k Uu k V u k

    ∈=

    r

    r r

    Finite Alphabet

    Define the future quantized audio signals as a vector

    Recall cost function:

    Optimal control (actually the quantized audio)

  • Centre for Complex DynamicSystems and Control

    Recall the Geometry of the Constrained Optimization Problem

    Geometric interpretation of quadratic programming

  • Centre for Complex DynamicSystems and Control

    After a Simple Transformation

    Geometry of finite alphabet optimization as aminimum Euclidean distance problem

  • Centre for Complex DynamicSystems and Control

    Feedback form of the Solution to Finite Alphabet Control Problem

    Convert to State Space

    1( ) 1 ( ) .H C I A Bρ ρ −= + −

    ( )( )

    ( 1) ( ) ( ) ( )

    ( ) ( ) ( ) ( )

    x t Ax t B a t u t

    e t Cx t a t u t

    + = + −

    = + −

  • Centre for Complex DynamicSystems and Control

    Theorem

    Suppose UN = {v1, v2, …,vr}, where r = nUN and H(ρ) has realization as above, then the optimizing sequence is given by:

    where:

    *( )u kr

    ( )* 1( ) ( ) ( )NUu k q a k x k−= Ψ Ψ +Γ%r r

    01 0

    11 1 0

    0 0( )( 1)( ) , , 0

    ( 1) N N

    hCa kCA h ha ka k

    a k N h h hCA − −

    ⎡ ⎤⎡ ⎤⎡ ⎤⎢ ⎥⎢ ⎥⎢ ⎥+= Γ = Ψ = ⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥+ − ⎢ ⎥⎢ ⎥⎣ ⎦ ⎣ ⎦ ⎣ ⎦

    Kr O M

    MM M O OK

  • Centre for Complex DynamicSystems and Control

    Moving Horizon Optimization

    Moving horizonPrinciple, N = 5

  • Centre for Complex DynamicSystems and Control

    Final MHOQ for Audio Quantization

    ( )1( ) [10 0] ( ) ( )NUu k q a k x k−= Ψ Ψ +Γ%r

    K

    Closed form – Vector Quantizer

    MHOQ: Moving Horizon Optimal Quantizer

  • Centre for Complex DynamicSystems and Control

    Special Case: Horizon = 1

    Consider a unitary prediction horizon, i.e. N = 1. With N = 1, H(ρ) reduces to its first element which according to the definitions given above satisfies

    i.e. it is exactly the

    11 ( )H ρ′+

    111 ( ) 1 ( ) ( )C I A B Hρ ρ ρ

    −′+ = + − =H

    Perception Filter

  • Centre for Complex DynamicSystems and Control

    MHOQ with horizon N = 1

    Horizon 1 mpc solution to optimal audio quantization

    Does this appear familiar?

  • Centre for Complex DynamicSystems and Control

    Horizon 1 mpc solution

    The standard noise shaping filter solution (in conventional feedback form)

  • Centre for Complex DynamicSystems and Control

    Key Observation ☺

    Optimization based Audio Quantizer

    Standard Noise Shaping Quantizer for N = 1

    Thus standard noise shaping quantizer is special case of MHOQ.

    ( ) 1( )( )

    HHFρρρ−=

  • Centre for Complex DynamicSystems and Control

    Example

    Psycho-acoustic studies:

    12.245 0.66411 21 1.335 0.644

    ( ) 1H ρρ ρ

    ρ ρ−−−

    − −− += +Perception Filter:

    12.245 0.664111 0.91

    ( )F ρρ

    ρ ρ−−−

    −+=Noise Shaping Filter:

  • Centre for Complex DynamicSystems and Control

    Frequency responses of H and F

  • Centre for Complex DynamicSystems and Control

    Music Quantization = MPC

    Centre for Complex DynamicSystems and Control

  • Centre for Complex DynamicSystems and Control

    Effect of Increasing Horizon

    Mean SquareQuantization

    Error

    Optimization Horizon

  • Centre for Complex DynamicSystems and Control

    Question: Just how well can we do?

    It is interesting to plot the spectrum of the errors due to naïve quantization and the errors arising from the MHOQ (See next figure).

  • Centre for Complex DynamicSystems and Control

    Spectrum of Errors due to Quantization

  • Centre for Complex DynamicSystems and Control

    Observations

    • MHOQ has reduced quantization noise energy in low frequency band.

    • This has resulted in an increase in quantization noise energy at high frequencies.

    • Actually this is in accord with (approximate) Bode integral

    0 1log log

    npjw

    ii

    S e dw pπ π=

    ⎛ ⎞ =⎜ ⎟⎝ ⎠

    ∑∫

    (pi – unstable poles of H i.e. unstable zeros of 1-Fsince ).11 FH −=

    GCG_Day4_3.pdfApplication: Quantization of Audio SignalsCD Mastering StationsReformulation as Novel Optimization ProblemDesign Criterion: Finite Horizon Constrained OptimizationBlock OptimizationRecall the Geometry of the Constrained Optimization ProblemAfter a Simple TransformationFeedback form of the Solution to Finite Alphabet Control ProblemTheoremMoving Horizon OptimizationFinal MHOQ for Audio QuantizationSpecial Case: Horizon = 1MHOQ with horizon N = 1Key Observation ExampleMusic Quantization = MPCEffect of Increasing HorizonQuestion: Just how well can we do?Spectrum of Errors due to QuantizationObservations