38
6.003: Signal Processing Superposition and Convolution y[n]=(h x)[n]= m h[m]x[n m] 6 October 2020

Superposition and Convolution

  • Upload
    others

  • View
    14

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Superposition and Convolution

6.003: Signal Processing

Superposition and Convolution

y[n] = (h ∗ x)[n] =�

m

h[m]x[n − m]

6 October 2020

Page 2: Superposition and Convolution

Systems

So far, we have focused our attention on signals and their math-

ematical representations. However, we are often also interested in

manipulating signals. To this end, we introduce the notion of a

system (or filter).

systemsignal

in

signal

out

Examples:

• audio enhancement: equalization, noise reduction, reverberation,

echo cancellation, pitch shift (auto-tune)

• image enhancement: smoothing, edge enhancement, unsharp

masking, feature detection

• video enhancement: image stabilization, motion magnification

Page 3: Superposition and Convolution

Representations of Signals

Characterize systems by their input/output relationships.

systemsignal

in

signal

out

Difference Equation: represent system by algebraic constraints on

samples

Convolution: represent system by its unit sample response

Filter: represent system as amplfication/attentuation of frequency

components

Page 4: Superposition and Convolution

Linearity

A system is linear if its response to a weighted sum of inputs is

equal to the weighted sum of its responses to each of the inputs.

Given

systemx1[n] y1[n]

and

systemx2[n] y2[n]

the system is linear if

systemαx1[n] + βx2[n] αy1[n] + βy2[n]

is true for all α and β and all possible inputs.

A system is linear if it is both additive and homogeneous.

Page 5: Superposition and Convolution

Time-Invariance

A system is time-invariant if delaying the input to the system simply

delays the output by the same amount of time.

Given

systemx[n] y[n]

the system is time invariant if

systemx[n−n0] y[n−n0]

is true for all n0 and for all possible inputs.

Page 6: Superposition and Convolution

Unit Sample Response

If a system is linear and time-invariant, its input-output relation is

completely specified by the system’s unit sample response h[n].

systemx[n] y[n]

The unit sample response h[n] is the output of the system when the

input is the unit sample signal δ[n].

systemδ[n] h[n]

The output for more complicated inputs can be computed by sum-

ming scaled and shifted versions of the unit sample response.

Page 7: Superposition and Convolution

Superposition

Consider the following signal:

x[n] =

1 if n = 0−1 if n = 3−2 if n = 40 otherwise

This signal can be represented as:

x[n] = δ[n] − δ[n − 3] − 2δ[n − 4]

In general, we can represent a signal as a sum of scaled, shifted

deltas:

x[n] =∞�

m=−∞x[m]δ[n − m]

= . . . + x[−1]δ[n + 1] + x[0]δ[n] + x[1]δ[n − 1] + x[2]δ[n − 2] + . . .

Page 8: Superposition and Convolution

Superposition

In general, we can represent a signal as a sum of scaled, shifted

deltas:

x[n] =∞�

m=−∞x[m]δ[n − m]

= . . . + x[−1]δ[n + 1] + x[0]δ[n] + x[1]δ[n − 1] + x[2]δ[n − 2] + . . .

If h[·] is the unit sample response of an LTI system, then the output

of that system in response to this arbitrary input x[·] can be viewed

as a sum of scaled, shifted unit sample responses:

y[n] =∞�

m=−∞x[m]h[n − m]

= . . . + x[−1]h[n + 1] + x[0]h[n] + x[1]h[n − 1] + x[2]h[n − 2] + . . .

Page 9: Superposition and Convolution

Structure of Superposition

If a system is linear and time-invariant (LTI) then its output is the

sum of weighted and shifted unit sample responses.

systemδ[n] h[n]

systemδ[n − m] h[n − m]

systemx[m]δ[n − m] x[m]h[n − m]

systemx[n] =∞�

m=−∞x[m]δ[n − m] y[n] =

∞�

m=−∞x[m]h[n − m]

