0% found this document useful (0 votes)
85 views79 pages

BDSP Lecture 3

This document provides an overview of digital signals and systems. It discusses notations for digital signals including unit impulse, step, and ramp functions. It describes how to generate digital signals including scaled, shifted, composite, and sampled analog signals. It also covers properties of linear time-invariant causal systems including linearity, time-invariance, causality, impulse response, and stability. Examples are provided to illustrate key concepts such as drawing signals defined by combinations of basic functions and testing systems for linearity and time-invariance.

Uploaded by

Mohammed Faris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views79 pages

BDSP Lecture 3

This document provides an overview of digital signals and systems. It discusses notations for digital signals including unit impulse, step, and ramp functions. It describes how to generate digital signals including scaled, shifted, composite, and sampled analog signals. It also covers properties of linear time-invariant causal systems including linearity, time-invariance, causality, impulse response, and stability. Examples are provided to illustrate key concepts such as drawing signals defined by combinations of basic functions and testing systems for linearity and time-invariance.

Uploaded by

Mohammed Faris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 79

Biomedical Digital

Signal Processing
BDSP-513
Lecture 3

Digital Signals and Systems


Overview
I. Notations for Digital Signals & special digital sequences

II. Generation of digital Signals

III. Properties of linear Time-Invariant, causal


systems:
– Linearity
– Time invariance
– Causality
– Impulse response
– Difference equation
– BIBO (bounded-in-and-bounded-out) stability
– Digital convolution
I- Notations for Digital Signals
› 𝑥 𝑛 is a typical digital signal. It represents the amplitude
of the 𝑛𝑡ℎ sample and 𝑛 is the time index or sample
number.

Note that precision of the data is based on the number of bits used in the DSP
system.
Notation for Digital Signals
› A digital signal x[n] may be modified by time shifts and
resampling.

For Example:
› Signal x[n-2], shifts x[n] two steps to the right
› Signal x[n+3], shifts x[n] three steps to the left
› Signal x[2n], selects every other sample from x[n]
› Signal x[3n], selects every third sample

4
Digital Functions
The basic digital functions (signal or sequence)
are:

› Unit Impulse Function

› Unit Step Function

› Unit Ramp Function

› Power Function

› Exponential Function

5
Unit Impulse Function
The unit impulse function or unit sample sequence is defined
as the sequence with values.

Unit impulse sequence

0.8

0.6
k

0.4

0.2

0
-5 0 5 10
k
Unit Impulse Function

k 1, k0

Matlab Code
0, kUnitimpulse sequence
k1 = -5;
k2 = 10; 01
k = k1:k2;
0.8
x = (k==0); 0.6
k

stem(k, x) 0.4

0.2
xlabel('k')
ylabel('\delta_k') 0
title('Unit impulse
-5 0 5 10
sequence') axis([k1 k2 -0.1 k
1.1])
Unit Impulse Function
• The unit impulse function δ[n] has an amplitude of zero at all
samples except n = 0, where it has the value 1.

• Every digital signal can be written as a sum of


impulse functions, using the amplitude at each sample.

Example: Determine the following:


a) δ[0] =
b) δ[3] =
c) δ[-2] =

Answers:
a) δ[0] = 1
b) δ[3] = 0
c) δ[-2] = 0
Scaled Unit Impulse Function

Example: Draw the following signal: x[n] = 4 δ[n]


Scaled Unit Impulse Function
Example: Draw the following signal: x[n] = -2δ[n]
Shifted Unit Impulse Function
Example: Draw the following signals:

a) x[n] = δ[n - 2]

b) x[n] = δ[n +
2]
Unit Impulse Function
Example: write a function to describe the signal in the figure.

x[n] = 4δ[n] - 2δ[n-1] + 3δ[n-2] - δ[n-3]


12
Unit Step Function

The unit step function or unit step sequence is defined as the


sequence with values.
Unit Step Function

u k  1, k  0

Matlab Code
0, k Unit step sequence

k1 = -5;
k2 = 10;
 01
k = k1:k2; 0.8

x = (k>=0); 0.6
uk

