SIGNALS AND SYSTEMS USING MATLAB
Chapter 0 — From the Ground Up!
L. F. Chaparro and A. Akan
Digital signal processing
• 1948 – birth of digital technologies
• Transistor (Bell Labs)
• Stored–program computer (Manchester University, UK)
• Publications
• Shannon’s digital communications
• Hamming’s error correcting codes
• Wiener’s Cybernetics
• Moore’s Law, DSPs and FPGs
• 1965 — Moore (Intel): number of transistors in a chip would double every 2 years
• Digital Signal Processors (DSPs): optimized microprocessors for real–time
processing
• Field Programmable Gate Array (FPGA): device with programmable blocks and
interconnects
2 / 20
Compact disc (CD) and compact disc player
Speake
Lase r
r DAC
Audio
Senso
Amplifie
r
r
When playing a CD, the CD player follows tracks in the disc, focus laser beam on them,
as CD is spun. Light is reflected by pits and bumps on the surface of disc (corresponding
to the coded digital signal from acoustic signal). Sensor detects reflected light and
converts it into a digital signal and converted into an analog signal by DAC. Amplified and
fed to speakers signal sounds like original recorded acoustic signal.
3 / 20
Software–defined radio (SDR)
TRANSMITTE Antenn
a
R
Microphon
e
A DC Modulator DA C
Antenn
a
RECEIVE Speake
R r
Super
heterodyn A DC Demodulato DA C
e r
Voice SDR mobile two-way radio
Transmitter: voice signal inputted using microphone, amplified by an audio amplifier,
converted into a digital signal by ADC,modulated using software, converted by DAC into
analog signal which is amplified and radiated by antenna
Receiver: analog signal received by antenna is processed by a superheterodyne,
converted by ADC,demodulated using software, converted by DAC, amplified and fed to
speaker
4 / 20
Computer–control system
w(t)
r(t) y(t)
+ Digital
ADC DAC Plan
- Compute
t
r
Clock
Sensor
v(t)
Computer control system for an analog plant (e.g., cruise control for a car)
Reference signal r (t) (e.g., desired speed) and output y (t) (e.g., car speed)
Signals v (t) and w(t): disturbances or noise in plant and sensor (e.g., electronic noise in
the sensor and undesirable vibration in the car)
5 / 20
Continuous and discrete representations
Sampling continuous–time signal x (t) into discrete–time signal sequence x [n]:
x [n] = x (nTs ) = x (t)|t=nTs
Ts :sampling perioddepends on frequency content of x (t)
2
x1(0.1n)
−2
0 1 2 3 4 5 6 7 8 9 10
2
x2(n)
−2
0 1 2 3 4 5 6 7 8 9 10
t (sec)
Sampling x (t) = 2 cos(2πt), 0 ≤ t ≤ 10, with Ts1 = 0.1 (top) and Ts2 = 1 (bottom) giving
x1(0.1n) = x1[n] and x2(n) = x2[n]
Notice similarity between x1[n] and x (t) and loss of information when Ts2 = 1
6 / 20
Inherent discrete–time signal
ACM Closings, Jan. 2006− Dec. 2009
260
240
220
200
Dollars
180
160
140
120
100
20 40 60 80 100 120 140
Week
Weekly closings of ACM stock for 160 weeks in 2006 to 2009. ACM is the trading name
of the stock of the imaginary company ACME Inc. makers of everything you can imagine.
7 / 20
Implementation of DSP Algorithms
• Continuous-time signals Electrical and electronic circuits
• Digital signals Addition, multiplication, and delay
• DSP system’s output Arithmetic operations on input
• Possible real-time implementations;
• General-purpose microprocessors (Ps) and micro-controllers (Cs)
• General-purpose digital signal processors (DSPs)
• Field programmable gate arrays (FPGAs)
8 / 20
Infinitesimal and finite calculus
• Derivative and forward– difference
• Integral and summation
9 / 20
Approximation of integral
10
t
6
t, n
0 2 4 6 8 10
t
10 /
Differential and difference equations
Solve d.e. from series RC circuit with a constant voltage source vi (t) as input and R = 1 Ω,
C = 1 F (huge plates!)
dvc
vi (t) = vc (t) + t≥
(t)d
0
with initial voltage vc (0) across capacitor t
• Use integrators
vc (0)
dv c (t)
vi (t) v c (t) v c (t)
v i (t) dt
( .) dt
+ +
dv c (t) d(.)
dt dt
Block diagram for d.e. using differentiators (left) and integrators (right).
Differentiators increase noise, integrators smooth out noise
11 / 20
t t0 t1
∆t
Trapezoidal approximation of area
• Difference equation
T 2−
vc (nT ) [vi (nT ) + vi ((n − vc ((n − vc (0) = 0, n ≥
2+ T T
= 1)T )] + 1)T ), 1
2+ T
can be solved iteratively
12 /
Complex or real?
• Damping and frequencyof signals represented by complex
variable
• Complex numbers and functions z+
(x, y)
y v
| v z
z|
(a (b
) θ x )
(x, y)
|z|
v z
| φ |z| θ
v|
θ θ
θ+
(c (d |
φ
) z|
) (x, −y)
|z||
v|
(a) z = x + jy as vector ; (b) addition of complex numbers; (c) multiplication of
complex numbers; (d) complex conjugation of z.
13 /
Complex numbers
• Representations
z = x + jy rectangular
j ∠z
= |z |e polar
• Operations
I m[z]
• Rectangular to
polar conversion 1
3 R e[z] 3 R e[z]
z = 3 + j 4 = 5e j0.93 √
u = − 3+ j = 10 e j 2 . 8 2
I m[z] I m[z]
4 1
R e[z] R e[z]
1
j 3.79
w = −4 − 3 j = 5 e √
v=1−j = 2 e− j π / 4
14 /
Euler’s identity
ej θ= cos(θ) + j
sin(θ)
jθ −j
cos(θ) = Re[ejθ ] = e + e
θ 2
jθ −j
sin(θ) = Im[ejθ ] = e − e .
θ 2j
• Polar to rectangular conversion
15 /
• Roots and powers of j
j
z3+ 1= 0 zk3 = −1 = (2k+1)π
, k = 0, 1,
zk = ej (2k+1)π/3, k e= 0, 1, 2 2
⇒ j π/3 z 1 = ej π =
z0 = e , z2 = ej (6−1)π/3 = ej 2πe−j π/3 = e−j
−1, π/3
90 1 90 1
120 60 120 60
150 0.5 30 150 0.5 30
180 0 180
210 330 210 33
240 300 240 300
270 270
Left: roots of z3 + 1 = 0. Right: integer powers of j , periodic of period 4, with
period of {1, j ,− 1, −j}
16 /
• Trigonometric identities
17 /
Phasor
s
• Sinusoids and phasors
x (t) = A cos(Ω0t + ψ) −∞ <
t< ∞ ψ phase (rad)
A amplitude, Ω0 = 2πf0
frequency (rad/sec),
Phasor : X = Aej ψ, x (t) =ΩRe[Xe
0
j
Ω0t
] si
n
cos
sin
Generation of sinusoids from phasors of a frequency Ω0 shown at
initial position
18 /
90 30
90 120 60
30
20
120 60
150 30
10
20
180 0
150 30
210 330
10
240 300
270
180 0
40
20
210 330
0
−20
240 300
270
−40
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
Phasor 1 + Phasor 2
Sum of phasors I1 = 10 ej 0 and I2 = 20 ej π/4 with the result in the top left and the
corresponding sinusoid (right bottom).
19 /
Phasors and
systems
• Eigenfunction property of LTI systems
Input: x (t) = Re[Xej Ω0t ],input phasor
X = Aej θ
j Ω0t
Output: y (t) = Re[Ye ], output
phasor Y = XH(j Ω0)
• Steady–state response
Input Output
Linear time-invariant
x(t) = A cos(Ω0t + system
y s s (t) = A|H(jΩ0 )| cos(Ω0t + θ + ∠H(jΩ0))
θ)
Frequency response of system
20 /