18ecc204j - DSP - Week 1

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

18ECC204J DIGITAL SIGNAL

PROCESSING – WEEK 1
Syllabus Overview
• Learning Unit / Module 1: Signals and Waveforms
• Learning Unit / Module 2: Frequency
Transformations
• Learning Unit / Module 3: FIR Filters
• Learning Unit / Module 4: IIR Filters
• Learning Unit / Module 5: Multirate signal
Processing
Lab Experiments
Lab 1.a) Generation of basic signals
b) Unit step, ramp and impulse
Lab 2: Continuous and discrete time
Lab 3: a) Study of sampling theorem
b) Aliasing effects
Lab 4: a) Linear convolution
b) Circular convolution
Lab 5: a) Autocorrelation and cross correlation
b) Spectrum analysis using DFT
Lab 6: a) Efficient computation of DFT using FFT
b) Computation of IDFT
Lab7: a) Design of digital FIR Low Pass and High Pass filter using rectangular window
b) Design of digital FIR Band Pass and Band Stop filter using rectangular window
Lab8: a) Design of digital FIR Low Pass and High Pass filter using Hanning and
Hamming window
b) Design of digital FIR Band Pass and Band Stop filter using Hanning and
Hamming window
Lab 9: Design of digital FIR filter using frequency sampling method
Lab10: a) Design of analog Butterworth filter
b) Design of analog Chebyshev filter
Lab 11: a) Design of digital Butterworth filter using impulse invariance method
b) Design of digital Butterworth filter using bilinear transformation
Lab12: a) Design of digital Chebyshev filter using impulse invariance method
b) Design of digital Chebyshev filter using bilinear transformation
Lab 13: a) Interpolation
b) Effect of interpolation in frequency domain
Lab 14: a) Decimation
b) Effect of decimation in frequency domain
Lab 15: a) Design of anti-aliasing filter
b) Design of anti-imaging filter
Learning Unit / Module 1: Signals and
Waveforms
❑ Basic Elements of DSP , Advantages and applications of DSP
❑ Continuous Time vs Discrete time signals , Continuous valued vs discrete
valued signals.
❑ Concepts of frequency in analog signals , Continuous and discrete time
sinusoidal signals ,
❑ Sampling of analog signals Sampling theorem
❑ Aliasing Quantization of continuous amplitude signals,
❑ Analog to digital conversion Sample and hold, Quantization and coding
❑ Oversampling A/D converters , Digital to analog conversion Sample and
hold
❑ Oversampling D/A converters, Quantization noise
❑ Errors due to truncation IDFT, Probability of error
Data Vs Signal
• Data – information formatted in human/machine readable
form
– • examples: voice, music, image, file
• Signal – electric or electromagnetic representation of data
– • transmission media work by conducting energy along a physical
path; thus, to be transmitted, data must be turned into energy in
the form of electro-magnetic signals
• Transmission – communication of data through
propagation and processing of signals
What is a Signal?
• A signal is a pattern of variation of some form
• Signals are variables that carry information

Examples of signal include:


• Electrical signals
– Voltages and currents in a circuit
• Acoustic signals
– Acoustic pressure (sound) over time
• Mechanical signals
– Velocity of a car over time
• Video signals
– Intensity level of a pixel (camera, video) over time
How is a Signal Represented?
• Mathematically, signals are represented as a function
of one or more independent variables.
• Example : signals that are a function of a single
variable: time

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.

– Putting all these together, we can get a definition for DSP.


