Digital Signal Processing: Lecture 3 - 4

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 35

Digital Signal Processing

Lecture 3 – 4

1
Analog to Digital Conversion
To process analog signals by digital means, it is necessary
to convert them into digital form, that is to convert them
to a sequence of no: having finite precision. This process is
called A/D conversion.
• A/D conversion can be viewed as a three step process

1. Sampling: This is the conversion of a continuous time


signal into a discrete time signal obtained by taking
“samples” of the continuous time signal at discrete time
instants. Thus, if x(t) is the input to the sampler, the output is
x(nT), where T is called the Sampling interval.
At each sampling point, the analog signal is sampled, and value
of signal is held steady until the next sampling point. This
process is called ‘sample and hold’. The act of sampling takes a
finite amount of time called ‘ Acquisition time’. 2
 This is conversion of discrete time continuous valued signal
Into a discrete time discrete valued signal. The value of each
signal sample is represented by a value selected from a finite set
of possible values. The difference between un-quantized sample
and the quantized output is called the quantization error.

- quantization levels =
N-bit binary number

More quantization levels =


Less quantization error.

3
3. Coding: In the coding process, each discrete value is
represented by a b-bit binary sequence.

x(t) 0101...
Sampler Quantizer Coder

A/D Converter

4
Sampling of Analog Signals
Uniform Sampling:

1 1
0.8 0.8
0.6 0.6

sampled signal
analog signal

0.4 0.4
0.2 0.2
0 0
-0.2 -0.2
-0.4 -0.4
-0.6 -0.6
-0.8 -0.8
-1 -1
0 2 4 6 0 2 4 6 5
t n
Uniform sampling
• Uniform sampling is the most widely used sampling scheme.

- This is described by the relation


x[n] = x[nT] - <n<
where x(n) is the discrete time signal obtained by taking
samples of the analogue signal x(t) every T seconds.
- The time interval T between successive symbols is called the
Sampling Period or Sampling interval and its reciprocal 1/T =
Fs is called the Sampling Rate (samples per second) or the
Sampling Frequency (Hertz).
- A relationship between the time variables t and n of
continuous time and discrete time signals respectively, can be
obtained as n
t  nT  (1) 6
Fs
• A relationship between the analog frequency F and the
discrete frequency f may be established as follows.
Consider an analog sinusoidal signal
x(t) = Acos(2Ft + )
which, when sampled periodically at a rate Fs = 1/T samples
per second, yields
 2nF 
x[nT]  A cos 2FnT     A cos    (2)
 Fs 

But a discrete sinusoid is generally represented as

x[n]  A cos 2fn    (3)


Comparing (2) and (3) we get
F
f  (4)
Fs
7
Since the highest frequency in a discrete time signal is f = ½.
Therefore, from (4) we have
Fs 1
Fmax   (5)
2 2T

or

(6)
Fs = 2 Fmax

Sampling Theorem:
If x(t) is bandlimited with no components of frequencies greater
than Fmax Hz, then it is completely specified by samples taken at
the uniform rate Fs > 2Fmax Hz.
The minimum sampling rate or minimum sampling frequency,
Fs = 2Fmax, is referred to as the Nyquist Rate or Nyquist
Frequency. The corresponding time interval is called the Nyquist
8
Sampling Theorem (cont.)
• Signal sampling at a rate less than the Nyquist rate is
referred to as undersampling.
• Signal sampling at a rate greater than the Nyquist rate is
known as the oversampling.

Example 1:
The following analogue signals are sampled at a sampling
frequency of 40 Hz. Find the corresponding discrete time
Signals.
(i) x(t) = cos2(10)t (ii) y(t) = cos2(50)t
Solution:

(i) x[n]  cos 2 40 n  cos 2 n
10
   
(ii)  50  5 
x[n]  cos 2 n  cos n  cos n
 40  2 2