0.4
stem(k, x)
0.2
xlabel('k')
ylabel('u_k') 0
title('Unit step sequence')
-5 0 5 10
axis([k1 k2 -0.1 1.1]) k
Shifted Unit Step Function

Example: Draw the signal x[n] = u[n - 2], and x[n] = u[n + 2]
Unit Step Function

Example: Draw the signal x[n] = u[-n]


Unit Step Function

Example: Draw the signal x[n] = u[3 - n]


Unit Step Function

Example:

A digital signal is described as x[n] = 4(u[n] - u[n - 1]).

Write the function that describes x[n-3].

Answer

Substituting n = (n – 3) gives

x[n-3] = 4(u[n-3] - u[n - 4])


Connection b/w Impulse and Step Functions
› The step function may be expressed as a sum of
impulse functions:
u[n] = δ[n] + δ[n-1] + δ[n-2] + …


𝑢(𝑛) ∑ 𝛿(𝑛 − 𝑚)
𝑚=0

› Similarly, Impulse function may be expressed as a difference


of two step functions :
δ[n] = u[n] – u[n-1]

19
Connection b/w Impulse and Step Functions
Example: write a function to describe the signal in the figure (2
solutions).

Unit Impulse Function


x[n] = 2δ[n] + 2δ[n-1] - 4δ[n-2] - 4δ[n-3] -4δ[n-4] -……
Unit Step Function
x[n] = 2u[n] – 6u[n-2]
20
Unit Ramp Function
› The unit-ramp function is defined
as

k1 = -5;
k2 = 10;
k = k1:k2;

Kp = (k>=0);
Kpp=Kp.*k
ur=Kpp;
stem(k, ur)

xlabel('k')
ylabel(‘u_r'
)
title('Unit Rampe sequence')
21
axis([k1 k2 –max(k) max(k)])
Power Function
› Power functions take the form:

x[n] = Aα βn

› In the special case where α = e, such functions are called exponential


functions.

› When β is positive, the function grows.

› When β is negative the function decays.

› When α is negative, the signal samples alternate positive and


negative.

› The value of A is determine the magnitude/amplitude/value of the


function when n = 0
22
Power Function

xe,k  X e a k
Matlab Code xe,k = Xe ak
0.8
Xe = 0.8;
a = 0.75;
0.6
k1 = 0;
k2 = 10;
k = k1:k2; 0.4
xe

x = Xe*a.^k;
0.2

stem(k, x)
xlabel('k') 0
ylabel('x_e') 0 2 4 6 8 10
k
title('x_{e,k} = X_e a^k')
Exponential Function
› Exponential functions take the form:

x[n] = Ae βn

› Where e = 2.71828
› When β is positive, the function grows.
› When β is negative the function decays.
› When e is negative, the signal samples alternate positive and
negative.
› The value of A is determine the
magnitude/amplitude/value of the function when n = 0

24
Exponential Function

› Example: Draw a signal x[n] = e-0.5n

25
Sinusoidal Sequence
The sinusoidal functions take the form

x[n] = Asin(nΩ + φ) or x[n] = Acos(n Ω + φ) for all n with real


A.

where Ω is a digital frequency in radians and φ is a phase shift.


Composite Functions
› They are the combinations of basic functions.

› This give flexibility in defining digital signals.

› To evaluate a composite function, each basic function (such as

unit impulse, unit step, power, sinusoidal etc) is constructed

first, then the basic signals are multiplied, added or

subtracted, as required.

27
Composite Functions

Example: Draw a signal x[n] = u[n]u[3-n]

The signal can also be expressed as a


sum of Impulse functions.

𝒙 𝒏 = 𝜹 𝒏 + 𝜹 𝒏 − 𝟏 + 𝜹 𝒏 − 𝟐 + 𝜹[𝒏
− 𝟑]

28
Composite Functions
Example: Draw a signal x[n] = 0.5e-0.2nsin(nπ/9)u[n]
First draw three basic signals and then multiply to get the resultant
damped sinusoid signal as shown in the figure.

× =

29
II- Generation of Digital Signals
Example:

Solution
a)

30
Generation of Digital Signals

