DSP Chapter One

Download as pdf or txt
Download as pdf or txt
You are on page 1of 100

Digital Signal Processing

Chapter-1

Discrete-Time Signals and Systems


Overview
❖Introduction to digital signal processing
❖Time domain Sampling
✓ Sampling and Reconstruction
✓ Quantization and Encoding
✓Analog to Digital Converters(ADC) and Digital
to Analog Converters (DAC)
❖Discrete time systems

2
Introduction to digital signal
processing

3
Analog vs. Digital Signal Processing

Analog input Signal x(t) Analog output Signal y(t)


Analog
Signal Processor

Analog Signal Processing

Analog input Analog output


Signal x(t) Signal y(t)
Analog-to-Digital Digital D/A
converter Signal Processor converter

Digital Signal Processing


4
Typical Digital Signal Processing System

It consists of
• an analog filter called (anti-imaging) filter,
• an analog-to-digital conversion (ADC) unit,
• a digital signal (DS) processor,
• a digital-to-analog conversion (DAC) unit,
• and an analog filter called reconstruction (anti-image) filter.

5
Typical Digital Signal Processing System

6
Digital vs analog processing Digital

7
DSP…

8
Applications

9
Time domain Sampling

10
A/D & D/A Conversion

11
Analog to Digital (A/D) Conversion

• Most signals of practical interest are analog in nature


Examples: Voice, Video, RADAR signals, Transducer/Sensor
output, Biological signals etc

• So in order to utilize those benefits, we need to convert our


analog signals into digital

• This process is called Analog-to-Digital (A/D) conversion

12
Analog to Digital Conversion
A/D conversion can be viewed as a three step process

13
Analog to Digital Conversion
A/D conversion can be viewed as a three step process

14
Analog to Digital Conversion
Sample & Hold (Sampler)

• Analog signal is continuous in time and continuous in


amplitude.

• It means that it carries infinite information of time and infinite


information of amplitude.

• Analog (continuous-time) signal has some value defined at


every time instant, so it has infinite number of sample points.

15
Analog to Digital Conversion
Sample & Hold (Sampler)

• It is impossible to digitize an infinite number of points.

• The infinite points cannot be processed by the digital signal


(DS) processor or computer, since they require an infinite
amount of memory and infinite amount of processing power
for computations.

• Sampling is the process to reduce the time information or


sample points.

16
Analog to Digital Conversion
Sample & Hold (Sampler)

• The first essential step in analog-to-digital (A/D) conversion is


to sample an analog signal.

• This step is performed by a sample and hold circuit, which


samples at regular intervals called sampling intervals.

• Sampling can take samples at a fixed time interval.

• The length of the sampling interval is the same as the


sampling period, and the reciprocal of the sampling period is
the sampling frequency fs.
17
Analog to Digital Conversion
Sample & Hold (Sampler)

• After a brief acquisition time, during which a sample is


acquired, the sample and hold circuit holds the sample steady
for the remainder of the sampling interval.
• The hold time is needed to allow time for an A/D converter to
generate a digital code that best corresponds to the analog
sample.
• If x(t) is the input to the sampler, the output is x(nT), where T
is called the sampling interval or sampling period.
• After the sampling, the signal is called “discrete time
continuous signal” which is discrete in time and continuous in
amplitude.
18
Analog to Digital Conversion
Sample & Hold (Sampler)
Figure below shows an analog (continuous-time) signal (solid
line) defined at every point over the time axis (horizontal line)
and amplitude axis (vertical line).
Hence, the analog signal contains an infinite number of points.

19
Analog to Digital Conversion
Sample & Hold (Sampler)
• Each sample maintains its voltage level during the sampling
interval 𝑻 to give the ADC enough time to convert it.
• This process is called sample and hold.

20
Nyquist–Shannon Sampling Theorem

The sampling theorem guarantees that an analogue signal can be


perfectly recovered as long as the sampling rate is at least twice
as large as the highest-frequency (Fmax) component of the
analogue signal to be sampled.

21
Nyquist–Shannon Sampling Theorem

22
Nyquist–Shannon Sampling Theorem

Examples

23
Nyquist–Shannon Sampling Theorem
Example: For the following analog signal, find the Nyquist sampling
rate, also determine the digital signal frequency and the digital signal

24
Nyquist–Shannon Sampling Theorem

Example: Find the sampling frequency of the following signal.

