Unit 1
Unit 1
PROCESSING- WEEK 2
Syllabus Overview
• Learning Unit / Module 1: Signals and Waveforms
• Learning Unit / Module 2: Frequency
Transformations
• Learning Unit / Module 3: FIR Filters
Examples
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
Nyquist–Shannon Sampling Theorem
Example: Find the sampling frequency of the following signal.
• Generally, people notice when the frame-rate is less than the refresh
rate of the display.
• 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.
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
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
Aliasing
Sampling Effect in Time Domain
Fs ≥ BW
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.
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.
• Mathematically,
where
• P = Power of the signal ‘x’ (before quantization)
x
• P = Power of the error signal ‘x ’
q q
Analog to Digital Conversion
Digital-to-Analog (D/A) Conversion
Block Diagram of D/A Conversion
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.
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.
Digital-to-Analog (D/A) Conversion
Three bit D/A Conversion
Comparing Signals in the A/D & D/A Chain
Comparing Signals in the A/D & D/A Chain
Summary
Summary
Review Questions
a. What is Aliasing
b. Compare undersampling and oversampling
ANSWERS Sampling Low Pass Signals
References:
• https://wiki.seg.org/wiki/Frequency_aliasing
• https://sciencing.com/calculate-alias-frequency-8619254.html#:
~:text=Aliasing%20is%20an%20undesired%20effect,of%20a%
20much%20higher%20frequency.
• National Instruments; Bandwidth, Sample Rate, and Nyquist
Theorem; Sep 6, 2006
• Sound on Sound: Q. What is 'Aliasing' and What's the Cause of
It?
18ECC204J DIGITAL SIGNAL
PROCESSING – WEEK 1
Syllabus Overview
• Learning Unit / Module 1: Signals and Waveforms
• Learning Unit / Module 2: Frequency Transformations
f(t)
t
Data Transmission System
Example : Analog Signal vs Digital Signal
What is Digital Signal Processing?
• DSP
• Process of representing signals in a discrete mathematical
sequence of numbers and analyzing, modifying, and extracting
the information contained in the signal by carrying out
algorithmic operations and processing on the signal.
What is a Digital Signal Processing System?
– Digital: Operating by the use of discrete signals to represent data in the form
of numbers.
– Signal: A signal is anything that carries some information. It’s a physical
quantity that conveys data and varies with time, space, or any other
independent variable. It can be in the time/frequency domain. It can be
one-dimensional or two-dimensional.
– Processing: The performing of operations on any data in accordance with
some protocol or instruction is known as processing.
– System: A system is a physical entity that is responsible for the processing. It
has the necessary hardware to perform the required arithmetic or logical
operations on a signal.
• Both the input signal and the output signal are in analog
form.
• Digital signal processing provides an alternative method
for processing the analog signal.
• To perform the processing digitally, there is a need for an
interface between the analog signal and the digital
processor.
Block Diagram of DSP
DSP System – Operation
• The first step is to get an electrical signal. The transducer (in this case, a microphone) converts sound
into an electrical signal.
• Once you have an analog electrical signal, we pass it through an operational amplifier (Op-Amp) to
condition the analog signal.
• The anti-aliasing filter is an essential step in the conversion of analog to a digital signal. It is a
low-pass filter. Meaning, it allows frequencies up to a certain threshold to pass. It attenuates all
frequencies above this threshold. These unwanted frequencies make it difficult to sample an analog
signal.
• The next stage is a simple analog-to-digital converter (ADC). This unit takes in analog signals and
outputs a stream of binary digits.
• The heart of the system is the digital signal processor. These days we use CMOS chips (even ULSI) to
make digital signal processors. In fact, modern processors, like the Cortex M4 have DSP units built
inside the SoC. These processor units have high-speed, high data throughputs, and dedicated
instruction sets.
DSP System – Operation (Cont’d)
• The next stages are sort of the opposite of the stages preceding the
digital signal processor.
• The digital-to-analog converter does what its name implies. It’s
necessary for the slew rate of the DAC to match the acquisition rate
of the ADC.
• The smoothing filter is another low-pass filter that smoothes the
output by removing unwanted high-frequency components.
• The last op-amp is just an amplifier.
• The output transducer is a speaker in our case. You can use anything
else according to your requirements.
DSP System – Operation (Cont’d)
• The study of the digital representation of signals is known as
digital signal processing.
• It converts all the real world signals into digital form with the
aid of an Analog to Digital Converter.
• On completion of the processing, the digital signal is converted
back to Analog form using Digital to Analog Converter.
Advantages of DSP
• High level of accuracy.
• The filters designed in DSP have firm control over output
accuracy as compared to analog filters.
• Easy Upgradations, Implementation of algorithms
– The reconfiguration in an analog system is very much tough because the
entire hardware and its component will have to be changed. On the
contrary, a DSP reconfiguration is much more comfortable as only the
code, or the DSP program needs to be flashed after making the changes
according to the requirements.
• The interface types offered by DSP are many like UART, 12C,
and others. This helps in interfacing other ICs with the DSP.
Advantages of DSP (Cont’d)
• The combination of DSP interfaced with FPGA helps in designing the
protocol stack of the whole wireless system like WiMAX, LTE, etc. In this
type of architecture, as per the latency requirements, few of the modules
are ported on FPGA and the other few on DSP.
• Implementation in digital is much more cost effective than its analog
counterpart.
• Repeatability
– The digital system in DSP can be easily cascaded without any problems in loading.
– Digital circuits can be easily reproduced in huge quantities cost effectively.
• Accessible transportation is possible because digital signals can be
processed offline.
Advantages of DSP system (Cont’d)
• A digital signal processing system enjoys many benefits over an analog signal processing system.
Some of these advantages are briefly outlined below:
• Less overall noise
– Since the signals are digital and inherently possess a low probability of getting mixed with unwanted signals, the
entire system benefits. Thus, DSPs don’t really have as much noise to deal with comparatively.
• Error detection and correction is possible in DSPs
– Again, the presence of digital signal means we have access to many error detection and correction features. For
example, we can use parity generation and correction as a detection and correction tool.
• Data storage is easier
– Yet again, an advantage because of digital signals. You know how easy it is to store digital data, right? We can
choose from a wide plethora of digital memories. However, analog data needs to be stored in tapes and stuff like
that. It’s harder to transport and recreate with 100% fidelity.
• Encryption
– Digital signals are easy to encrypt. So this one counts as a win for the entire DSP system too.
• Easier to process
– Digital signals can easily undergo mathematical changes as compared to their analog counterparts.
Advantages of DSP system (Cont’d)
• More data transmission
– Time-division multiplexing is a great tool available for digital systems to transmit more data
over unit time and over a single communication path.
• Higher component tolerance in DSP
– The components like resistors, capacitors, and inductors have a certain threshold in terms of
temperature. Outside this threshold, as the temperature increases, they might start behaving
erratically.
– These components are not present in a digital system. Moreover, digital systems can increase
their accuracy with concepts like floating-point arithmetic.
• Easier to modify
– To modify an analog processing system, you need to change components, test, and verify the
changes. With digital processing systems, you just need to change a few commands or alter a
few lines of code.
• DSP systems can work on frequencies of a broader range
– There are some natural frequencies, like seismic frequencies that detect earthquakes. These
signals have very low frequencies. Traditional analog signals might not even detect these
signals. However, digital signal processing systems are adept at picking up even the tiniest of
Disadvantages of a DSP(Cont’d)
• When using DSP, there is a need for using anti-aliasing filter before
ADC as well as using a reconstruction filter after DAC . Due to the
use of this extra two modules viz. ADC and DAC, the complexity of
DSP based hardware increases.
• DSP processes the signal at high speed and comprises of more top
internal hardware resources. Because of this DSP dissipates higher
power as compared to analog signal processing. Analog signal
processing includes passive components that consume lower energy.
• Each DSP has a different hardware architecture and software
instructions. Due to this, only highly skilled engineers can program
the device. Proper training on DSP is required for programming for
various applications.
Disadvantages of a DSP(Cont’d)
• One needs to cautiously use the IC as per hardware and
software requirements as most of the DSP chip is very
expensive.
• Only in a synchronized communication system, the detection of
digital signals is possible but it not so in the case of analog
systems.
• Higher bandwidth is required for digital communication than
analog for transmission of the same information.
Disadvantages of a DSP (Cont’d)
• Complexity
– As we saw in the block diagram above, there are a lot of elements preceding and following a
Digital Signal Processor. Stuff like filters and converters add to the complexity of a system.
• Power
– A digital signal processor is made up of transistors. Transistors consume more power since they
are active components. A typical digital signal processor may contain millions of transistors.
This increases the power that the system consumes.
• Learning curve and design time
– Learning the ins and outs of Digital Signal processing involves a steep learning curve. Setting up
digital processing systems thus takes time. And if not pre-equipped with the right knowledge
and tools, teams can spend a lot of time in setting up.
• Loss of information
– Quantization of data that is below certain Hz causes a loss in data according to the
Rate-Distortion Theory.
• Cost
– For small systems, DSP is an expensive endeavor. Costing more than necessary.
Continuous Time signals:
vs + i vc
- C
RC = 1
First order (exponential) response
for vc
• Note, we could also have considered the voltage across the resistor or the
current as signals
Continuous Time signals:
• Examples:
• Sine wave, cosine wave, triangular wave etc. similarly some
electrical signals derived from physical quantities like
temperature, pressure, sound etc. are also an examples of
continuous signals.
Mathematical expression:
Mathematically a continuous signal can be expressed as,
x(t)=A sin(wt)
• Continuous-valued Signals
• If a signal takes on all possible values on a finite or an infinite
range, it is said to be a continuous-valued signals
• If a signal takes on values from a finite set of finite set of
possible values, it is said to be a discrete-valued signals
Basic Parts of Analog to Digital Convertor
What is a System?
• Systems process input signals to produce output signals
• Examples:
– A circuit involving a capacitor can be viewed as a system that transforms the
source voltage (signal) to the voltage (signal) across the capacitor
– A CD player takes the signal on the CD and transforms it into a signal sent to
the loud speaker
– A communication system is generally composed of three sub-systems, the
transmitter, the channel and the receiver. The channel typically attenuates and
adds noise to the transmitted signal which must be processed by the receiver
How is a System Represented?
• A system takes a signal as an input and transforms it into
another signal
Input signal Output signal
System
x(t) y(t)
vs + i vc
- C
vs, vc
vs(t) vc(t)
first order
system t
What is the difference between continuous-time and
discrete-time signals?
• A Continuous-Time Signal is defined for all values of time. X is
the dependent variable and t is the independent variable. When
there is an X(t) for every single value of t, it is continuous.
• For example, sinusoidal graphs which have the time limit of
infinity to negative infinity are clearly continuous-time signals.
Discrete Time signals
• A common misconception is that discrete and digital signals are
congruous but they are in fact very different.
• For discrete-time signals, time is discrete while the amplitude is
continuous.
• However, for digital signals both the amplitude and time are
discrete.
Review Questions
• What is DSP?
• What are the basic elements of DSP?
Sampling – Example
Signal Sampling- Example
Aliasing
• Aliasing is a common undesirable phenomenon that occurs
wherever digital signals are undergoing processing.
• It may be noticed it in audio signals or images.
When does aliasing occur?
• What is Quantization?
The electronic device that performs this conversion from an analog signal to a digital
❑
On the other hand, a digital-to-analog (D/A) converter (DAC) takes a digital sequence
❑
and produces at its output a voltage or current proportional to the size of the digital word
applied to its input.
Analog to Digital Conversion- Sample and Hold
The sampling of an analog signal is performed by a sample-and-hold (S/H ) circuit. The sampled signal is
❑
Usually, the S/H is integrated into the A /D converter. The S/H is a digitally controlled analog circuit that
❑
tracks the analog input signal during the sample mode, and then holds it fixed during the hold mode to the
instantaneous value of the signal at the time the system is switched from the sample mode to the hold
mode.
The goal of the S/H is to continuously sample the input signal and then to hold that value constant as long
❑
as it takes for the A /D converter to obtain its digital representation. The use of an S/H allows the A /D
converter to operate more slowly compared to the time actually used to acquire the sample.
In the absence of a S/H, the input signal must not change by more than one-half of the quantization step
❑
during the conversion, which may be an impractical constraint. Consequently, the S/H is crucial in
high-resolution (12 bits per sample or higher) digital conversion of signals that have large bandwidths (i.e., they
change very rapidly).
Block diagram of basic elements of an A/D Converter
Analog to Digital Conversion- Sample and Hold
The A /D converter begins the conversion after it receives a convert command. The time
❑
required to complete the conversion should be less than the duration of the hold mode o f
the S/H.
Further more, the sampling period T should be larger than the duration of the sample
❑
amplitudes into a discrete set of digital code words. This conversion involves the
processes of quantization and coding. Quantization is a nonlinear and noninvertible
process that maps a given amplitude x(n) = x(nT) at time t = nT into an amplitude x,
taken from a finite set of values. where the signal amplitude range is divided into L
intervals,
Quantization Process and Example of a Midtread process
Example of a Midtread Quantizer
Example of a Midtread Quantizer
•The coding process in an A /D converter assigns a unique binary number to each quantization level. If we
have L levels, we need at least L different binary numbers. With a word length of b + 1 bits we can represent
distinct binary numbers. Hence we should have or, equivalently, .
where a low-resolution quantizer suffices. By oversampling. we can reduce the dynamic range o f the
signal values between successive samples and thus reduce the resolution requirements on the quantizer.
As we have observed in the preceding section, the variance o f the quantization error in A /D conversion is
❑
, where .Since the dynamic range of the signal, which is proportional to its standard
deviation .
Topic 4
Hence for a given number o f bits, the power of the quantization noise is proportional to the variance of the
❑
signal to be quantized. Consequently, for a given fixed SQNR , a reduction in the variance of the signal to
be quantized allow s us to reduce the number of bits in the quantizer.
The basic idea for reducing the dynamic range leads us to consider differential quantization. To illustrate
❑
this point, let us evaluate the variance of the difference between two successive signal samples. Thus we
have
Contd.. .
Figure: Encoder and decoder for differential predictive signal quantizer
Contd.. . system.
Contd.. .
❑The use of the feedback loop around the quantizer as shown in Fig. is necessary
to avoid the accumulation o f quantization errors at the decoder. In this
configuration, the error
❑Thus the error in the reconstructed quantized signal xq(n) is equal to the quantization
error for the sample d(n). The decoder for DPCM that reconstructs the
signal from the quantized values is also shown in Fig.
Delta Modulation
❑In DM , the quantizer is a simple 1-bit (two -level) quantizer and the predictor is a
first-order predictor. Basically, DM provides a staircase approximation o f the input
signal.
❑At every sampling instant, the sign o f the difference between the input sample x(n) and
its most recent staircase approximation is determined, and then the staircase signal is
updated by a step A in the direction o f the difference.
Delta Modulation system: Fig 1
which is the discrete-time equivalent of an analog integrator. If a = 1, we have an ideal accum ulator
(integrator) whereas the choice a < 1 results in a “leaky integrator.”
Two Types of Quantization errors: Fig 2
❑The crosshatched areas in Fig.2 illustrate two types o f quantization error in DM , slope-overload distortion and
granular noise. Since the maximum slope A is limited by the step size, slope-overload distortion
can be avoided if .
❑ The granular noise occurs when the DM tracks a relatively flat (slowly changing) input signal. We note that
increasing reduces overload distortion but increases the granular noise, and vice versa.
Two Types of Quantization errors: Fig 3
Figure 3 shows an analog model that illustrates the basic principle for the practical implementation of a D M system. The
analog low pass filter is necessary for the rejection of out-of-band components in the frequency range between B and
Basic Elements of Oversampling A/D Converter: Fig 4
Contd…
❑If the interpolation factor is I = 256, the A /D converter output can be obtained by
averaging successive non-overlapping blocks of 128 bits. This averaging would result in a
digital signal with a range of values from zero to 256{b as 8 bits) at the Nyquist rate. The
averaging process also provides the required antialiasing filtering.
❑Oversampling A/D converters for voice-band (3-kH z) signals are currently fabricated as
integrated circuits. Typically, they operate at a 2-M H z sampling rate, downsample to 8
kH z, and provide 16-bit accuracy.
Topic 5
• T he D /A converter accepts at its input, electrical signals that correspond to a binary word, and produces an
output voltage or current that is proportional to the value of the binary word.
Fig(a): Ideal D/A converter characteristic
• The line connecting the dots is a straight line through the origin. In practical D /A converters, the line
connecting the dots may deviate from the ideal.
• Some of the typical deviations from ideal are offset errors, gain errors, and nonlinearities in the
input-output characteristic.
Contd…
❑An important parameter o f a D /A converter is its settling time, which is defined as the tim e required for
the output o f the D /A converter to reach and remain within a given fraction (usually, i^ LSB) of the final
value, after application o f the input code word.
❑Often, the application of the input code word results in a high-amplitude transient, called a “glitch.” This is
especially the case when two consecutive code words to the A /D differ by several bits.
Fig 7.a: Approximation of an analog signal by a staircase
Figure 7.a illustrates the approximation of the analog signal x(t) by a S/H. As shown, the
approximation, denoted as x(t), is basically a staircase function which takes the signal
sample from the D/A converter and holds it for T seconds. When the next sample arrives, it
jumps to the next value and holds it for T seconds, and so on.
Fig 7.b: impulse response of the S/H
❑It is apparent that the S/H does not possess a sharp cutoff frequency
response characteristic. This is due to a large extent to the sharp
transitions of its impulse response h(t).
Fig 9.a: Impulse Response
This impulse response is depicted in Fig. 9.a. The Fourier transform of h(t) yields the frequency response, which can
be expressed in the form
Linear Interpolation with delay
❑The first-order hold perform s signal reconstruction by computing the slope of the
straight line based on the current sample x(nT) and the past sample x(nT — T ) of
the signal. In effect, this technique linearly extrapolates or attempts to linearly predict
the next sample of the signal based on the samples x(nT) and x{n T - T). As a
consequence, the estimated signal waveform i(r) contains jumps at the sample points.
Quantization Errors
• To determine the effects o f quantization on the performance o f an A /D converter, we adopt a
statistical approach. The dependence of the quantization error on the characteristics of the input signal
and the nonlinear nature of the quantizer make a deterministic analysis intractable.
• In the statistical approach, we assume that the quantization error is random in nature. We model this
error as noise that is added to the original (unquantized) signal.
• If the input analog signal is within the range o f the quantizer, the quantization error is
bounded in magnitude and the resulting error is called granular noise. When the input falls outside
the range of the quantizer (clipping), becomes unbounded and results in overload noise.
• This type of noise can result in severe signed distortion when it occurs. Our only remedy is to scale the
input signal so that its dynamic range falls within the range of the quantizer. The following analysis is
based on the assumption that there is no overload noise.
Normalized Analog input
Mathematical Model of Quantization noise
Probability density function for the quantization error.