Vous êtes sur la page 1sur 72

Digital Signal Processing

BEF 35603

Dr. Shahnoor Shanta


Dept. of Electronic Engineering
Faculty of Electrical and Electronics Engineering
Universiti Tun Hussein Onn Malaysia (UTHM)
1
Chapter 1
DISCRETE SIGNAL AND
SYSTEM

2
What is signal?
It is a description of how one parameter is related to
another parameter
Signal can be natural and man made.
Example: variation of air pressure when we speak,
daily temperature, & periodic electrical signals
generated by heart.
Signal represent information.

Signal may not convey required information directly,


and may not free from disturbances.
Need to convert the signals to electrical form for
processing. 3
Review
An analog signal is one in which the signal
intensity varies in a smooth fashion over time, no
breaks or discontinuities in the signal
A digital signal is one which the signal intensity
maintains a constant level for some period of time
and then changes to another level

4
What is signal processing?
Signal processing forms the basis for enhancing,
extracting, storing or transmitting useful
information.
Two conceptual schemes: Analog to digital
converter (ADC) or Digital to analog converter
(DAC)

5
Real World Applications

6
Why Digital
Easy to analyze using computers
Efficient way of storing - CD

Easy to simulate cheap and safe


Easy to maintain quick and low cost

Compact in size - p are small in size

Robust stable in presence of noise

System work better

7
Discrete Signals
Discrete signal is a sampled signal.
May arise naturally (such as daily temperature).

Or as a consequence of sampling continuous


signals (e.g. at a uniform sampling interval ts).
Discrete signal x[n] is an ordered sequence of
values corresponding to the integer index n.
x[n] is plotted as lines against the index n.

8
1

-1

Continuous-time signal

-1

0 4 8 12 16 20 24 28 32
Discrete-time signal

9
The origin t = 0 corresponds to n = 0.
A marker () indicates the origin n = 0.

E.g. x[n] = {1, 2, 4, 8,}.

Ellipses (...) denote infinite extent on either side.

10
Discrete Signals

x[n] is called:
right-sided if it is zero for n < N.
causal if it is zero for n < 0.
left-sided if it is zero for n > N.
anti-causal if it is zero for n 0.

11
A discrete periodic signal repeats every N samples is
described by:

x[n] = x[n kN], k = 0, 1, 2, 3, ...

N=4
3
2

y[n] { 0, 1, 2, 3, 0 , 1, 2, 3.....}

12
Signal Measures
For nonperiodic signals, the signal energy E is a
useful measure. It is defined as:

E x[n]
n

13
Signal Measures Contd..
Measures for periodic signals are based on
averages since their signal energy is .
Average value x = average sum per period.
av
N 1
1
xav
N
x[n]
n 0

Signal power P = average energy per period.


N 1 2
1
P
N
x[n]
n 0

14
Signals with finite energy are called energy
signals.
Signals with finite power are called power
signals.
All periodic signals are power signals

15
Example 1.0
Find the energy in the signal
x[n] = 3( 0.5 ) n , n 0.

16
Solution
This describes a one-sided decaying exponential.
Its signal energy is
2
9
E x [n] 3(0.5)
n
2

n 0
n
9(0.25) n
n 0 1 0.25
12 J

Note that
1

n 0
n

17
Example 1.1
Periodicsignal is . Given N=4, find average value
and signal power.

Solution:

-----Will be given during lecture-------

18
Operations on Discrete Signals
Common operations:
Addition y[n] x1[n] x 2[n]
Multiplication. y[n] x1[n]x 2[n]
Scaling (Attenuation/Amplification) y[ n] Ax1[ n]
Time shifting
Folding
Decimation and interpolation (time scaling)

19
Operations on Discrete Signals
Time Shifting:
This is done exactly in the same way as the time-
shifting of CT signals.

y[n]= x[n ] for > 0 means a delayed version


of x[n] (shifted to the right by )

y[n] = x[n + ] for > 0 means an advanced


version of x[n] (shifted to the left by )

20
Folding:
The signal y[n] = x[ n ] is a folded version of x[n]
(mirror image of x[n] about the origin n = 0).

x[ n ] can be generated from x[n] by:


Method 1: Shift right units: x[n] => x[n ].
Then fold: x[n ] => x[ n ].
Method 2: Fold: x[n] => x[ n].
Then shift left units: x[ n] => x[(n + )] = x[ n ].

21
Example 1.2

Given x n {2, 3, 4, 5, 6, 7} . Find and sketch:

1. y [n] = x [n 3]
2. f [n] = x [n + 2]
3. g [n] = x [ n]
4. h [n] = x [ n + 1]
5. s [n] = x [ n 2 ]
6. Calculate xe[n] and xo[n]
22
Solution