So sampling frequency should be

25
Nyquist–Shannon Sampling Theorem

Exercise

Determine the Nyquist sampling rate of a signal


x(t) = 3sin(5000t + 17o)

26
Aliasing
• When the minimum sampling rate is not respected, distortion
called aliasing occurs.

• Aliasing causes high frequency signals to appear as lower


frequency signals.

• To be sure aliasing will not occur, sampling is always preceded


by low pass filtering.

• The low pass filter, called the anti-aliasing filter, removes all
frequencies above half the selected sampling rate.

27
Aliasing
• Figure illustrates sampling a 40 Hz sinusoid
• The sampling interval between sample points is T = 0.01 second,
and the sampling rate is thus fs = 100 Hz.
• The sampling theorem condition is satisfied

28
Aliasing
• Figure illustrates sampling a 90 Hz sinusoid
• The sampling interval between sample points is T = 0.01 second,
and the sampling rate is thus fs = 100 Hz.
• The sampling theorem condition is not satisfied

29
Aliasing

30
Anti Aliasing Filter
• A signal with no frequency component above a certain
maximum frequency is known as a band-limited signal.

• In our case we want to have a signal band-limited to ½ Fs.

• Some times higher frequency components (both harmonics


and noise) are added to the analog signal (practical signals are
not band-limited).

• In order to keep analog signal band-limited, we need a filter,


usually a low pass that stops all frequencies above ½ Fs.

• This is called an “Anti-Aliasing” filter. 31


Anti Aliasing Filter
• Anti-aliasing filters are analog filters.

• They process the signal before it is sampled.

• In most cases, they are also low-pass filters unless band-pass


sampling techniques are used.

32
Under Sampling
• If the sampling rate is lower than the required Nyquist rate, that
is fS < 2W, it is called under sampling.

• In under sampling images of high frequency signals incorrectly


appear in the baseband (or Nyquist range) due to aliasing.

33
Sampling of Band Limited Signals

Signals whose frequencies are restricted to a narrow band of


high frequencies can be sampled at a rate similar to twice the
Bandwidth (BW) instead of twice the maximum frequency.

Fs ≥ 2BW

34
Sampling of Band Limited Signals
• While this under-sampling is normally avoided, it can be
exploited.
• For example, in the case of band limited signals all of the
important signal characteristics can be deduced from the copy
of the spectrum that appears in the baseband through
sampling.
• Depending on the relationship between the signal frequencies
and the sampling rate, spectral inversion may cause the shape
of the spectrum in the baseband to be inverted from the true
spectrum of the signal.

35
Sampling of Band Limited Signals

Figure: Signal recovered


From Nyquist range are
Base band versions of the
Original signal. Sampling rate is
Important to make sure no aliasing
and spectral inversion occurs.

(a) Fs = 80 kHz, signal spectrum


is Inverted in the baseband.

(b) Fs = 100 kHz, the lowest


Frequencies In the signal alias
to the highest frequencies.

(c) Fs = 120 kHz, No spectral


36
Inversion occurs.
Over Sampling
• Oversampling is defined as sampling above the minimum
Nyquist rate, that is, fS > > 2fmax.

• Oversampling is useful because it creates space in the


spectrum that can reduce the demands on the analog anti-
aliasing filter.

37
Over Sampling
• In the example below, 2x oversampling means that a low order analog filter is
adequate to keep important signal information intact after sampling.
• After sampling, higher order digital filter can be used to extract the information.

38
Over Sampling
• The ideal filter has a flat pass-band and the cut-off is very sharp,
since the cut-off frequency of this filter is half of that of the
sampling frequency, the resulting replicated spectrum of the
sampled signal do not overlap each other. Thus no aliasing
occurs.
• Practical low-pass filters cannot achieve the ideal
characteristics.
• Firstly, this would mean that we have to sample the filtered
signals at a rate that is higher than the Nyquist rate to
compensate for the transition band of the filter

39
Spectra of Sampled signals

Figure: Signal ‘s Spectra


(i) Over sampled
(ii) Nyquest Rate
(iii) Under Sampled

40
Sampling Low Pass Signals

41
Exercise
Exercise-1: If the 20 kHz signal is under-sampled at 30 kHz, find the aliased
frequency of the signal.

Exercise-2: A voice signal is sampled at 8000 samples per second.


i. What is the time between samples?
ii. What is the maximum frequency that will be recovered from the signal?

