Sei sulla pagina 1di 42

ELEN E4810: Digital Signal Processing

Week 1: Introduction
1. Course overview
2. Digital Signal Processing
3. Basic operations & block diagrams
4. Classes of sequences

Dan Ellis 2003-09-02 1


1. Course overview
 Digital signal processing:
Modifying signals with computers
 Web site:
http://www.ee.columbia.edu/~dpwe/e4810/
 Book:
Mitra Digital Signal Processing (2nd ed.)
2001 printing
 Instructor: dpwe@ee.columbia.edu

Dan Ellis 2003-09-02 2


Grading structure
 Homeworks: 20%
 Mainly from Mitra
 Midterm: 20%
 One session
 Final exam: 30%
 Project: 30%

Dan Ellis 2003-09-02 3


Course project
 Goal: hands-on experience with DSP
 Practical implementation
 Work alone or in pairs
 Brief report, optional presentation
 Recommend MATLAB
 Ideas on website

Dan Ellis 2003-09-02 4


Example past projects
on web site

 Speech enhancement
 Audio watermarking
 Voice alteration with the Phase Vocoder
 DTMF decoder
 Reverb algorithms
 Compression algorithms
W

Dan Ellis 2003-09-02 5


MATLAB
 Interactive system for numerical
computation
 Extensive signal processing library
 Focus on algorithm, not implementation
 Access:
 Engineering Terrace 251 computer lab
 Student Version (need Sig. Proc. toolbox)
 ILAB (form)

Dan Ellis 2003-09-02 6


Course at a glance
DSP
wk11
x[n]
wk1/2
Discrete time Continuous time
signals + systems n

X()
Fourier Systems wk5
wk3 domain

DTFT z-transform Filters

wk4 Filter
FIR IIR design
DFT/FFT
wk10 wk6 wk7
FIR wk8 IIR wk9

Dan Ellis 2003-09-02 7


2. Digital Signal Processing
 Signals:
Information-bearing function
 E.g. sound: air pressure variation at a
point as a function of time p(t)
 Dimensionality:
Sound: 1-Dimension
Greyscale image i(x,y) : 2-D
Video: 3 x 3-D: {r(x,y,t) g(x,y,t) b(x,y,t)}
Dan Ellis 2003-09-02 8
Example signals
 Noise - all domains
 Spread-spectrum phone - radio
 ECG - biological
 Music
 Image/video - compression
 .

Dan Ellis 2003-09-02 9


Signal processing
 Modify a signal to extract/enhance/
rearrange the information
 Origin in analog electronics e.g. radar
 Examples
 Noise reduction
 Data compression
 Representation for
recognition/classification

Dan Ellis 2003-09-02 10


Digital Signal Processing
 DSP = signal processing on a computer
 Two effects: discrete-time, discrete level
Continuous time Discrete time
x x

x(t)
Continuous
value

time time

T
x x

x[n]
Discrete
value

time time


T
Dan Ellis 2003-09-02 11
DSP vs. analog SP
 Conventional signal processing:
p(t) Processor q(t)

 Digital SP system:
p[n] q[n]
p(t) A/D Processor D/A q(t)

Dan Ellis 2003-09-02 12


Digital vs. analog
 Pros
 Noise performance - quantized signal
 Use a general computer - flexibility, upgrde
 Stability/duplicability
 Novelty
 Cons
 Limitations of A/D & D/A
 Baseline complexity / power consumption
Dan Ellis 2003-09-02 13
DSP example
 Speech time-scale modification:
extend duration without altering pitch
0.2

0.1

0.1
0 0.05 0.1 0.15 0.2 0.25

0.2

0.1

0.1
0 0.05 0.1 0.15 0.2 0.25 M
time / sec

Dan Ellis 2003-09-02 14


3. Operations on signals
 Discrete time signal often obtained by
sampling a continuous-time signal

 Sequence {x[n]} = xa(nT), n=-1,0,1,2


 T= samp. period; 1/T= samp. frequency
Dan Ellis 2003-09-02 15
Sequences
 Can write a sequence by listing values:
{x[n]} = {K, 0.2, 2.2,1.1, 0.2, 3.7, 2.9,K}

 Arrow indicates where n=0
 Thus, x[ 1] = 0.2, x[0] = 2.2, x[1] = 1.1,