Note: The frequency F2 = 50 Hz is an alias of F1 = 10 Hz. All of the
9
sinusoids cos2(F1 + 40k)t, k = 1,2,3,… are aliases.
Example 2
Consider the analog signal
x(t) = 3cos100t
(a) Determine the minimum required sampling rate to
avoid aliasing.
(b) Suppose that the signal is sampled at the rate Fs =
200 Hz. What is the discrete time signal obtained
after sampling?
Solution:
(c) The frequency of the analog signal is F = 50 Hz.
Hence the minimum sampling rate to avoid aliasing
is 100Hz.
100 
(b) x[n]  3 cos n  3 cos n
200 2

10
Example 3
Consider the analog signal
x(t) = 3cos50t + 10sin300t - cos100t
What is the Nyquist rate for this signal.
Solution:
The frequencies present in the signal above are
F1 = 25 Hz, F2 = 150 Hz F3 = 50 Hz.
Thus Fmax = 150 Hz.
\ Nyquist rate = 2.Fmax = 300 Hz.
Note: It should be observed that the signal component
10sin300t, sampled at 300 Hz results in the samples
10sinn, which are identically zero, hence we miss the signal
component completely.
What should we do to avoid this situation????

11
Tutorial 3
Q1: Find the minimum sampling rate that can be used to obtain samples
that completely specify the signals:
(a) x(t) = 10cos(20t) – 5cos(100t) + 20cos(400t)
(b) y(t) = 2cos(20t) + 4sin(20t - /4) + 5cos(8t)

Q2: Consider the analog signal


x(t) = 3cos2000t + 5sin6000t + 10cos12000t
(a) What is the Nyquist rate for this signal?
(b) Assume now that we sample this signal using a sampling rate F s =
5000 samples/s. What is the discrete time signal obtained after sampling?

Q3: An analog electrocardiogram (ECG) signal contains useful frequencies


up to 100 Hz. What is the Nyquist rate for this signal?

12
Discrete time signals
• A discrete time signal x(n) is a function of an
independent variable that is an integer. (it is set
of numbers). It is graphically represented as:
2

1.5

0.5

-0.5

-1
-4 -3 -2 -1 0 1 2 3 4 5

• It is important to note that a discrete time


signal is not defined at instants between two
successive samples. 13
•• Also
  it is incorrect to think that x(n) is equal to zero if n
is not an integer. Simply x(n) is not defined for non-
integer values of n.
• Besides graphical representation of a D.T signal, there
are some alternative representations that are often
more convenient.

• 1- functional representation

14
•• 2-
  Tabular representation

• 3- Sequence representation
• An infinite duration sequence with time origin (n=0) is
indicated as: x(n) = {…,0,0,1,4,1,0,0,…}

• A sequence which is zero for n<0, can be represented


as: x(n) = {0,1,4,1,0,0,…}

• A finite duration sequence can be represented as:


x(n) ={3, -1, -2, 5, 0, 4, 1}

15
Some Elementary Discrete Time signals
• These are basic signals that appear and play important role
in Discrete time signals and systems.
• Sinusoid is an important elementary signal that serves as a
basic building block in more complex signals. However there
are other signals which are important in our treatment of
signal processing.
• These D.T signals are used as a basic building block to
describe more complex signals.

• Unit Impulse or unit sample sequence:


It is defined as
1, n 0
 n   
0 n  0

16
In words, the unit sample sequence is a signal that is
zero everywhere, except at t = 0.

17
Some Elementary Discrete Time signals
• Unit step signal
It is defined as
1, n0
u[n ]  
0 n0

2
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2
00 1 2 3 4 5 6 7
18
Some Elementary Discrete Time signals
• Unit Ramp signal
It is defined as
n, n  0
r[n]  
0 n  0

6
5
4
3
2
1
00 1 2 3 4 5 6 19
Some Elementary Discrete Time signals
• Exponential Signal
The exponential signal is a sequence of the form
x[n] = an, for all n
If the parameter a is real, then x[n] is a real signal.
The following figure illustrates x[n] for various
values of a.

