37
GCT535: Sound Technology for Multimedia Fundamentals of DSP - Part 1 Juhan Nam

Fundamentals of DSP -Part 1 - KAIST

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Fundamentals of DSP -Part 1 - KAIST

GCT535: Sound Technology for Multimedia

Fundamentals of DSP - Part 1

Juhan Nam

Page 2: Fundamentals of DSP -Part 1 - KAIST

Goals

โ— Introducing digital audio effects

โ— The fundamentals of digital signal processingโ—‹ Linear time-invariant (LTI) systemโ—‹ FIR / IIR Filtersโ—‹ Convolutionโ—‹ Impulse responseโ—‹ Frequency response

Page 3: Fundamentals of DSP -Part 1 - KAIST

Introduction

โ— Once we record or synthesize sound, we modify the acoustic characteristics using various digital audio effects โ—‹ Loudness: volume, compressor, limiter, noise gateโ—‹ Timbre: filters, equalizer, distortion, modulation, chorus, flanger, vocoderโ—‹ Pitch: pitch correction, harmonizer, vibratoโ—‹ Duration: time scale modification, resampling โ—‹ Spatial effect: panning, delay, reverberation, binaural (HRTF)

Input OutputDigital Audio Effects

Page 4: Fundamentals of DSP -Part 1 - KAIST

Introduction

โ— Filters and delaysโ—‹ Bi-quads filters: lowpass, bandpass, highpass, equalizersโ—‹ Comb filter (delayline): delay/echo, chorus, flanger, reverbโ—‹ Convolution: resampling, HRTF, reverberation (measured impulse responses)

โ— Non-linear processingโ—‹ Modulation: amplitude, frequencyโ—‹ Distortion and dynamic range control: compressor, limiter, noise gate

โ— Block-based processingโ—‹ Pitch shifting and Time-scale modification

Page 5: Fundamentals of DSP -Part 1 - KAIST

Filters and Delays

โ— Take the input signal ๐‘ฅ ๐‘› as a sequence of numbers and returns the output signal ๐‘ฆ ๐‘› as another sequence of numbers

โ— Perform a combination of three mathematic operations upon the inputโ—‹ Multiplication: ๐‘ฆ ๐‘› = ๐‘ % ๐‘ฅ ๐‘›โ—‹ Delay: ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› โˆ’๐‘€โ—‹ Summation: ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + ๐‘Ž % ๐‘ฆ ๐‘› โˆ’ ๐‘€

Input OutputFiltersor Delays

๐‘ฅ ๐‘› ๐‘ฆ ๐‘›

Page 6: Fundamentals of DSP -Part 1 - KAIST

Filters and Delays

โ— Bi-quad filterโ—‹ Two delay elements for input or outputโ—‹ The delayed output (โ€œfeedbackโ€) causes resonanceโ—‹ Rooted from analog circuits (R-L-C)

๐‘ง!"

๐‘ฅ ๐‘› +

๐‘ง!" ๐‘"

๐‘#

๐‘$

๐‘ฅ ๐‘› โˆ’ 1

๐‘ฅ ๐‘› โˆ’ 2

๐‘ง!"

๐‘ฆ ๐‘›

๐‘ง!"-๐‘Ž"

-๐‘Ž#

๐‘ฆ ๐‘› โˆ’ 1

๐‘ฆ ๐‘› โˆ’ 2

๐‘ฆ ๐‘› = ๐‘$ + ๐‘ฅ ๐‘› + ๐‘" + ๐‘ฅ ๐‘› โˆ’ 1 + ๐‘# + ๐‘ฅ ๐‘› โˆ’ 2 โˆ’ ๐‘Ž" + ๐‘ฆ ๐‘› โˆ’ 1 โˆ’ ๐‘Ž# + ๐‘ฆ ๐‘› โˆ’ 2

Page 7: Fundamentals of DSP -Part 1 - KAIST

Filters and Delays