Exercise-3: An analog Electromyogram (EMG) signal contains useful


frequencies up to 3000 Hz.
i. Determine the minimum required sampling rate to avoid aliasing.
ii. Suppose that we sample this signal at a rate of 6500 samples/s. what is
the highest frequency that can be represented uniquely at this sampling
rate?

42
Exercise
Exercise-4: Humans can hear sounds at frequencies between 0 and 20 kHz.
What minimum sampling rate should be chosen to permit perfect recovery
from samples?

Exercise-5: An ECG signal is sampled at 250 samples per second.


i. What is the time between samples?
ii. What is the maximum frequency that will be recovered from the signal?

Exercise-6: An ultrasound signal ranging in frequency from 900 kHz to 900.5


kHz is under-sampled at 200 kHz. If a 200 Hz target appears in the baseband,
what is the actual frequency of the target?

43
Analog to Digital Conversion
Quantizer

• After the sampling, the discrete time continuous signal still


carry infinite information (can take any value) in terms of
amplitude.

• Quantization is the process to reduce infinite information of


the amplitude.

• Quantizer do the conversion of discrete time continuous


valued signal into a discrete-time discrete-value signal.

• The value of each signal sample is represented by a value


selected from a finite set of possible values.
44
Analog to Digital Conversion
Quantizer

• The A/D converter chooses a quantization level for each


analog sample.

• Number of levels of quantizer is equal to L = 2N

• An N-bit converter chooses among 2N possible quantization


levels.

• So 3 bit converter has 8 quantization levels, and 4 bit


converter has 16 quantization levels.
45
Analog to Digital Conversion
The quantization step size or resolution is calculated as:
Δ = Q = R/2N
where
R is the full scale range of the analog signal (i.e. Ymax - Ymin)
N is the number of bits used by the converter

• Resolution of a quantizer is the distance between two


successive quantization levels
• More quantization levels, a better resolution!
• What's the downside of more quantization levels?

The strength of the signal compared to that of the quantization


errors is measured by dynamic range and signal-to-noise ratio.
46
Analog to Digital Conversion
4-bit Quantizer

47
Analog to Digital Conversion
4-bit Quantizer

48
Quantization Error
• The error caused by representing a continuous-valued signal
(infinite set) by a finite set of discrete-valued levels.

• The larger the number of quantization levels, the smaller the


quantization errors.

• The quantization error is calculated as the difference between


the quantized level and the true sample level.

• Most quantization errors are limited in size to half a


quantization step Q or Δ .
49
Quantization Error
• Suppose a quantizer operation given by Q(.) is performed on
continuous-valued samples x[n] is given by Q(x[n], xq[n]), then
the quantization error is given by

50
Analog to Digital Conversion
• Lets consider the signal which is to be quantized.

In the figure, we can see that there is a difference between the


original signal (Blue Line) and the quantized signal (Red Lines).
This is the error produced while quantization
51
Analog to Digital Conversion
Quantization error can be reduced, however, if the number of
quantization levels is increased as illustrated in the figure

52
Analog to Digital Conversion
Quantization of unipolar data (maximum error = full step)

53
Analog to Digital Conversion
Quantization of unipolar data (maximum error = half step)

54
Analog to Digital Conversion
Example: Analog pressures are recorded using a pressure transducer as
voltages between 0 and 3 V. The signal must be quantized using a 3-bit
digital code. Indicate how the analog voltages will be covered to digital
values.

The quantization step size is


Q = 3 V/23 = 0.375 V

The half of quantization step is


0.1875 V

55
Analog to Digital Conversion
Quantization of bipolar data (maximum error = half step)

56
Three-bit A/D Conversion

57
Dynamic Range
• Quantization errors can be determined by the quantization
step.
• Quantization errors can be reduced by increasing the number
of bits used to represent each sample.
• Unfortunately these errors can not be entirely eliminated and
their combined effect is called quantization noise.

• The dynamic range of the quantizer is the number of levels it


can distinguish in noise.
• It is a function of the range of signal values and the range of
error values, and is expressed in decibels, dB.
𝑅
• 𝐷𝑦𝑛𝑎𝑚𝑖𝑐 𝑅𝑎𝑛𝑔𝑒 = 20𝑙𝑜𝑔2
𝑄
58
Signal-to-Quantization-Noise Ratio

• Provides the ratio of the signal power to the quantization


noise (or quantization error),