y[n] = x[n-3] = { 0 , 2, 3, 4, 5, 6, 7}


f[n] = x[n+2] = {2, 3, 4, 5, 6 , 7}

g[n] = x[-n] = {7, 6, 5, 4, 3, 2}

h[n] = x[-n+1] = {7, 6, 5 , 4, 3, 2} (fold x[n], then delay by 1)

s[n] = x[-n-2] = {7, 6, 5, 4, 3, 2 } (fold x[n], then advance by 2)

23
Symmetry
If a signal x[n] is identical to its mirror image
x[-n], it is called an even symmetric signal.

If x[n] differs from its mirror image x[ n] only


in sign, it is called an odd symmetric signal or
antisymmetric signal

24
xe [n] xe [ n] xo [n] xo [n]

It extends over symmetric limits of N < n < N.


For odd symmetric signal, xo[0] = 0 & the sum of xo[n]
over symmetric limits ( , ) equals zero:

x [k ] 0
k
0

25
Even and Odd Parts of Signals
Even symmetry & odd symmetry are mutually
exclusive.
Any signal x[n] may be expressed as the sum
of xe[n] & xo[n].
x[n] = xe[n] + xo[n] (a)
To find xe[n] & xo[n] from x[n], x[n] is folded &
invoked symmetry to get:
x[-n] = xe [-n] + xo [-n] = xe [n] - xo [n] (b)

26
Adding equation (a) & (b):
2 xe[n] = x[n] + x[ n]
xe[n] = 0.5x[n] + 0.5x[ n]
Subtracting equation (a) & (b):
2 xo[n] = x[n] x[ n]
xo[n] = 0.5x[n] 0.5x[ n]
If x[n] has even symmetry, xo[n] will equal to zero.
If x[n] has odd symmetry, xe[n] will equal to zero.

27
Example 1.3

Let . Find and sketch its odd and even parts.

Answer:

28
Decimation
Sampled at ts at a continuous time signal x(t) and
convert it into a sequence of samples x[n].
Signal y[n] = x[2n] is the compressed signal x(2t)
sampled at ts.
It contains x[0], x[2], x[4], .... (alternate samples of x[n])
y[n] can be obtained directly from x(t) (not its
compressed version) if we sample it at 2ts.
It means a twofold reduction in the sampling rate.
Decimation by a factor of N is sampling x(t) at intervals
Nts & implies N-fold reduction in the sampling rate
29
Interpolation
x[n] is x(t) sampled at intervals ts.
y[n] = x[n/2] is x(t) sampled at ts/2 & has twice
the length of x[n] with one new sample between
adjacent samples of x[n].
If expression for x[n] were known, it would be
no problem to determine new sample values.
Otherwise, the best to do is interpolate between
samples.

30
May choose each new sample value as:
zero (zero interpolation)
a constant equal to the previous sample value (step
interpolation)
average of adjacent sample values (linear
interpolation)

31
Zero interpolation is known as up-sampling &
plays an important role in practical.

Interpolation by factor N is equivalent to


sampling x(t) at intervals ts/N.

It implies N-fold increase in both the sampling


rate & the signal length

32
Consider two sets of operations below:
x[n] decimate by 2 x[2n]
interpolate by 2 x[n]

x[n] interpolate by 2 x[n/2]


decimate by 2 x[n]

Both operations appear to recover x[n] suggesting


interpolation & decimation are inverse operations.
In fact, only the second sequence of operations
(interpolation followed by decimation) recovers x[n]
exactly!
33
Example 1.5

Given x[n] = { 1, 2, 6, 4, 8}. Find two sequence of
operation, by using step interpolation (n/2).

34
Solution :step interpolation

{1 , 2, 6, 4, 8} decimate (n2n)

{ , 6, 8} 1
interpolate (nn/2)
{ , 1, 6, 6, 8, 8} cannot recover
1
{ , 2, 6, 4, 8} interpolate (nn/2)

1 { , 1, 2, 2, 6, 6, 4, 4, 8, 8}
decimate(n2n)
1
{ , 2, 6, 4, 8} recover original signal

1

35
If a signal x[n] is interpolated by N and then
decimated by N, the original signal x[n] will be
recovered.
If a signal x[n] is first decimated by N and then
interpolated by N, x[n] may not recovered.
If both interpolation and decimation are
required, it is better to interpolate first.

36
Fractional Delay
Fractional delays (typically half-sample) can be
implemented using interpolation & decimation.

Fractional delay of x[n] requires interpolation, shift


& decimation (in that order).
M Nn M
x
x[n] n x
means interpolate
N