โ— Comb filterโ—‹ Use a delayline โ—‹ Feedforward is used for chorus/flanger and feedback is for echo/reverbโ—‹ Rooted from magnetic tape recording

๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + ๐‘” + ๐‘ฅ ๐‘› โˆ’ ๐‘€

๐‘ง!%

๐‘ฅ ๐‘› ๐‘ฆ ๐‘›+

Feedforward Comb Filter

๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + ๐‘” + ๐‘ฆ(๐‘› โˆ’ ๐‘)

๐‘ง!&

๐‘ฅ ๐‘› ๐‘ฆ ๐‘›+

๐‘”

Feedback Comb Filter

๐‘”

Page 8: Fundamentals of DSP -Part 1 - KAIST

Filters and Delays

โ— Convolution filterโ—‹ Conduct the convolution operation with an impulse response of a systemโ—‹ The impulse response is often measured from natural objects

โ–  HRTF: human ears โ–  Reverberation: rooms

๐‘ฆ ๐‘› = ๐‘$ + ๐‘ฅ ๐‘› + ๐‘" + ๐‘ฅ ๐‘› โˆ’ 1 + ๐‘# + ๐‘ฅ ๐‘› โˆ’ 2 +โ‹ฏ+ ๐‘% + ๐‘ฅ ๐‘› โˆ’ ๐‘€