Page 10: Superposition and Convolution

Superposition by Example

Consider an LTI system described by y[n] = 3x[n] − x[n − 1]. Compute

the response of this system to an input x[·] given by:

x[n] = 2δ[n − 1] + 5δ[n − 2] + 3δ[n − 4]

Page 11: Superposition and Convolution

Convolution

Response of an LTI system to an arbitrary input.

LTIx[n] y[n]

y[n] =∞�

m=−∞x[m]h[n − m] ≡ (x ∗ h)[n]

This operation is called convolution (verb form: convolve).

Page 12: Superposition and Convolution

Convolution

Convolution is represented with an asterisk.∞�

m=−∞x[m]h[n − m] ≡ (x ∗ h)[n]

Convolution operates on signals, not samples.

The symbols x and h represent DT signals.

Convolving x with h generates a new DT signal x ∗ h.

Page 13: Superposition and Convolution

DT Convolution: Summary

Unit sample response h[n] is a complete description of an LTI system.

h[n]x[n] y[n]

Given h[·], we can compute the response y[·] to any input x[·] by

convolving x[·] and h[·]:

y[n] = (x ∗ h)[n] ≡∞�

m=−∞x[m]h[n − m]

Page 14: Superposition and Convolution

Discrete-Time Example: Solera Process

Aging and blending wines from different crops.

Start with 3 barrels of wine: newest at left, oldest at right.

−1 −2 −3

Page 15: Superposition and Convolution

Discrete-Time Example: Solera Process

Aging and blending wines from different crops.

Sell half of the oldest stock.

−1 −2 −3

−3sell

Page 16: Superposition and Convolution

Discrete-Time Example: Solera Process

Aging and blending wines from different crops.

Refill oldest barrel from next-to-oldest barrel.

−1 −2−2−3

−3sell

Page 17: Superposition and Convolution

Discrete-Time Example: Solera Process

Aging and blending wines from different crops.

Refill next-to-oldest barrel from youngest barrel.

−1−1−2

−2−3

−3sell

Page 18: Superposition and Convolution

Discrete-Time Example: Solera Process

Aging and blending wines from different crops.

Refill youngest barrel with this year’s harvest.

0 0−1

−1−2

−2−3

−3sell

Page 19: Superposition and Convolution

Discrete-Time Example: Solera Process

Aging and blending wines from different crops.

Old and new contents mix; ready for next year.

0−1

−1−2

−2−3

Page 20: Superposition and Convolution

Discrete-Time Example: Solera Process

Aging and blending wines from different crops.

Old and new contents mix; ready for next year.

0−1

−1−2

−2−3

Properties of solera process:

• Mixing produces a more uniform product.

• Mitigates worst-case results of one bad year.

• Blends wines from MANY previous years.

Page 21: Superposition and Convolution

Solera Analysis

We can analyze these effects with a tracer experiment.

Add 1 unit of tracer to new crop; track tracer through the system.

1 0 0year 0

12

12 0year 1

14

12

14year 2

How much tracer will be in each barrel at the end of year 3?

Page 22: Superposition and Convolution

Solera Analysis

Add 1 unit of tracer to new crop; track tracer through the system.

Year Tracer in Barrel Barrel Barrel Tracer outn x[n] #1 #2 #3 y[n]0 1 1 0 0 01 0 1/2 1/2 0 02 0 1/4 2/4 1/4 03 0 1/8 3/8 3/8 1/84 0 1/16 4/16 6/16 3/165 0 1/32 5/32 10/32 6/326 0 1/64 6/64 15/64 10/64

1

n

x[n]3/16

n

y[n]

Page 23: Superposition and Convolution

Solera Analysis

How would results change if tracer were added in year 1 (not 0)?

Original response:

1

n

x[n]3/16

n

y[n]

Delayed input → delayed output:

1

n

x[n − 1]3/16

n

y[n − 1]

Delaying the input by a year simply delays the outputs by one year.

Page 24: Superposition and Convolution

