DSP PartA
DSP PartA
Signals need to be processed so that the information that they contain can be displayed, analyzed, or converted to
another type of signal that may be of use. In the real-world, analog products detect signals such as sound, light,
temperature or pressure and manipulate them. Converters such as an Analog-to-Digital converter then take the
real-world signal and turn it into the digital format of 1's and 0's. From here, the DSP takes over by capturing the
digitized information and processing it. It then feeds the digitized information back for use in the real world. It does
this in one of two ways, either digitally or in an analog format by going through a Digital-to-Analog converter. All of
this occurs at very high speeds.
Data Acquisition and Signal Processing
Data acquisition is the process of sampling signals that measure real world physical conditions and
converting the resulting samples into digital numeric values that can be manipulated by a computer.
Data acquisition systems, abbreviated by the acronyms DAS or DAQ, typically convert analog
waveforms into digital values for processing. The components of data acquisition systems include:
Both of these restrict how much information a digital signal can contain.
Analog
Input Sample
& ADC
Hold Digital Output
Sampled Signal
What is ADC
Range
Conversion Time
Resolution
Conversion Time
DAC page 58
ADC page 75
Analog to Digital Conversion
Sampling
Analog to Digital Conversion
sampled signal
If we assume that voltages from 0 to 4.095 are digitized by a 12-bit ADC, each
step would be 1 mV.
Eg; 2.0001 and 2.0007 will both be assigned the number 2000 after digitization
quantization
Any one sample can have a maximum error of ±1/2 LSB
Analog to Digital Conversion
quantized signal
Analog to Digital Conversion
Quantization error
Quantization error appears like a random noise
Quantization Noise
What are the suitable sample rates for digitizing human speech?
music?
Aliasing is an effect that occurs when a signal is sampled at too low a frequency. What happens is that the higher
frequency components of the signal cannot be captured because of the low sampling frequency, which results in
overlap in the spectrum. In the above example, reconstructing signal is a low frequency signal respect to the
original signal.
Here we can reconstruct the signal with sampling rate fs1 = 6* fmax (>= 2*fmax). When we
sampled the signal with sampling rate fs2 = 1100/s, f2 and f3 frequency components appear
as low frequency components in the reconstructed signal. In case if we only concern the
signals in the range [0-550 Hz] then before sampling the signal we must apply a anti aliasing
low pass filter in order to remove frequencies above 550 Hz and then sample the signal with
sampling rate 1100/s.
Anti aliasing filter
In order to remove frequency
components above the Nyquist
frequency (fs/2)
Ex : cut off frequency (Nyquist
frequency ) =550 Hz
Which mean sampling rate fs = 1100 /s
f1 = 500 Hz f1 = 500 Hz
f2 = 1000 Hz Sampling rate fs
Analog to Digital
f3 = 750 Hz = 1100/s
Conversion
DSP
Why?
What is the need of digital signal processing?
Digital signal processing is important because it provides the *flexibility* of using the same
digital hardware (e.g. DSP chips such as TI TMS 320 series) for many different applications.
Before DSP, different analog electronics would be required for every different application.
Now, for example, your smartphone is everything from a cell phone, radio, camera,
navigational tool, music player, video player, etc. all using the same hardware as a result of
DSP. Increasingly, everything is being “software-defined” and DSP is really at the heart of
that trend which has been evolving for the past several decades.
Digital signal processing (DSP) is the process of analyzing and modifying a signal to optimize
or improve its efficiency or performance. It involves applying various mathematical and
computational algorithms to analog and digital signals to produce a signal that's of higher
quality than the original signal.
Digital to Analog Conversion
Arduino
𝑦 = sin(2𝜋𝑓𝑡)
Here we can understand how sampling rate
change the output of DAC.
U1
7
3
6
SW3(NO) 2
SW1
4
1
5
R1 741
+88.8
SW-SPDT 1k Volts
SW2 R2
2k
R3
SW-SPDT
SW3 4k
SW-SPDT
R- 2R Ladder DAC
The R-2R Digital to Analog Converter uses only two resistance values R and 2R
regardless of the number of bits of the converter compared to the summing amplifier
implementation where each bit resistor has a different value.
LSB MSB
Thevenin’s Theorem
Any combination of batteries and resistances with two terminals can be replaced by
a single voltage source e and a single series resistor r. The value of e is the open
circuit voltage at the terminals, and the value of r is e divided by the current with
the terminals short circuited.
B 0 B1 B 2 B 3
Vo = ( + + + )Vref
16 8 4 2
𝐼𝑜𝑢𝑡 = 𝐵2 𝐼2 + 𝐵1 𝐼1 + 𝐵0 𝐼0
𝑉− = 𝑉+ = 0
𝐼0 = 𝐼𝑐
𝐼1 = 2𝐼0
𝐼𝑎 = 𝐼𝑏 + 𝐼1 = 2𝐼1
𝐼0 = 𝐼𝑐 𝑉𝑟𝑒𝑓 = 𝐼𝑎 𝑅 + 𝐼1 2𝑅 = 4𝐼1 𝑅
𝑉𝑟𝑒𝑓
𝐼𝑏 = 𝐼0 + 𝐼𝑐 = 2𝐼0 𝐼2 = 2𝐼1 = 4𝐼0 =
2𝑅
𝑉1 = 𝐼𝑏 𝑅 + 𝐼0 2𝑅 𝑉𝑟𝑒𝑓
𝐼𝑜𝑢𝑡 = (4𝐵2 + 2𝐵1 + 𝐵0 )
8𝑅
𝑉1 = 4𝐼0 𝑅
𝑉𝑟𝑒𝑓 𝑅𝑓
𝑉1 = 𝐼1 2𝑅 = 4𝐼0 𝑅 𝑉𝑜𝑢𝑡 = (4𝐵2 + 2𝐵1 + 𝐵0 )
8𝑅
Letting Vref = 1 and Rf = 2R, we obtain the following output table
Electronic Simulation - R- 2R Ladder DAC
VCC
R6
U1 1k
7
3
6
R2 R3 R4 R5 2
1k 1k 1k 1k
4
1
5
741
R1 LSB_B0 B1 B2 B3-MSB
1k 2k 2k 2k 2k
+88.8
Volts
1 LOW
D 23 22 21 20
SAR
C 1 0 0 0
Reset
Process
1. MSB initialized as 1
2. Convert digital value to analog using DAC
3. Compares guess to analog input
4. Is Vin>VDAC
• Set bit 1
• If no, bit is 0 and test next bit
Successive Approximation ADC
+4 V DAC
23 22 21 20
-
5.1V +
2 HIGH
D 23 22 21 20
SAR
C 0 1 0 0
Process Keep
1. MSB initialized as 1
2. Convert digital value to analog using DAC
3. Compares guess to analog input
4. Is Vin>VDAC
• Set bit 1
• If no, bit is 0 and test next bit
Successive Approximation ADC
+6 V DAC
23 22 21 20
-
5.1V +
3 LOW
D 23 22 21 20
SAR
C 0 1 1 0
Process Reset
1. MSB initialized as 1
2. Convert digital value to analog using DAC
3. Compares guess to analog input
4. Is Vin>VDAC
• Set bit 1
• If no, bit is 0 and test next bit
Successive Approximation ADC
+5 V DAC
23 22 21 20
-
5.1V +
4 LOW
D 23 22 21 20
SAR
C 0 1 0 1
Process Keep
1. MSB initialized as 1
2. Convert digital value to analog using DAC
3. Compares guess to analog input
4. Is Vin>VDAC
• Set bit 1
• If no, bit is 0 and test next bit
Flash ADC
When input voltage exceeds the 2N – 1 comparators
◼ 2N-1 Comparators
N
◼ 2 Resistors
◼ Control Logic
Vin = 4.5 V 0
1 100
1
1
Single Slope Integration
Single Slope Integration
At the beginning of conversion, the control unit sets the output of the integrator and binary counter to zero.
Then –Vref is connected to the integrator by closing switch S1 and the counter is allowed to count at a constant
rate.
Therefore, Vint increases from zero at a constant rate.
When Vint exceeds the input voltage Vin, the comparator output changes its output level, as shown below.
Now keep checking the INTR pin. INTR will be 1 if conversion is not
finished and INTR will be 0 if conversion is finished.
Make CS=0 and send a high to low pulse to RD pin to read the data
from the ADC.
Once the conversion in ADC is done, the data is available in the output latch of
the ADC.
Below are the steps to read output from the ADC0804.
Make chip select (CS) pin low.
Make read (RD) signal low.
Read the data from port where ADC is connected.
Make read (RD) signal high.
Make chip select (CS) high.
Interfacing ADC to 8051
8051 C program for ADC0804
Relating ADC Value to Voltage