โ„Ž(๐‘›)= [๐‘$, ๐‘", ๐‘#โ€ฆ , ๐‘%]

Page 9: Fundamentals of DSP -Part 1 - KAIST

Linear Time-Invariant Filters

โ— They are called Linear Time-Invariant (LTI) filters in the context of digital signal processing

โ— Linearityโ—‹ Scaling: if ๐‘ฅ ๐‘› โ†’ ๐‘ฆ ๐‘› , then a % ๐‘ฅ ๐‘› โ†’ a % ๐‘ฆ ๐‘›โ—‹ Superposition: if ๐‘ฅ! ๐‘› โ†’ ๐‘ฆ! ๐‘› and ๐‘ฅ" ๐‘› โ†’ ๐‘ฆ" (n), then ๐‘ฅ! ๐‘› + ๐‘ฅ" ๐‘› โ†’

๐‘ฆ! ๐‘› + ๐‘ฆ" ๐‘›

โ— Time-Invarianceโ—‹ If ๐‘ฅ ๐‘› โ†’ ๐‘ฆ ๐‘› , then ๐‘ฅ ๐‘› โˆ’ ๐‘ โ†’ ๐‘ฆ ๐‘› โˆ’ ๐‘ for any ๐‘โ—‹ This means that the system does not change its behavior over time

Page 10: Fundamentals of DSP -Part 1 - KAIST

Linear Time-Invariant Filters

โ— Non-linear filtersโ—‹ ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› "

โ— Time-variant filtersโ—‹ ๐‘ฆ ๐‘› = ๐‘› % ๐‘ฅ ๐‘› + ๐‘ฅ(๐‘› โˆ’ 1)

โ— Modulation โ—‹ Amplitude or frequency modulation generates new sinusoidal components

โ— Dynamic range compressionโ—‹ Input gain is a function of the input: ๐‘ฆ ๐‘› = ๐‘“(๐‘ฅ ๐‘› ) % ๐‘ฅ ๐‘›

Page 11: Fundamentals of DSP -Part 1 - KAIST

Linear Time-Invariant System

โ— Remember that sinusoids are eigenfunctions of linear systemโ—‹ The input sinusoids changes in amplitude and phase while preserving the

same frequencyโ—‹ No new sinusoidal components are created

LinearSystem

๐‘’#$%๐ด(๐œ”)๐‘’#&($)๐‘’#$%

Amplitude Response

Phase Response

Page 12: Fundamentals of DSP -Part 1 - KAIST

The Simplest Lowpass Filter

โ— Difference equation: ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + ๐‘ฅ(๐‘› โˆ’ 1)

โ— Signal flow graph

๐‘ง!"

๐‘ฅ ๐‘› ๐‘ฆ ๐‘›+

โ€œDelay Operatorโ€

Page 13: Fundamentals of DSP -Part 1 - KAIST

The Simplest Lowpass Filter: Sine-Wave Analysis

โ— Measure the amplitude and phase changes given a sinusoidal signal input

Page 14: Fundamentals of DSP -Part 1 - KAIST

The Simplest Lowpass Filter: Frequency Response

โ— Plot the amplitude and phase change over different frequencyโ—‹ The frequency sweeps from 0 to the Nyquist rate

Page 15: Fundamentals of DSP -Part 1 - KAIST

The Simplest Lowpass Filter: Frequency Response

โ— Mathematical approachโ—‹ Use complex sinusoid as input: ๐‘ฅ ๐‘› = ๐‘’#$)

โ—‹ Then, the output is: ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + ๐‘ฅ ๐‘› โˆ’ 1 = ๐‘’#$) + ๐‘’#$()*!) = 1 + ๐‘’*#$ % ๐‘’#$)

= 1 + ๐‘’*#$ % ๐‘ฅ(๐‘›)

โ—‹ Frequency response: ๐ป ๐œ” = 1 + ๐‘’*#$ = ๐‘’#!" + ๐‘’*#

!" ๐‘’*#

!" = 2cos($

")๐‘’*#

!"

โ—‹ Amplitude response: ๐ป(๐œ”) = 2 cos $"

โ—‹ Phase response: โˆ ๐ป ๐œ” = โˆ’$"

Page 16: Fundamentals of DSP -Part 1 - KAIST

The Simplest Highpass Filter

โ— Difference equation: ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› โˆ’ ๐‘ฅ(๐‘› โˆ’ 1)

โ— Signal flow graph

๐‘ง!"

๐‘ฅ ๐‘› +

โˆ’1

๐‘ฆ ๐‘›

Page 17: Fundamentals of DSP -Part 1 - KAIST

The Simplest Highpass Filter: Frequency Response

โ— Plot the amplitude and phase change over different frequencyโ—‹ The frequency sweeps from 0 to the Nyquist rate

Page 18: Fundamentals of DSP -Part 1 - KAIST

Finite Impulse Response (FIR) System

โ— Difference equation๐‘ฆ ๐‘› = ๐‘+ % ๐‘ฅ ๐‘› + ๐‘! % ๐‘ฅ ๐‘› โˆ’ 1 + ๐‘" % ๐‘ฅ ๐‘› โˆ’ 2 +โ‹ฏ+ ๐‘, % ๐‘ฅ ๐‘› โˆ’ ๐‘€

โ— Signal flow graph

๐‘ง!"

๐‘ฅ ๐‘› +

๐‘ง!"

๐‘ง!"

...

๐‘"

๐‘#

๐‘$

๐‘%

๐‘ฅ ๐‘› โˆ’ 1

๐‘ฅ ๐‘› โˆ’ 2

๐‘ฅ ๐‘› โˆ’๐‘€

๐‘ฆ ๐‘›

Page 19: Fundamentals of DSP -Part 1 - KAIST

Impulse Response

โ— The system output when the input is a unit impulseโ—‹ ๐‘ฅ ๐‘› = ๐›ฟ ๐‘› = 1, 0, 0, 0, โ€ฆ โ†’ ๐‘ฆ ๐‘› = โ„Ž(๐‘›)= [๐‘+, ๐‘!, ๐‘"โ€ฆ , ๐‘,] (for FIR

system)

โ— Characterizes the digital system as a sequence of numbersโ—‹ A system is represented just like audio samples!

๐‘ฅ ๐‘› = ๐›ฟ ๐‘› ๐‘ฆ ๐‘› = โ„Ž(๐‘›)โ„Ž ๐‘›

Input OutputLTISystem

Page 20: Fundamentals of DSP -Part 1 - KAIST

Examples: Impulse Response

โ— The simplest lowpass filterโ—‹ h ๐‘› = 1, 1

โ— The simplest highpass filterโ—‹ h ๐‘› = 1,โˆ’1

โ— Moving-average filter (order=5)

โ—‹ h ๐‘› = !-, !-, !-, !-, !-

Page 21: Fundamentals of DSP -Part 1 - KAIST

Convolution

โ— The output of LTI digital filters is represented by the convolution operation between ๐‘ฅ ๐‘› and โ„Ž ๐‘›

โ— Examplesโ—‹ The simplest lowpass filter โ—‹ ๐‘ฆ ๐‘› = 1, 1 โˆ— ๐‘ฅ ๐‘› = 1 % ๐‘ฅ(๐‘›) + 1 % ๐‘ฅ(๐‘› โˆ’ 1) = ๐‘ฅ ๐‘› + ๐‘ฅ(๐‘› โˆ’ 1)

๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› โˆ— โ„Ž ๐‘› = :'(!)

)