N
x[n] by N, delay by M, then decimate by N.

37
Example 1.6

Given x[n] = {2, 4, 6 , 8}. Find the signal
y[n] = x[n 0.5] using linear interpolation

38
Solution
First interpolate by 2, delay by 1 and then decimate by 2.
Linear interpolation:

g[n] = x[n/2] = {2, 3, 4, 5, 6, 7, 8, 4}
(last sample interpolated to zero).

n 1
Delay: h[n] =x g[n 1] =
2

= {2, 3, 4, , 6, 7, 8, 4}.
5

Decimation: y[n] = h[2n] = x 2n 1


2

= x[n 0.5 ] = { 3, , 7, 4}. 5
39
Exercise

i. Let x[n] {1, 2,5,1}. Generate x[2n] and various
interpolated versions of x[n/3]

ii. Let x[n] {3,4, 5,6} . Find g[n]=x[2n 1] and the
step interpolated signal h[n]=x[0.5n 1]


iii. Let x[n ] {3,4, 5,6}. Find y[n]=x[2n/3] assuming
step interpolation where needed.

40
Common Discrete Signals
0, n 0
unit impulse [ n]
1, n 0

unit step 0, n 0
u[n]
1, n 0

unit ramp 0, n 0
r[n] nu[n]
n, n 0

41
Numeric sequence of a discrete signal can be
obtained from summation of combination of
impulse, ramp, and step function.

42
Example 1.7

Find y[n] in numeric sequence.

Answer: y[n]={-3, -2, 1, 2, 2, -1, -1,0}

43
Properties of the Discrete Impulse
The product of x[n] with impulse [n k] results in:
x[n][n k] = x[k][n k]

This is an impulse with strength x[k]. The product


property leads to:

x[n] [n k ] x[k ]
n

This is the sifting property. The impulse extracts the


value x[k] from x[n] at impulse location n = k

44
Signal Representation by Impulses

Any arbitrary sequence x[n] can be expressed as a


sum of shifted impulses [n k] whose strengths
x[k] correspond to the signal values at n = k. Thus,

x[n] x[k ] [n k ]
k

u[n] & r[n] may be expressed as a train of shifted


impulses:
u[n] [n k ]
k 0


r[n] k [n k ]
k 0
45
u[n] may also be expressed as the cumulative sum
of [n] & r[n] may be described as the cumulative
sum of u[n]:
n
u[n] [k ]
k

n
r[ n ] u[k ]
k

46
Example 1.9
Based on question in Example 1.7
Find
i) sum of shifted impulses
ii) Sum of steps

Iii) Sum of ramps

47
Discrete Pulse Signals
(N=3)

n 1, nN
rect
2 N 0, elsewhere

(N=4)
n
n 1 , n N
tri N
N 0, elsewhere

48
rect(n/2N) has 2N + 1 samples over
N n < N.
tri(n/N) has 2N + 1 samples over N n N,
with the end samples x[N] & x[ N] being zero

49
Example 1.10
Mathematically describe the signals below in at
least two different ways

50
Discrete Systems
Collection of hardware components, or
software routines, that operates on a discrete-
time signal sequence.
Systems are modeled as transformations or
operators that map input signals to outputs
Continuous Time y t : T x t
Discrete Time y n: T x n
T . denotes the operator or transformation that
models the effect of the system on the input
signal
51
System Classes
Classes of systems are defined by which of the following
characteristics they possess
Memory-store info about the input from the past or future value.

Linearity
Time-Invariance
Causality
Stability
Linear Time-Invariant (LTI)
These characteristics place constraints on the
corresponding system operators or transformations
52
Linear vs nonlinear system

If y*(n)=y(n) , the system is linear


x1(n)
x1(n)
T a1 a1

y*(n)
T
x2(n)
+ + y(n)

T a2 x2(n) a2

Here y*(n) = a1T[x1(n)] + a2T[x2(n)]


Linear vs nonlinear system

X1(n) Determine if the system linear or nonlinear Y(n)=2nX(n)


T
Y 1 a1

Y*(n)=a1[2nX1(n)]+ a2[2nX2(n)]= 2a1nX1(n)+ 2a2nX1(n)


+
X2(n) a1
T X1(n) Y(n)=2n[a1X1(n)+ a2X2(n)]

Y 2 a2 T
+
X2(n) Y(n)=2a1nX1(n)+ 2a2nX2(n)

a2
Y(n)=Y*(n)
1a. Linear vs nonlinear system
Tutorial:
Consider the linearity of the following signal:
y[n]=x2[n]=x [n] x [n]
x(n)