DSP Applications
• Audio signal processing 
• Audio compression
• Digital image processing 
• Video compression
• Speech processing, speech recognition
• Digital communications, digital synthesizers, radar, sonar, financial signal
processing, seismology and biomedicine.
• Specific examples include speech coding and transmission in digital mobile
phones,  weather forecasting, economic forecasting, seismic data processing,
analysis and control of industrial processes, medical imaging such as CAT scans
and MRI, MP3 compression, computer graphics, image manipulation, audio
crossovers and equalization, and audio effects units.
DSP Applications- Example
Telecommunication
a. Speech Processing
For echo cancellation.
Digital audio synthesis.
Equalization – Think about tuning your radio
Speech recognition and analysis.
for bass and treble).
Filtering – Removing unwanted signals using b. Medicine
specially designed filters like the Infinite X-rays, ECGs, EEGs.
Impulse Response  Filter (IIR). c. Signal filtering
Multiplexing and repeating signals. Noise removal and shaping of signal spectrums.
Instrumentation and Control d. Military
In designing Phase Locked Logic (PLL). Sonar and navigation.
Noise reduction circuits. Analysis after tracking in radars.
Compression of signals, Function generators. e. Consumer electronics
Digital Image Processing Music players
Compression of an image- Enhancement, Professional music turntables
reconstruction, and restoration of an image.
Analysis or face detection (like Snapchat).
Basic Elements of Digital Signal Processing System

• 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
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
Continuous Time signals:

• A signal of continuous amplitude is called continuous


signal or analog signal. Continuous signal has some
value at every instant of time.
Example: Signals in an Electrical Circuit
R

vs + i vc
- C

• The signals vc and vs are patterns of variation over time

Step (signal) vs at t=1


vs, vc

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)

•For every fix value of t, x(t) is periodic in nature.


•If the frequency (1/t) is increased then the rate of oscillation
also changes.
Discrete Time signals:

• Discrete time signal:


• In this case the value of signal is specified only at
specific time. So signal represented at “discrete interval
of time” is called as discrete time of signal.
• The discrete time signal is generated from continuous
time signal by using the sampling operation. This
process is shown in figure below.
Example
• Consider a continuous analog signal as shown
in figure
• a). This signal is continuous in nature from –
infinity to +infinity.
• The sampling pulses are shown in figure
• b). These are train of pulses. Here the samples
are taken with Ts as sampling time.
• Figure c) shows the discrete time signal

• For signal shown in figure a), the expression is


x(t)=A cos (wt)
• And for signal shown in fig c) , the expression
is x(t)= A cos (wn)
Continuous & Discrete-Time Signals
• Continuous-Time Signals x(t)
• Most signals in the real world are continuous time, as the
scale is infinitesimally fine.
• Eg. voltage, velocity,
t
• Denote by x(t), where the time interval may be bounded
(finite) or infinite
• Discrete-Time Signals
• Some real world and many digital signals are discrete time,
as they are sampled x[n]
• E.g. pixels, daily stock price (anything that a digital
computer processes)
• Denote by x[n], where n is an integer value that varies n
discretely
• Sampled continuous signal
• x[n] =x(nk) – k is sample time
Continuous valued or discrete valued signals:

• Continuous valued signals:


• If the variation in the amplitude of signal is continuous then, it
is called continuous valued signal. Such signals may be
continuous or discrete in nature. Following figure shows the
examples of continuous valued signals.
• Discrete valued signals:
• If the variation in the amplitude of signal is not continuous but
the signal has certain discrete amplitude levels then such signal
is called as discrete valued signal. Such signal may be again
continuous or discrete in nature as shown in figure below.
Continuous-valued Signals

• 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)

• In a very broad sense, a system can be represented as the


ratio of the output signal over the input signal

– That way, when we “multiply” the system by the input signal, we get
the output signal
– This concept will be firmed up in the coming weeks
Example: An Electrical Circuit System
R

vs + i vc
- C

• Simulink representation of the electrical circuit

vs, vc
vs(t) vc(t)

first
order t
system
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?
• Give the main advantages of DSP over ASP
• What is Anti-alising filter?
• Give the disadvantages of DSP
Answers
• 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.
• Basic Elements of DSP
– Input,Anti-alising factor,ADC,Processor, DAC, Output
• Advantages of DSP
– Accuracy
– Repeatability
– Ease of Upgradations
– Implementation of Algorihtms
– Cheaper
– Less overall noise
– Error detection and correction is possible in DSPs
– Data storage is easier
– Easier to process
Answers
• Anti-alising Filter
– 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.
• Disadvantages of DSP
– the complexity of DSP based hardware increases.
– DSP dissipates higher power as compared to analog signal processing.
– Proper training on DSP is required for programming for various applications.
– DSP chip is very expensive.
– the detection of digital signals is possible but it not so in the case of analog
systems.
– Higher bandwidth is required for digital communication
Frequency in Simple Frequency in Simple Analog Signals