Dan Ellis 2003-09-02 16


Left- and right-sided
 x[n] may be defined only for certain n:
 N1 n N2: Finite length (length = )
 N1 n: Right-sided (Causal if N1 0)
 n N2: Left-sided (Anticausal)
 Can always extend with zero-padding
N2
n n
N1

Left-sided Right-sided

Dan Ellis 2003-09-02 17


Operations on sequences
 Addition operation:
x[n] + y[n]
 Adder
w[n] y[n] = x[n] + w[n]

 Multiplication operation
A
Multiplier x[n] y[n]
 y[n] = A x[n]

Dan Ellis 2003-09-02 18


More operations
 Product (modulation) operation:
x[n] y[n]
Modulator

w[n] y[n] = x[n] w[n]

 E.g. Windowing: multiplying an infinite-


length sequence by a finite-length
window sequence to extract a region

Dan Ellis 2003-09-02 19


Time shifting
 Time-shifting operation: y[n] = x[n N ]
where N is an integer
 If N > 0, it is delaying operation
 Unit delay x[n] z 1 y[n]
y[n] = x[n 1]
 If N < 0, it is an advance operation
 Unit advance
x[n] z y[n] y[n] = x[n + 1]
Dan Ellis 2003-09-02 20
Combination of basic operations
 Example

1 x[n] + 2 x[n 1]
y[n] =
+ 3 x[n 2] + 4 x[n 3]

Dan Ellis 2003-09-02 21


Up- and down-sampling
 Certain operations change the effective
sampling rate of sequences by adding
or removing samples
 Up-sampling = adding more samples
= interpolation
 Down-sampling = discarding samples
= decimation

Dan Ellis 2003-09-02 22


Down-sampling
 In down-sampling by an integer factor
M > 1, every M-th samples of the input
sequence are kept and M - 1 in-between
samples are removed:
xd [n] = x[nM ]

x[n] M xd [n]

Dan Ellis 2003-09-02 23


Down-sampling
 An example of down-sampling
1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
0 10 20 30 40 50 0 10 20 30 40 50

x[n] 3 y[n] = x[3n]


Dan Ellis 2003-09-02 24
Up-sampling
 Up-sampling is the converse of down-
sampling: L-1 zero values are inserted
between each pair of original values.

x[n / L], n = 0, L, 2 L,L


xu [n] =
0, otherwise

x[n] L xu [n]

Dan Ellis 2003-09-02 25


Up-sampling
 An example of up-sampling
1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
0 10 20 30 40 50 0 10 20 30 40 50

x[n] 3 xu [n]
not inverse of downsampling!

Dan Ellis 2003-09-02 26


Complex numbers
 .. a mathematical convenience that lead
to simple expressions
 A second imaginary dimension (j-1)
is added to all values.
 Rectangular form: x = xre + jxim
where magnitude |x| = (xre2 + xim2)
and phase = tan-1(xim/xre)
 Polar form: x = |x| ej = |x|cos + j |x|sin
( e j = cos + j sin )
Dan Ellis 2003-09-02 27
Complex math
 When adding, real
xim
imag
x+y
and imaginary parts
+yim add: (a+jb) + (c+jd)
xy
|y| yim = (a+c) + j(b+d)

|x||y|
xim
yre
 When multiplying,
+ |x|
magnitudes multiply

xre xre
real
and phases add:
rejsej = rsej(+)
+yre

 Phases modulo 2
Dan Ellis 2003-09-02 28
Complex conjugate
 Flips imaginary part / negates phase:
conjugate x* = xre jxim = |x| ej()
 Useful in resolving to real quantities:
x + x* = xre + jxim + xre jxim = 2xre
|x| ej() |x| ej() = |x|2
xx* =imag
x
|x|
x+x*
= 2xre

real

x*
Dan Ellis 2003-09-02 29
Classes of sequences
 Useful to define broad categories
 Finite/infinite (extent in n)
 Real/complex:
x[n] = xre[n] + jxim[n]

Dan Ellis 2003-09-02 30


Classification by symmetry
 Conjugate symmetric sequence:
xcs[n] = xcs*[-n] = xre[-n] jxim[-n]

Imag
xim[n]

Real