Time-Invariance

A system is time-invariant if delaying the input to the system simply

delays the output by the same amount of time.

Given

systemx[n] y[n]

the system is time invariant if

systemx[n − n0] y[n − n0]

is true for all n0.

Page 25: Superposition and Convolution

Solera Analysis

Scaling the input amplitudes:

1

n

0.5x[n]3/16

n

0.5y[n]

Adding two inputs:

1

n

x[n] + x[n − 6]3/16

n

y[n] + y[n − 6]

Linearly combining two inputs:

1

n

x[n] + 0.5x[n − 6]3/16

n

y[n] + 0.5y[n − 6]

Page 26: Superposition and Convolution

Linearity

A system is linear if its response to a weighted sum of inputs is equal

to the weighted sum of its responses to each of the inputs.

Given

systemx1[n] y1[n]

and

systemx2[n] y2[n]

the system is linear if

systemαx1[n] + βx2[n] αy1[n] + βy2[n]

is true for all α and β.

Page 27: Superposition and Convolution

Convolution

If a system is linear and time invariant, the response to an arbitrary

input is the convolution of that input with the unit-sample response.

systemδ[n] h[n]

systemδ[n − m] h[n − m]

systemx[k]δ[n − m] x[k]h[n − m]

systemx[n] =∞�

m=−∞x[k]δ[n − m] y[n] =

∞�

m=−∞x[k]h[n − m]

Page 28: Superposition and Convolution

Check Yourself

For solera process ...

Year Tracer in Barrel Barrel Barrel Tracer outn x[n] #1 #2 #3 y[n]0 1 1 0 0 01 0 1/2 1/2 0 02 0 1/4 2/4 1/4 03 0 1/8 3/8 3/8 1/84 0 1/16 4/16 6/16 3/165 0 1/32 5/32 10/32 6/326 0 1/64 6/64 15/64 10/64

How much tracer would be found in output from year 5,

if one unit of tracer is added in years 0, 1, and 2?

1. 2132 2. 1

2 3. 316 4. 9

16 5. none of above

Page 29: Superposition and Convolution

Divide and Conquer

The content of barrel #3 has no direct dependence on barrel #1.

The new content of barrel #3 depends only on itself and barrel #2.

All dependence on barrel #1 is through barrel #2.

1 0 0year 0

12

12 0year 1

14

12

14year 2

Since barrel #3 depends only on barrel #2, and barrel #2 depends

only on barrel #1, the three barrel system is equivalent to the cas-

cade of three one barrel systems!

Page 30: Superposition and Convolution

Divide and Conquer

Making a three-barrel system by cascading three one-barrel systems.

3-barrelsolera

x[n] y[n]

Year Tracer in Barrel Barrel Barrel Tracer outn x[n] = δ[n] #1 #2 #3 y[n] = h3[n]0 1 1 0 0 01 0 1/2 1/2 0 02 0 1/4 2/4 1/4 03 0 1/8 3/8 3/8 1/84 0 1/16 4/16 6/16 3/165 0 1/32 5/32 10/32 6/326 0 1/64 6/64 15/64 10/64

1

n

x[n] = δ[n]3/16

n

y[n] = h3[n]

Page 31: Superposition and Convolution

Divide and Conquer

Find the unit-sample response h1[n] for a 1-barrel solera.

1-barrelsolera

1-barrelsolera

1-barrelsolera

x[n] y[n]

Page 32: Superposition and Convolution

Divide and Conquer

Find the unit-sample response h1[n] for a 1-barrel solera.

1-barrelsolera

x[n] h1[n]

Page 33: Superposition and Convolution

Divide and Conquer

How can we use this to find h2[n] (output of a two-barrel system)?

Page 34: Superposition and Convolution
Page 35: Superposition and Convolution

Divide and Conquer

How can we use this to find h3[n] (output of a three-barrel system)?

Page 36: Superposition and Convolution
Page 37: Superposition and Convolution
Page 38: Superposition and Convolution