Professional Documents
Culture Documents
04 CM0340 DSP
04 CM0340 DSP
JJ
II
J
I
Back
Close
Simple Waveforms
94
95
×
e.g. 0.5
T
-> <-
JJ
II
J
I
Back
Close
Sample Interval and Sample Frequency
• An analog signal, x(t) with signal amplitude continuous over
time, t.
• Following ADC the signal is converted into a a 96
97
The general form of the sine wave we shall use (quite a lot of) is as
follows:
y = A.sin(2π.n.Fw /Fs)
where:
JJ
II
J
I
Back
Close
The Decibel (dB)
When referring to measurements of power or intensity, we express
these in decibels (dB):
99
X
XdB = 10 log10
X0
where:
• X is the actual value of the quantity being measured,
• X0 is a specified or implied reference level,
• XdB is the quantity expressed in units of decibels, relative to X0.
• X and X0 must have the same dimensions — they must measure
the same type of quantity in the the same units. JJ
II
• The reference level itself is always at 0 dB — as shown by setting J
X = X0 (note: log10(1) = 0). I
Back
Close
Why Use Decibel Scales?
• When there is a large range in frequency or magnitude, logarithm
units often used.
• If X is greater than X0 then XdB is positive (Power Increase)
• If X is less than X0 then XdB is negative (Power decrease). 100
XdB = 10 log10(|X(i)2|)
= 20 log10(|X(i)|)
JJ
II
J
I
Back
Close
Decibel and acoustics
• dB is commonly used to quantify sound levels relative to some 0
dB reference.
• The reference level is typically set at the 101
JJ
II
J
I
Back
Close
Examples of dB measurement in Sound
Threshold of Pain : The ratio of sound pressure that causes
permanent damage from short exposure to the limit that
(undamaged) ears can hear is above a million: 102
ways:
• Block v. sample-by-sample processing
Block processing : data is transferred into a memory buffer and
then processed each time the buffer is filled with new data.
JJ
Sample-by-sample processing : input is processed on individual
II
sample data.
J
I
E.g. volume control, envelope shaping, ring modulation. Back
Close
Linear v. Non-linear Time Invariant Systems
A second means of classification:
Linear time invariant system (LTI) : Systems that do not change
behaviour over time and satisfy the superposition theory. The 107
JJ
II
J
I
Back
Close
Impulse Response: Unit Impulse
Unit Impulse:
109
• A very useful test signal for digital systems
• Defined as:
1 if n = 0
δ(n) =
0 otherwise (n 6= 0)
JJ
II
J
I
Back
Close
Impulse Response Definition
If we apply a unit sample (impulse) function to a digital system we
get an output signal y(n) = h(n) 110
• h(n) is called the impulse response of the digital system.
JJ
II
J
I
Back
Close
Impulse Response: Discrete Convolution
If we know the impulse response h(n) of digital system we can
calculate the output signal y(n) for a given x(n) by the discrete
convolution formula: 111
∞
X
y(n) = x(k).h(n − k) = x(n) ∗ h(n)
k=−∞
JJ
II
J
I
Back
Close
Signal Flow Graphs: Delay Example
A delay of the input signal by two sampling intervals:
• We can describe the algorithm by:
114
y(n) = x(n − 2)
• We can use the block diagram to represent the signal flow graph
as:
x(n) T y(n) = x(n − 1) T y(n) = x(n − 2)
JJ
II
x(n) y(n) = x(n − 2) J
I
Back
Close
Signal Flow Graphs: Multiplication
e.g. a = 0.5
JJ
II
J
I
x(n) y(n) = 0.5x(n)
Back
Close
Signal Flow Graphs: Addition
a1 .x1 (n)
a2 .x2 (n)
x1(n) x2(n)
JJ
II
J
I
y(n) = x1(n) + x2(n) Back
Close
Signal Flow Graphs: Complete Example
We can combine all above algorithms to build up more complex
algorithms:
1 1 1
y(n) = x(n) + x(n − 1) + x(n − 2)
2 3 4 118
x(n − 1)
x(n) T T x(n − 2)
1 1 1
× 2 × 3 × 4
JJ
+ II
J
I
y(n) = 12 x(n) + 31 x(n − 1) + 41 x(n − 2)
Back
Close
Signal Flow Graphs: Complete Example Impulse Response
x(n − 1)
x(n) T T x(n − 2)
1 1 1
× 2 × 3 × 4
119
JJ
II
J
I
x(n) y(n) = 21 x(n) + 13 x(n − 1) + 14 x(n − 2)
Back
Close
Transfer Function and Frequency Response
In a similar way to measuring the time domain impulse response
h(n) of a digital system we can measure the frequency domain
response. 120
∞
X
X(eiΩ) = x(n).e−iΩn where Ω = 2πf /fs
n=−∞
JJ
II
Clearly both transforms are related by substitution of z ↔ eiΩ J
I
Note: Will study the Fourier Transform in some detail very soon. Back
Close
Deriving The Transfer Function and
Frequency Response
Given an impulse response h(n) simply apply the Z-Transform:
122
∞
X
H(z) = h(n).z −n
n=−∞
We will look at filtering in the frequency space very soon, but first
we consider Filtering via impulse responses.
y(n)
x(n) +
Example:
• The algorithm is
represented by the T
difference equation:
× y(n − 1) = xH1 (n)
y(n) = x(n)−a1y(n−1)−a2y(n−2)
−a1 T
JJ
• This produces the opposite II
signal flow graph × y(n − 2) = xH2 (n) J
I
−a2
Back
Close
Infinite Impulse Response (IIR)Systems Explained
y(n)
The following happens: x(n) +
• The output signal y(n) is
fed back through a series of 125
delays T
new output.
• Such a feedback system is × y(n − 2) = xH2 (n)
Y (z) 1
H(z) = =
X(z) 1 + a1z −1 + a2z −2
JJ
II
J
I
Back
Close
A Complete IIR System
x(n) x(n − 1) x(n − 2) x(n − N + 1)
T T T
127
× b0 × b1 × b2 × bN −2 × bN −1
y(n)
+ + + + +
T T T
y(n − M ) y(n − 1)
JJ
Here we extend:
II
The input delay line up to N − 1 elements and
J
The output delay line by M elements.
I
Back
Close
Complete IIR System Algorithm
x(n) x(n − 1) x(n − 2) x(n − N + 1)
T T T
× b0 × b1 × b2 × bN −2 × bN −1
128
y(n)
+ + + + +
T T T
y(n − M ) y(n − 1)
JJ
II
J
I
Back
Close
Filtering with IIR
We have two filter banks defined by vectors: A = {ak }, B = {bk }.
b(1)=1/(1+sqrt(2)*k+kˆ2);
b(2)=-2/(1+sqrt(2)*k+kˆ2);
b(3)=1/(1+sqrt(2)*k+kˆ2);
a(1)=1;
a(2)=2*(kˆ2-1)/(1+sqrt(2)*k+kˆ2);
a(3)=(1-sqrt(2)*k+kˆ2)/(1+sqrt(2)*k+kˆ2);
0.5
132
x(n) →
−0.5
−1
0 2 4 6 8 10 12 14 16 18
n→
0.5
y(n) →
0
JJ
−0.5 II
−1 J
0 2 4 6 8 10 12 14 16 18 I
n→
Back
Close
Finite Impulse Response (FIR) Systems
FIR system’s are slightly simpler — there is no feedback loop.
y(n)
x(n) × + 133
b0
A simple FIR system can be
described as follows:
T
y(n) = b0 x(n) + b1 x(n − 1) + b2 x(n − 2)
Y (z)
H(z) = = b0 + b1z −1 + b2z −2
X(z)
JJ
II
J
I
Back
Close
A Complete FIR System
To develop a more complete FIR system we need to add N −1 feed
forward delays:
x(n) x(n − 1) x(n − 2) x(n − N + 1) 135
T T T
× b0 × b1 × b2 × bN −2 × bN −1
y(n)
+ + + +