xre[n]

 Conjugate antisymmetric:
xca[n] = xca*[-n] = xre[-n] + jxim[-n]
Dan Ellis 2003-09-02 31
Conjugate symmetric decomposition
 Any sequence can be expressed as
conjugate symmetric (CS) /
antisymmetric (CA) parts:
x[n] = xcs[n] + xca[n]
where:
xcs[n] = 1/2(x[n] + x*[-n]) = xcs *[-n]
xca[n] = 1/2(x[n] x*[-n]) = -xca *[-n]
 When signals are real,
CS Even (xre[n] = xre[-n]), CA Odd
Dan Ellis 2003-09-02 32
Basic sequences
1, n = 0
 Unit sample sequence: [ n] =
1
0, n 0

n
4 3 2 1 0 1 2 3 4 5 6
1

 Shift in time:
[n - k] n k2 k1 k k+1 k+2 k+3

 Can express any sequence with :


{0,1,2..}= 0[n] + 1[n-1] + 2[n-2]..
Dan Ellis 2003-09-02 33
More basic sequences
1, n 0
 Unit step sequence: [ n] =
0, n < 0
1

n
4 3 2 1 0 1 2 3 4 5 6

 Relate to unit sample:


[n] = [n] [n 1]
[n] =
n
[k]
k=

Dan Ellis 2003-09-02 34


Exponential sequences
 Exponential sequences= eigenfunctions
 General form: x[n] = An
 If A and are real:
50 20

40
15
30
10
20

10 5

0 0
0 5 10 15 20 25 30 0 5 10 15 20 25 30
|| > 1 || < 1
Dan Ellis 2003-09-02 35
Complex exponentials
x[n] = An
 Constants A, can be complex :
A = |A|ej ; = e( + j)
x[n] = |A| en ej(n + ) I
scale varying varying
phase R
magnitude
1 2
3 4

4 n

per-sample
phase advance

Dan Ellis 2003-09-02 36


Complex exponentials
 Complex exponential sequence can
project down onto real & imaginary
axes to give sinusoidal sequences
1
x[n] = exp( 12 + j 6 )n
j
e = cos + j sin
1 1

0.5 xre[n] 0.5 xim[n]


0 0

-0.5 -0.5

-1 -1
0 10 20 30 40 0 10 20 30 40

xre[n] = en/12cos(n/6) xim[n] = en/12sin(n/6)M


Dan Ellis 2003-09-02 37
Periodic sequences
 A sequence ~ x [n] satisfying ~
x [ n] = ~x [n + kN ],
is called a periodic sequence with a
period N where N is a positive integer and
k is any integer.
Smallest value of N satisfying ~ x [ n] = ~x [n + kN ]
is called the fundamental period

Dan Ellis 2003-09-02 38


Periodic exponentials
 Sinusoidal sequence A cos( o n + ) and
complex exponential sequence B exp( j o n)
are periodic sequences of period N only if
o N = 2 r with N & r positive integers
 Smallest value of N satisfying o N = 2 r
is the fundamental period of the
sequence
 r = 1 one sinusoid cycle per N samples
r > 1 r cycles per N samples M

Dan Ellis 2003-09-02 39


Symmetry of periodic sequences

 An N-point finite-length sequence xf[n]


defines a periodic sequence:
x[n] = xf[<n>N] n modulo N
 Symmetry of xf [n] is not defined
because xf [n] is undefined for n < 0
 Define Periodic Conjugate Symmetric:
xpcs [n] = 1/2(x[n] + x*[<-n >N])
= 1/2(x[n] + x*[N n]) 0 n < N
Dan Ellis 2003-09-02 40
Sampling sinusoids
 Sampling a sinusoid is ambiguous:
1

0.5

0.5

1
0 1 2 3 4 5 6 7 8 9 10

x1 [n] = sin(0n)
x2 [n] = sin((0+2)n) = sin(0n) = x1 [n]

Dan Ellis 2003-09-02 41


Aliasing
 E.g. for cos(n), = 2r 0
all r appear the same after sampling
 We say that a larger appears
aliased to a lower frequency
 Principal value for discrete-time
frequency: 0 0
i.e. less than one-half cycle per sample

Dan Ellis 2003-09-02 42

Potrebbero piacerti anche