• rate of signal change with respect to time


• • change in a short span of time ⇒ high freq.
• • change over a long span of time ⇒ low freq.
• • signal does not change at all ⇒ zero freq.
• signal never completes a cycle T= ∞ ⇒ f=0, DC sig. •
• signal changes instantaneously ⇒ ∞ freq.
• Time Domain Plot – specifies signal amplitude at each instant of time
• • does NOT express explicitly signal’s phase and frequency
• Plot Frequency Domain Plot – specifies peak amplitude with respect to
freq. • phase CANNOT be shown in the frequency domain.
Concept of Frequency in Analog Signal
Signal Sampling
• To digitally analyze and manipulate an analog signal, it must be
digitized with an analog-to-digital converter (ADC).Sampling is usually
carried out in two stages, discretization and quantization.
• Discretization means that the signal is divided into equal intervals of
time, and each interval is represented by a single measurement of
amplitude. Quantization means each amplitude measurement is
approximated by a value from a finite set. Rounding real numbers to
integers is an example.
• The Nyquist–Shannon sampling theorem states that a signal can be
exactly reconstructed from its samples if the sampling frequency is
greater than twice the highest frequency component in the signal. In
practice, the sampling frequency is often significantly higher than twice
the Nyquist frequency.
Signal Sampling
• Theoretical DSP analyses and derivations are typically
performed on discrete-time signal models with no
amplitude inaccuracies (quantization error), "created" by the
abstract process of sampling. Numerical methods require a
quantized signal, such as those produced by an ADC.
• The processed result might be a frequency spectrum or a
set of statistics. But often it is another quantized signal that
is converted back to analog form by a digital-to-analog
converter (DAC).
Signal Sampling (Contd)
• We can obtain a discrete-time signal by sampling a continuous-
time signal at equally spaced time instants, tn = nTs

– x[n] = x(nTs) -∞ < n < ∞


• The individual values x[n] are called the samples of the
continuous time signal, x(t).
• The fixed time interval between samples, Ts, is also expressed
in terms of a sampling rate fs (in samples per second) such
that: fs = 1/ Ts samples/sec.
Signal Sampling – Example
Signal Sampling – Example

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?

• One of the first steps in digital signal processing is


Sampling.
• Sampling is one of the most important steps in the long
chain of processes involved in the conversion of an
analog signal into a digital one.
• It involves multiplying a continuous-time signal
with a discrete set of inputs. The values are said to be
‘sampled’ at the instants where the discrete signals
exist.
Nyquist Rate
• If the sampling process meets specific criteria, this
criterion is Fs>=2Fm.
– That is, the sampling frequency should be equal to or greater
than twice the maximum frequency component of the
continuous-time signal.
– When the sampling frequency is exactly equal to twice the
maximum frequency component, it is known as the Nyquist
rate.
Sampling in DSP:.
sampling process in the time frequency domain equivalents on the
domain right
Review Questions
• How is digital signal converted ?
• What is Sampling?
• What is meant by aliasing ?
• When do aliasing occur?
• What is Quantization?
• Define Sampling rate
• What is Anti-alising filter?
References

• 1. John G. Proakis, Dimitris G. Manolakis, “Digital Signal


Processing, Principles, Algorithms and Applications”, Pearson
Education, 4th edition, 2014
• 2. Alan V. Oppenheim, Ronald W. Schafer, “Discrete-Time Signal
Processing”, Pearson Education, 1st edition, 2015
• 3. Sanjit Mitra, “Digital Signal Processing –A Computer Based
Approach”, McGraw Hill, India, 4th Edition, 2013.
• 4. Fredric J. Harris, “Multirate Signal Processing for
Communication Systems”,1st edition, Pearson Education, 2007

You might also like