๐‘ฅ ๐‘– + โ„Ž ๐‘› โˆ’ ๐‘– = :'(!)

)

โ„Ž(๐‘–) + ๐‘ฅ(๐‘› โˆ’ ๐‘–)

This is more practical expression when the input is an audio streaming

Page 22: Fundamentals of DSP -Part 1 - KAIST

Proof: Convolution

โ— Method 1โ—‹ The input is represented as the sum of weighted and delayed impulses units

โ–  ๐‘ฅ ๐‘› = ๐‘ฅ$, ๐‘ฅ", ๐‘ฅ#โ€ฆ , ๐‘ฅ% = ๐‘ฅ$ + ๐›ฟ ๐‘› + ๐‘ฅ" + ๐›ฟ ๐‘› โˆ’ 1 + ๐‘ฅ# + ๐›ฟ ๐‘› โˆ’ 2 +โ‹ฏ+ ๐‘ฅ% +๐›ฟ ๐‘› โˆ’ ๐‘€

โ—‹ By the linearity and time-invariance โ–  ๐‘ฆ ๐‘› = ๐‘ฅ$ + โ„Ž ๐‘› + ๐‘ฅ" + โ„Ž ๐‘› โˆ’ 1 + ๐‘ฅ# + โ„Ž ๐‘› โˆ’ 2 +โ‹ฏ+ ๐‘ฅ% + โ„Ž ๐‘› โˆ’ ๐‘€ =

โˆ‘'($% ๐‘ฅ(๐‘–) + โ„Ž(๐‘› โˆ’ ๐‘–)

Page 23: Fundamentals of DSP -Part 1 - KAIST

Proof: Convolution

โ— Method 2โ—‹ The impulse response can be represented as a set of weighted impulses

โ–  โ„Ž ๐‘› = ๐‘$, ๐‘", ๐‘#โ€ฆ , ๐‘% = ๐‘$ + ๐›ฟ ๐‘› + ๐‘" + ๐›ฟ ๐‘› โˆ’ 1 + ๐‘# + ๐›ฟ ๐‘› โˆ’ 2 +โ‹ฏ+ ๐‘% +๐›ฟ ๐‘› โˆ’ ๐‘€

โ—‹ By the linearity, the distributive property and ๐‘ฅ ๐‘› โˆ— ๐›ฟ ๐‘› โˆ’ ๐‘˜ = ๐‘ฅ(๐‘› โˆ’ ๐‘˜)โ–  ๐‘ฆ ๐‘› = ๐‘$ + ๐‘ฅ ๐‘› + ๐‘" + ๐‘ฅ ๐‘› โˆ’ 1 + ๐‘# + ๐‘ฅ ๐‘› โˆ’ 2 +โ‹ฏ+ ๐‘% + ๐‘ฅ ๐‘› โˆ’ ๐‘€ =

โˆ‘'($% โ„Ž(๐‘–) + ๐‘ฅ(๐‘› โˆ’ ๐‘–)

Page 24: Fundamentals of DSP -Part 1 - KAIST

Properties of Convolution