b) The first five sample values for part (1) are calculated
and plotted in the Figure.

31
Generation of Digital Signals
b) The first eight sample values for part (2) are calculated
and plotted in the Figure.

32
III- Linear, Time-Invariant, Causal Systems

› In this part, we
study:

– Linearity

– Time invariance

– Causality
Linear System
› The Linear system output due to the weighted sum inputs
∝𝑥1(𝑛) + 𝛽𝑥2(𝑛) is equal to the same weighted sum of the
individual outputs obtained from their corresponding inputs,
that is, 𝑦(𝑛) = ∝𝑦1(𝑛) + 𝛽𝑦2(𝑛), where ∝ and 𝛽 are constants.

𝑦1(𝑛) is the system output using an input 𝑥1(𝑛)


𝑦2(𝑛) the system output with an input 𝑥2(𝑛) 34
Testing for Linearity
Example: A digital amplifier is represented by 𝑦(𝑛) = 10𝑥(𝑛),
the input is multiplied by 10 to generate the output.

35
Testing for Linearity

36
Testing for Linearity

Example

37
Time-Invariant System

38
Time-Invariant System
Example: Determine whether the linear
system y(𝑛) = 2𝑥(𝑛 − 5) is time
invariant.

39
Time-Invariant System

40
Causality and Stability

+¿
Causal System
Example: Determine whether the following systems are causal
or not.

Solution

1) Causal
2) Non-causal

43
BIBO System
› Example
Difference Equations and Impulse
Responses
Examples
Difference Equations and Impulse
Responses

› A linear time-invariant system can be completely


described

by its unit-impulse response, which is defined as the

system response to the impulse input δ(n) with zero initial

conditions.
Difference Equations and Impulse
Responses
Example
Difference Equations and Impulse
Responses
Solution
Difference Equations and Impulse
Responses
Solution
Signal Shifting

n
01234 5

Time- Delay  “Happens later”


delay

0 3 n

Time-advance
Advance  “Happens earlier”

 0 n
Time Reversal and Shifting

n
01234 5

Folding Time Reversal

 0 n

Shifting
Folding &Shifting

 n
Periodic Replication With Distortion
“Shift and
Period of
Add”
repetition is
smaller than the
duration of Distortion free
repeated zone
sequence

Solid lines above are envelopes of samples


Discrete-Time System Properties
Understanding the Convolution Sum
Graphical Approach of Convolution
The steps involved in using the graphical approach are as follows:

1. Plot both sequences, x(k) and h(k), as functions of k.

2. Choose one of the sequences, say h(k), and time-reverse it to form the
sequence h(-k).

3. Shift the time-reversed sequence by n. [Note: If n > 0, this corresponds to


a shift to the right (delay),whereas if n < 0, this corresponds to a shift to the
left (advance).]

4. Multiply the two sequences x(k) and h(n - k) and sum the product for all
values of k. The resulting value will be equal to y(n). This process is repeated
for all possible shifts, n.
Graphical Illustration of Convolution
Graphical Illustration of Convolution
Graphical Illustration of Convolution
Graphical Illustration of Convolution
Graphical Illustration of Convolution

No Overlap
for n < 0
Graphical Illustration of Convolution

Partial Overlap
Graphical Illustration of Convolution

Partial Overlap
Graphical Illustration of Convolution

Partial Overlap
Graphical Illustration of Convolution

Full Overlap
Graphical Illustration of Convolution

Full Overlap
Graphical Illustration of Convolution

Full Overlap
Graphical Illustration of Convolution

Partial Overlap
Graphical Illustration of Convolution

Partial Overlap
Graphical Illustration of Convolution

Partial Overlap
Graphical Illustration of Convolution

No Overlap
for n > 0
Summary of Graphical Illustration
Example
Solution: a) Graphical method
Solution
B- Using the table method
Solution
C- Using the convolution formula
Summary of Convolution Properties

“Area”-based Output Scaling


A Simple Function for Convolution
MATLAB convolution
function
Sample-by-sample y=conv(h,x)
processing

Block
processing
Book Toolbox Functions

You might also like