0<a<1 a>1

-1<a<0 a<-1

20
Some Elementary Discrete Time signals
• Exponential Signal (cont)
when the parameter a is complex valued, it can be expressed
as
j
a  re
where r and  are now the parameters. Hence we may
express x[n] as
x[n]  r n e nj  r n  cos n  j sin n 
Since x[n] is now complex valued, it can be represented
graphically by plotting the real part
x R [n]  r cos n
n

as a function of n, and separately plotting the imaginary part


x I [n]  r n sin n
as a function of n. (see plots on the next slide)
21
1
xR[n] = (0.9)ncos(n/10)
0.5

-0.5
0 10 20 30 40 50 60
1
xI[n] = (0.9)nsin(n/10)
0.5

-0.5
0 10 20 30 40 50 60
22
Exponential Signal (cont.)
Alternatively, the signal x[n] may be graphically
represented by the amplitude or magnitude function
|x[n]| = rn
and the phase function
[n] = n
The following figure illustrates |x[n| and [n] for r =
0.9 and  = /10.
|x[n]|

0- 0 5 10
4
[n]

0
-2- 0 5 10 23
n
Discrete Time Systems

• A discrete time system is a device or algorithm that operates


on a discrete time signal x[n], called the input or excitation,
according to some well defined rule, to produce another
discrete time signal y[n] called the output or response of the
system.
• We express the general relationship between x[n] and y[n] as
y[n] = H{x[n]}
where the symbol H denotes the transformation (also called
an operator), or processing performed by the system on x[n]
to produce y[n].

x[n] Discrete Time System y[n]


H
24
Example 4
• Determine the response of the following
systems to the input signal:
| n |, 3n 3
x[n]  
 0, otherwise
(a) y[n] = x[n]
(b) y[n] = x[n-1]
(c) y[n] = x[n+1]
(d) y[n] = (1/3)[x[n+1] + x[n] + x[n-1]]
(e) y[n] = max[x[n+1],x[n],x[n-1]]
n

(f) y[n]   x[k ]


k  

25
• Solution:
(a) In this case the output is exactly the same as the input
signal. Such a system is known as the identity System.
(b) y[n] = [……,3, 2, 1, 0, 1, 2, 3,……]

(c) y[n] = […….,3, 2, 1, 0, 1, 2, 3,…….]

(d) y[n] = […., 5/3, 2, 1, 2/3, 1, 2, 5/3, 1, 0,…]

(e) y[n] = [0, 3, 3, 3, 2, 1, 2, 3, 3, 3, 0, ….]

(f) y[n] = […,0, 3, 5, 6, 6, 7, 9, 12, 12, …]

26
Classification of Discrete Time Systems
• Static versus Dynamic Systems

A discrete time system is called static or memory-less if its


output at any instant n depends at most on the input sample
at the same time, but not on the past or future samples of the
input. In any other case, the system is said to be dynamic or
to have memory.

Examples: y[n] = x2[n] is a memory-less system, whereas the


following are the dynamic systems:
(a) y[n] = x[n] + x[n-1] + x[n-2]
(b) y[n] = 2x[n] + 3x[n-4]
27
Time Invariant versus Time Variant Systems
• A system is said to be time invariant if a time delay or time
advance of the input signal leads to an identical time shift in
the output signal. This implies that a time-invariant system
responds identically no matter when the input is applied.
Stated in another way, the characteristics of a time invariant
system do not change with time. Otherwise the system is said
to be time variant.
• Example1: Determine if the system shown in the figure is
time invariant or time variant.
Solution: y[n] = x[n] – x[n-1] x[n] y[n]
Now if the input is delayed by k units +
in time and applied to the system, the -
Output is Z-1
y[n,k] = n[n-k] – x[n-k-1] (1)
On the other hand, if we delay y[n] by k units in time, we obtain
y[n-k] = x[n-k] – x[n-k-1] (2)
(1) and (2) show that the system is time invariant. 28
Time Invariant versus Time Variant Systems
• Example 2: Determine if the following systems are time invariant or
time variant.
(a) y[n] = nx[n] (b) y[n] = x[n]cosw0n
Solution:
(a) The response to this system to x[n-k] is
y[n,k] = nx[n-k] (3)
Now if we delay y[n] by k units in time, we obtain
y[n-k] = (n-k)x[n-k]
= nx[n-k] – kx[n-k] (4)
which is different from (3). This means the system is time-variant.
(b) The response of this system to x[n-k] is
y[n,k] = x[n-k]cosw0n (5)
If we delay the output y[n] by k units in time, then
y[n-k] = x[n-k]cosw0[n-k]
which is different from that given in (5), hence the system is time
variant.

29
Tutorial 4
Q4: Determine whether the following
systems are time invariant or time
variant.
(a) y[n] = y[n-1] + 2x[n] – 3x[n-1] + 2x[n-2]
(b) y[n] – (y[n-2])/n = 2x[n]

30
Linear versus Non-linear
Systems
A system H is linear if and only if
H[a1x1[n] + a2x2[n]] = a1H[x1[n]] + a2H[x2[n]]
for any arbitrary input sequences x1[n] and x2[n], and any
arbitrary constants a1 and a2.
a1
x1[n]
y1[n]
a2 + H
x2[n]
a1
x1[n] H
y2[n]
+
a2
x2[n] H

If y1[n] = y2[n], then H is linear. 31


Examples
Determine if the following systems are linear or nonlinear.
(a) y[n] = nx[n]
Solution:
For two input sequences x1[n] and x2[n], the corresponding
outputs are
y1[n] = nx1[n] and y2[n] = nx2[n]
A linear combination of the two input sequences results in the
output
H[a1x1[n] + a2x2[n]] = n[a1x1[n] + a2x2[n]] = na1x1[n] + na2x2[n] (1)
On the other hand, a linear combination of the two outputs results in
the out
a1y1[n] + a2y2[n] = a1nx1[n] + a2nx2[n] (2)
Since the right hand sides of (1) and (2) are identical, the system is
linear.
32
(b) y[n] = Ax[n] + B
Solution:
Assuming that the system is excited by x1[n] and x2[n] separately, we
obtain the corresponding outputs
y1[n] = Ax1[n] + B and y2[n] = Ax2[n] + B
A linear combination of x1[n] and x2[n] produces the output
y3[n] = H[a1x1[n] + a2x2[n]] = A[a1x1[n] + a2x2[n]] + B
= Aa1x1[n] + Aa2x2[n] + B (3)
On the other hand, if the system were linear, its output to the linear
combination of x1[n] and x2[n] would be a linear combination of y1[n]
and y2[n], that is,
a1y1[n] + a2y2[n] = a1Ax1[n] + a1B + a2Ax2[n] + a2B (4)
Clearly, (3) and (4) are different and hence the system is nonlinear.
Under what conditions would it be linear?

Tutorial 2 Q5: Determine whether the systems of Tutorial 4 Q4 are


linear.

33
Causal versus Noncausal Systems
A system is said to be causal if the output of the system at
any time n [i.e. y[n]) depends only on present and past
inputs but does not depend on future inputs.

Example: Determine if the systems described by the


following input-output equations are causal or
noncausal.
n
(a) y[n] = x[n] – x[n-1] (b) y[n] = ax[n] (c) y[n]   x[k ]
k  
(d) y[n] = x[n] + 3x[n+4] (e) y[n] = x[n2]
(f) y[n] = x[-n]
Solution: The systems (a), (b) and (c) are causal,
others are non-causal.

34
Stable versus Nonstable Systems

A system is said to be bounded input


bounded output (BIBO) stable if and only
if every bounded input produces a
bounded output.

35

You might also like