โ— Commutative: ๐‘ฅ ๐‘› โˆ— โ„Ž" ๐‘› โˆ— โ„Ž# ๐‘› = ๐‘ฅ ๐‘› โˆ— โ„Ž# ๐‘› โˆ— โ„Ž" ๐‘›

โ— Associative: (๐‘ฅ ๐‘› โˆ— โ„Ž" ๐‘› ) โˆ— โ„Ž# ๐‘› = ๐‘ฅ ๐‘› โˆ— (โ„Ž" ๐‘› โˆ— โ„Ž# ๐‘› )

โ— Distributive: ๐‘ฅ ๐‘› โˆ— โ„Ž" ๐‘› + โ„Ž# ๐‘› = ๐‘ฅ ๐‘› โˆ— โ„Ž" ๐‘› + ๐‘ฅ ๐‘› โˆ— โ„Ž# ๐‘›

Page 25: Fundamentals of DSP -Part 1 - KAIST

Example: Convolution

โ— Given ๐‘ฅ ๐‘› = ๐‘ฅ$, ๐‘ฅ", ๐‘ฅ#, โ€ฆ , ๐‘ฅ% and โ„Ž ๐‘› = โ„Ž$, โ„Ž", โ„Ž#โ—‹ ๐‘ฆ ๐‘› = โˆ‘./+, โ„Ž(๐‘–) % ๐‘ฅ(๐‘› โˆ’ ๐‘–)โ—‹ ๐‘ฆ 0 = โ„Ž(0) 0 ๐‘ฅ(0)โ—‹ ๐‘ฆ 1 = โ„Ž 0 0 ๐‘ฅ 1 + โ„Ž(1) 0 ๐‘ฅ(0)โ—‹ ๐‘ฆ 2 = โ„Ž 0 0 ๐‘ฅ 2 + โ„Ž 1 0 ๐‘ฅ 1 + โ„Ž 2 0 ๐‘ฅ 0โ—‹ ๐‘ฆ 3 = โ„Ž 0 0 ๐‘ฅ 3 + โ„Ž 1 0 ๐‘ฅ 2 + โ„Ž 2 0 ๐‘ฅ 1โ—‹ ๐‘ฆ 4 = โ„Ž 0 0 ๐‘ฅ 4 + โ„Ž 1 0 ๐‘ฅ 3 + โ„Ž 2 0 ๐‘ฅ 2โ—‹ ๐‘ฆ 5 = โ„Ž 0 0 ๐‘ฅ 5 + โ„Ž 1 0 ๐‘ฅ 4 + โ„Ž 2 0 ๐‘ฅ 3โ—‹ ๐‘ฆ 6 = โ„Ž 1 0 ๐‘ฅ 5 + โ„Ž 2 0 ๐‘ฅ 4โ—‹ ๐‘ฆ 7 = โ„Ž 2 0 ๐‘ฅ 5

โ— The size of transient region is equal to the number of delay operators

โ— If the length of ๐‘ฅ ๐‘› is ๐‘€ and the length of โ„Ž ๐‘› is ๐‘, then the length of ๐‘ฆ ๐‘› is ๐‘€ +๐‘ โˆ’ 1.

Transient state

Steady state

Transient state

Page 26: Fundamentals of DSP -Part 1 - KAIST

Demo: Convolution

Page 27: Fundamentals of DSP -Part 1 - KAIST

Example: Convolution Reverb

โ— Convolution Reverb

Room Impulse Response

Lobby

Church

Page 28: Fundamentals of DSP -Part 1 - KAIST

A Simple Feedback Lowpass Filter

โ— Difference equation: ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + ๐‘Ž 3 ๐‘ฆ(๐‘› โˆ’ 1)

โ— Signal flow graphโ—‹ When ๐‘Ž is slightly less than 1, it is called โ€œLeaky Integratorโ€

๐‘ง!"

๐‘ฅ ๐‘› ๐‘ฆ ๐‘›+

๐‘Ž

Page 29: Fundamentals of DSP -Part 1 - KAIST

A Simple Feedback Lowpass Filter: Impulse Response

โ— Impulse response: exponential decaysโ—‹ ๐‘ฆ 0 = ๐‘ฅ 0 = 1โ—‹ ๐‘ฆ 1 = ๐‘ฅ 1 + ๐‘Ž % ๐‘ฆ 0 = ๐‘Žโ—‹ ๐‘ฆ 2 = ๐‘ฅ 2 + ๐‘Ž % ๐‘ฆ 1 = ๐‘Ž"

โ—‹ ๐‘ฆ 3 = ๐‘ฅ 3 + ๐‘Ž % ๐‘ฆ 2 = ๐‘Ž"

โ—‹ โ€ฆ

โ— Stability Issue! โ—‹ If ๐‘Ž < 1, the filter output converges (stable)โ—‹ If ๐‘Ž = 1, the filter output oscillates (critical)โ—‹ If ๐‘Ž > 1, the filter output diverges (unstable)

โ„Ž(๐‘›)=[1, ๐‘Ž, ๐‘Ž#, ๐‘Ž*, โ€ฆ ]

Page 30: Fundamentals of DSP -Part 1 - KAIST

A Simple Feedback Lowpass Filter: Sine-Wave Analysis

โ— Measure the amplitude and phase changes given a sinusoidal signal input

๐‘Ž = 0.9

Transient state Steady state Transient state

Page 31: Fundamentals of DSP -Part 1 - KAIST

A Simple Feedback Lowpass Filter: Frequency Response

โ— More dramatic change than the simplest lowpass filter (FIR)โ—‹ Phase response is not linear

๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + 0.9 0 ๐‘ฆ(๐‘› โˆ’ 1)

Page 32: Fundamentals of DSP -Part 1 - KAIST

A Simple Feedback Lowpass Filter: Frequency Response

โ— Mathematical approachโ—‹ Use complex sinusoid as input: ๐‘ฅ ๐‘› = ๐‘’#$)

โ—‹ ๐‘ฆ ๐‘› = ๐บ ๐œ” ๐‘’#($)01 $ ) ร  ๐‘ฆ ๐‘› โˆ’ ๐‘š = ๐‘’*#$2๐‘ฆ ๐‘› for any ๐‘šโ—‹ The output is: ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + ๐‘Ž % ๐‘ฆ(๐‘› โˆ’ 1)

๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + ๐‘Ž % ๐‘’#$๐‘ฆ ๐‘›

โ—‹ Frequency response: ๐ป ๐œ” = !!*345#$!

= !!*34678 $ 034#489: $

โ—‹ Amplitude response: ๐ป(๐œ”) = !(!*34678 $ )"0(3489: $ )"

โ—‹ Phase response: โˆ ๐ป ๐œ” = โˆ’atan( 3489: $!*3 4678 $

)

โ— Note that the this approach is getting complicated

Page 33: Fundamentals of DSP -Part 1 - KAIST

Reson Filter

โ— Difference equationโ—‹ ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + 2๐‘Ÿ % cos(๐œƒ) % ๐‘ฆ ๐‘› โˆ’ 1 โˆ’ ๐‘Ÿ" % ๐‘ฆ ๐‘› โˆ’ 2

โ— Signal flow graph

๐‘ง!"

๐‘ฅ ๐‘› ๐‘ฆ ๐‘›+

2๐‘Ÿ 0 cos๐œƒ+

๐‘ง!"โˆ’๐‘Ÿ#

+

Page 34: Fundamentals of DSP -Part 1 - KAIST

Reson Filter

โ— Mathematical approachโ—‹ Use complex sinusoid as input: ๐‘ฅ ๐‘› = ๐‘’#$)

โ—‹ ๐‘ฆ ๐‘› = ๐บ ๐œ” ๐‘’#($)01 $ ) ร  ๐‘ฆ ๐‘› โˆ’ ๐‘š = ๐‘’*#2$๐‘ฆ ๐‘› for any ๐‘šโ—‹ The output is: ๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + 2๐‘Ÿ % cos(๐œƒ) % ๐‘ฆ ๐‘› โˆ’ 1 โˆ’ ๐‘Ÿ" % ๐‘ฆ ๐‘› โˆ’ 2

๐‘ฆ ๐‘› = ๐‘ฅ ๐‘› + 2๐‘Ÿ % cos(๐œƒ) % ๐‘’#$๐‘ฆ ๐‘› โˆ’ ๐‘Ÿ" % ๐‘’#"$๐‘ฆ ๐‘› โˆ’ 2โ—‹ Frequency response

โ–  ๐ป ๐œ” = !!*";4678(1)45$!0;"45$"!

= !(!*;(678 1 0#489: 1 )5$!)(!*;(678 1 *#489: 1 )5$!)

โ— Now you see that the this approach is getting even more complicated โ—‹ We will introduce more intuitive method to obtain the frequency response

Page 35: Fundamentals of DSP -Part 1 - KAIST

Reson Filter: Frequency Response

โ— Generate resonance at a particular frequency โ—‹ Control the peak height by ๐‘Ÿ and the peak frequency by ๐œƒ

For stability: ๐‘Ÿ < 1

๐‘Ÿ < 1 is getting close to 1

๐œƒ controls the location of the peak

Page 36: Fundamentals of DSP -Part 1 - KAIST

Infinite Impulse Response (IIR) Filters

โ— Difference equationโ—‹ ๐‘ฆ ๐‘› = ๐‘+ % ๐‘ฅ ๐‘› โˆ’ ๐‘Ž! % ๐‘ฆ ๐‘› โˆ’ 1 โˆ’ ๐‘Ž" % ๐‘ฆ ๐‘› โˆ’ 2 โˆ’โ‹ฏโˆ’ ๐‘Ž< % ๐‘ฆ ๐‘› โˆ’ ๐‘

โ— Signal flow graph๐‘ฅ ๐‘› +

๐‘%๐‘ง!"

๐‘ฆ ๐‘›

๐‘ง!"

๐‘ง!"

...

-๐‘Ž"

-๐‘Ž#

-๐‘Ž&

๐‘ฆ ๐‘› โˆ’ 1

๐‘ฆ ๐‘› โˆ’ 2

๐‘ฆ ๐‘› โˆ’ ๐‘

Page 37: Fundamentals of DSP -Part 1 - KAIST

General Form of LTI Filters

โ— Difference equationโ—‹ ๐‘ฆ ๐‘› = ๐‘+ % ๐‘ฅ ๐‘› + ๐‘! % ๐‘ฅ ๐‘› โˆ’ 1 + ๐‘" % ๐‘ฅ ๐‘› โˆ’ 2 + โ€ฆ+ ๐‘, % ๐‘ฅ ๐‘› โˆ’ ๐‘€

โˆ’๐‘Ž! % ๐‘ฆ ๐‘› โˆ’ 1 โˆ’ ๐‘Ž" % ๐‘ฆ ๐‘› โˆ’ 2 โˆ’โ‹ฏโˆ’ ๐‘Ž< % ๐‘ฆ ๐‘› โˆ’ ๐‘

โ— Signal flow graph

๐‘ง!"

๐‘ฅ ๐‘› +

๐‘ง!"

๐‘ง!"

...

๐‘"

๐‘#

๐‘$

๐‘%

๐‘ฅ ๐‘› โˆ’ 1

๐‘ฅ ๐‘› โˆ’ 2

๐‘ฅ ๐‘› โˆ’๐‘€

๐‘ง!"

๐‘ฆ ๐‘›

๐‘ง!"

๐‘ง!"

...

-๐‘Ž"

-๐‘Ž#

-๐‘Ž&

๐‘ฆ ๐‘› โˆ’ 1

๐‘ฆ ๐‘› โˆ’ 2

๐‘ฆ ๐‘› โˆ’ ๐‘