y(n)
x
Ans: first step: set two different input
y1(n) = x1(n) x1(n) and y2(n) = x2(n) x2(n)
second step: combine input
x(n) = a1x1(n)+a2x2(n)
Linear vs nonlinear system

Ans:
second step: combine input
x(n) = a1x1(n)+a2x2(n)
third step: check total output
Y(n) = {a1x1(n)+a2x2(n)} {a1x1(n)+a2x2(n)}
Y(n) = a12x12 (n)+2a1a2x1(n)x2(n)+a22x22 (n)

Y*(n) = a1y1(n)+a2y2(n)
= a1x12 (n)+a2x22 (n)
Y(n) Y*(n) , Non linear system
Time-Invariant vs T-Variant

If Y*(n)=Y(n) >>> Time Invariant


X(n) X(n-k) Y(n)
delay T

X(n) Y(n) Y*(n)=Y(n-k)


T delay
Time-Invariant vs T-Variant

Example: y[n]=0.5(x[n]+x[n-2])

First step : shift x[n], result x[n-k] then


the output is
y[n] = 0.5 (x[n-k]+x[n-k-2])

Second step: process the input, y[n]=0.5(x[n]+x[n-2])


then shift
y*[n]=y[n-k] = 0.5 (x[n-k]+x[n-2-k])

As y[n]=y*[n] the system is time-invariant.


Static/memoryless system
if the output not depends on past and future inputs

y(n) = x2(n)+2x(n)

No shifting process
Dynamic system
if the output depends on past and or future inputs

y(n) = x(n-k)+2x(n)

have shifting process


Causal system
Causal if the output only depends on present and past
inputs

y(n) = x(n)+2x(n-k)

Non-Causal if the output depends on future inputs

y(n) = x(n)+2x(n+k)
Stability

System is said to be bounded input-bounded output (BIBO)


Stable if and only if every bounded input produce a bounded
output
Example:
y(n) = 2x(n)

If input is bounded by
output is bounded by
Hence the system is stable.
Stability
Example
unstable : y(n) = y2(n-1)+x(n) where y(-1)=0

If input is

Ans:

..

The output is unbounded when

Hence the system is unstable.


Linear Time-Invariant (LTI)
System
INPUT LTI System OUTPUT

T .

Scaling and shifting the input results in an identical scaling and


64
shifting of the output.
Example 1.10
Let

Then

The output is a version of the impulse response that has been shifted and
scaled by same amount as the delta function on the input.
65
output can be expressed as:

in short notation:

known as convolution
66
NOTE:
Once h[n] of a system is known then given any input
x[n], we can always compute the output sequence y[n]

h[n k] = h[ (k n)]
Reflect h[k] about the origin to obtain h[ k].
Shift the origin of the reflected sequence to k = n
OR
Shift the origin of the original sequence to k = n.
Reflect h[k n] then about the new origin

67
Analysis
Discrete time system
1. CONVOLUTION: decompose or resolve the
input signal into sum of elementary signal, will be
explained in the next chapter.

2. Difference Equation: direct solution of the input-


output equation system, will be explained in the
next chapter.
Element of DSP System
Analog signal processing
Analo Analo
Analog g
g Signal
input outpu
Processor t
signal
signal
Digital signal processing -method for processing
the analog signal

Analog Digital Analog


Nyquis Sampl A/D D/A FS
input convert signal convert output
t Filter e Hold LPF
signal er processin er signal
g

Digital Digital
input output
signal signal
69
Nyquist Filter (Anti-Aliasing filter)
limits the highest analog , choose the suitable sampling rate and
prevent aliasing (Detail in Chapter 3)
Sample Hold
convert analog to discrete signal
A/D converter
convert the analog (discrete) signal to digital that is appropriate as an
input to the digital processor
DS Processor
is a large programmable digital computer or small processor
programmed to perform the desired operations on the input signal
D/A converter
as an interface to provide the analog signal to the user
FS LPF
smooth the reconstructed signal

70
Advantage of DSP over ASP
DSP ASP
Reconfiguration the Flexible; changing the Implies a redesign, testing
system operation. program and verification of the
hardware
Accuracy Much better to control Difficult to control
because of tolerance
Signal processing Allows the implementation Difficult to perform
algorithms of more sophisticated precise mathematical
algorithm operations
Cost Cheaper Expensive
Limitations in DSP
The speed of operation of ADC and digital signal processor, especially for
extremely wide bandwidths signal, requires fast-sampling-rate ADC and fast
digital signal processors.
71
"The seeking of knowledge is obligatory for every
Muslim."
Al-Tirmidhi, Hadith 74

I listen and I forget, I see and I remember,


I do and I understand.
Chinese philosopher & reformer

72

Vous aimerez peut-être aussi