• Mathematically the signal-to-quantization noise ratio (SQNR),

where
• Px= Power of the signal ‘x’ (before quantization)
• Pq= Power of the error signal ‘xq’
59
Analog to Digital Conversion

60
2 bit Flash ADC

61
Digital-to-Analog (D/A) Conversion

Block Diagram of D/A Conversion

62
Digital-to-Analog (D/A) Conversion

• Once digital signal processing is complete, digital-to-analog


(D/A) conversion must occur.
• This process begins by converting each digital code into an
analog voltage that is proportional in size to the number
represented by the code.
• This voltage is held steady through zero order hold until the next
code is available, one sampling interval later.
• This creates a staircase-like signal that contains frequencies
above W Hz.
• These signals are removed with a smoothing analog low pass
filter, the last step in D/A conversion.
63
Digital-to-Analog (D/A) Conversion

• In the frequency domain, the high frequency elements


present in the zero order hold signal appear as images, copies
of the original signal spectrum situated around integer
multiples of the sampling frequency.

• The smoothing analog filter removes these images and so is


given the name of Anti-Imaging Filter.

• Only the frequencies in the baseband, between 0 and fS/2 Hz,


remain.

64
Digital-to-Analog (D/A) Conversion
Three bit D/A Conversion

65
Comparing Signals in the A/D & D/A Chain

66
Comparing Signals in the A/D & D/A Chain

67
Discrete-Time Signals and Systems

68
Discrete-Time Signals
• A signal defined only for discrete values of time is called a
discrete-time (DT) signal or simply a discrete signal

• Discrete signal can be obtained by taking samples of an analog


signal at discrete instants of time

• Digital signal is a discrete-time signal whose values are


represented by digits

69
Discrete-Time Signals
• Figure (a): CT Signal
• Figure (b): DT Signal

• Examples of DT signals in nature:


• DNA base sequence
• Number of students in a class
• Population of the nth generation of certain species 70
Digital Functions
The basic digital functions (signal or sequence) are

• Unit Impulse Function


• Unit Step Function
• Unit Ramp Function
• Power Function
• Exponential Function
• Sine Function

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

72
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.

73
Unit Impulse Function
Example:

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

74
Unit Step Function
The unit step function or unit step sequence is defined as the
sequence with values

75
Unit Step Function
Example:
x[n] = u[n] - u[n - 3]

76
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])

77
Unit Ramp Function

• The unit-ramp function is defined as

78
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

79
Power Function
• Example: x[n] = (-0.6)n

80
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 α 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

81
Exponential Function
• Example: x[n] = e-0.5n

82
Complex Exponential Function
• A digital signal of the form

x[n] = Aejβn

is called a complex exponential function.

• For all n, samples of this signal lie in the complex plane on a


circle with radius A.

• By Euler’s identity, a complex exponential may be expressed


as a rectangular-form complex number
eβn= cosβn + jsinβn
83
Sinusoidal Sequence
The sinusoidal functions take the form

x[n] = Asin(nW + q) or x[n] = Acos(nW + q) for all n with real A.

where W is a digital frequency in radians and q is a phase shift.

84
Sinusoidal Sequence
Example: x[n] = 3sin(nπ/8)

85
Linear System

• A linear system is illustrated in the figure.


• The linear system obeys the superposition principle.
• 𝑦1(𝑛) is the system output using an input 𝑥1(𝑛)
• 𝑦2(𝑛) the system output with an input 𝑥2(𝑛)

86
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.

87
Linear System

Example: A digital amplifier is represented by 𝑦(𝑛) = 10𝑥(𝑛), the


input is multiplied by 10 to generate the output.

88
Linear System

89
Linear System

90
Time-Invariant System

A time-invariant system is illustrated in the figure.

91
Time-Invariant System

92
Time-Invariant System

Example: Determine whether the linear system y(𝑛) = 2𝑥(𝑛) − 5


is time invariant.

93
Time-Invariant System

94
Time-Invariant System

Example: Determine whether the linear system y(𝑛) = 2𝑥(3𝑛)


is time invariant.

N:B A Linear Time Invariant (LTI) System obey both the


characteristics of both linearity and Time Invariance.

95
Causal System

96
Causal System

Example: Determine whether the following systems are causal or not.

Solution

1) Causal
2) Non-causal

97
Summary

98
Summary

99
End of Chapter-1

100

You might also like