CHAP 3. Signal Processing Elemnt 3
CHAP 3. Signal Processing Elemnt 3
1
Contents Covers on Signal Processing
• Analog to Digital Converter (ADC) & Types
• Digital to Analog Converter (DAC) & Types
• OSCILLATOR &Types
2
Analog to Digital Converter (ADC)
• An analog signal is a continuous signal that contains time-varying quantities, such as
temperature or speed, with infinite possible values in between. which are directly
measurable quantities.
• An analog signal can be used to measure changes in some physical phenomena such as
light, sound, pressure, or temperature.
• ADC is an electronic integrated circuit which transforms a signal from analog
(continuous) to digital (discrete) form.
• ADC Provides a link between the analog world of transducers and the digital world of
signal processing and data handling.
Examples:
• Thermometer – mercury height rises as
temperature rises
• Car Speedometer – Needle moves farther
right as you accelerate
ADC general structure 3
There are two step Process :-
• Quantizing - breaking down analog value is a set of finite states
• Encoding - assigning a digital word or number to each state and matching it to the input
signal
Quantizing: the number of possible states(N) that the converter can output is: N=2n
The number of possible states that the converter can output is:
Sampling :-
• It is a process of taking a sufficient number of discrete values at point on a waveform
that will define the shape of waveform.
• The more samples you take, the more accurately you will define the waveform.
• It converts analog signal into series of impulses, each representing amplitude of the
signal at given point.
4
“Real World” Sampled Data Systems Consist of ADCs and DACs
Analog Digital
ADC
Channel DSP Memory
DAC
Amplitude
Analog
Digital
Value
time time
Nyquist Rule:
Use a sampling frequency at least twice as high as the maximum frequency in the
signal to avoid aliasing.
f samples 2 f max
5
Output Discrete Voltage
Example: Quantizing States Ranges (V)
You have 0-10V signals. Separate them into 0 0.00-1.25
a set of discrete states with 1.25V 1 1.25-2.50
increments. (How did we get 1.25V?)
2 2.50-3.75
The number of possible states that the converter
can output is: 3 3.75-5.00
N=2n 4 5.00-6.25
where n is the number of bits in the AD converter 5 6.25-7.50
Example: For a 3 bit A/D converter, N=23=8.
6 7.50-8.75
Analog quantization size:
Q=(Vmax-Vmin)/N = (10V – 0V)/8 = 1.25V 7 8.75-10.0
6
Encoding Output
States
Output Binary Equivalent
• Here we assign the digital value (binary number)
0 000
to each state for the computer to read.
1 001
There are two ways to best improve accuracy of
2 010
A/D conversion:
3 011
• increasing the resolution which improves the
4 100
accuracy in measuring the amplitude of the
analog signal. 5 101
6 110
• increasing the sampling rate which increases the
7 111
maximum frequency that can be measured.
Resolution (number of discrete values the converter can produce) = Analog Quantization
size
(Q) = Vrange / 2^n, where Vrange is the range of analog voltages which can be represented
limited by signal-to-noise ratio (should be around 6dB)
In example: Q = 1.25V, this is a high resolution. A lower resolution would be if we used a 2-
bit converter, then the resolution would be 10/2^2 = 2.50V.
7
Types of A/D convertor :-
• Flash ADC
• Dual slope/Counter slope ADC
• Successive Approximation ADC
Flash ADC: series of comparators, each one compares input to a unique reference voltage.
• comparator outputs connect to a priority encoder circuit produces binary output
Fast – but more expensive :
Single cycle - Uses many Comparators in parallel with different reference voltages
8
Priority Encoder
x3 x2 x1 x0 y1 y0
------------------------
1 X X X 1 1
0 1 X X 1 0
0 0 1 X 0 1
0 0 0 X 0 0
9
• 2N-1 or 2N comparators for N-bits Analog Digital
• Each reference voltage equivalent
to a quantization level
• Encoding logic produces word
https://www.youtube.com/watch?v=2gF_nfaBV_0
https://www.youtube.com/watch?v=K07T1dSnwxY
12
Successive Approximation ADC:
continuously convert analog signal using a binary search through all possible
quantization levels before to discreet digital signal.
• Assume that
• Vin= 0.6 volts
• Vref=1volts
• Find the digital value of Vin
Divided Vref by 2
15
• This process continues for all the remaining bits.
16
17
ADC Example 2. using successive approximation
• Given an analog input signal whose voltage should range from 0 to 15 volts, and an 8-bit
digital encoding, calculate the correct encoding for 5 volts. Then trace the successive-
approximation approach to find the correct encoding.
• Assume M = 2n – 1, in short we can use Va / Vmax = d / M, 5/15 = d / (256 - 1), d = 85 or
binary 01010101
0 0 0 0 0 0 0 0
Step 1-4: determine bits 0-3
0 1 0 0 0 0 0 0
½(Vmax – Vmin) = 7.5 volts, Vmax = 7.5 volts. 0 1 0 0 0 0 0 0
½(7.5 + 0) = 3.75 volts, Vmin = 3.75 volts.
0 1 0 1 0 0 0 0
½(7.5 + 3.75) = 5.63 volts, Vmax = 5.63 volts
0 1 0 1 0 0 0 0
½(5.63 + 3.75) = 4.69 volts, Vmin = 4.69 volts.
0 1 0 1 0 1 0 0
½(5.63 + 4.69) = 5.16 volts, Vmax = 5.16 volts.
½(5.16 + 4.69) = 4.93 volts, Vmin = 4.93 volts. 0 1 0 1 0 1 0 0
Analog State
input machine
Timing
control
Vmax
DAC SAR
Vmin BUF Digital
output
Comparator SAR
SAR: Successive
approximation register
19
Digital to Analog Converter (DAC)
• Signals are easily stored and transmitted in digital form, but a DAC is
needed for the signal to be recognized by human senses or other non-digital
systems.
• A digital-to-analog converter (DAC or D-to-A) is a device that converts a
digital (usually binary) code signal to an analog signal (current, voltage, or
electric charge).
• Digital signals is a type of signal that can take on a set of discrete values (a
quantized signal)
• It can represent a discrete set of values using any discrete set of waveforms ..
And we can represent it like (0 or 1) ,( on or off )….. etc
Examples:
Light switch can be either on or off
20
What is a Digital-Analog Converter?
REFERENCE
INPUT RESOLUTION
RESOLUTION ANALOG
==NNBITS
BITS OUTPUT
DIGITAL
INPUT
Digital Input
Analog Output = x Reference Input
(2 - 1)
N
• Produces a Quantized (Discrete Step) Analog Output (Voltage or Current) in Response to Binary
Digital Input Code
• A reference quantity (either voltage or current) is accurately divided into binary and/or linear
segments.
• The digital input drives switches that connect an appropriate number of segments to the output.
• Finite Number of Discrete Values : 2 N Resulting in Quantization Uncertainty
• Sampling and Quantization Impose Fundamental yet Predictable Limitations
21
Analog Output Signal
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011
Span (or Range): difference between maximum and minimum analog values
Max - Min
n: number of bits in digital code (sometimes referred to as n-bit resolution)
Step Size (or Resolution): smallest analog change resulting from changing one bit in the
digital number, or the analog difference between two consecutive digital numbers; also
the bit weight of the step size = Span / 2n
Step Size= Span / 2n
(Assume M = 2n)
• Transistors are used to switch between Vref and ground (bit 1 10/128 = 0.078
24
Binary Weighted Resistor
Voltages V1 through Vn are either Vref if corresponding
• Assume Ideal Op-amp
bit is high or ground if corresponding bit is low
• No current into op-amp
• Virtual ground at inverting input V1 is most significant bit, Vn is least significant bit
Vref
• Vout= -IRf
V1
R
Vref
V2 2R I Rf
R V3 4R
I Rf - Vout
2R
+
4R Vn 2n-1R
- Vout
+
MSB
2R
n LSB
V1 V2 V3 Vn
Vout IRf Rf n -1
R 2R 4R 2 R 25
If Rf=R/2 V1 V2 V3 Vn
Vout IRf n
2 4 8 2
For example, a 4-Bit converter yields
1 1 1 1
Vout Vref b3 b2 b1 b0
2 4 8 16
Where b3 corresponds to Bit-3, b2 to Bit-2, etc.
Advantages
Simple Construction/Analysis
Fast Conversion
Disadvantages
Requires large range of resistors (2000:1 for 12-bit DAC) with necessary high precision for low resistors
Requires low switch resistances in transistors
Can be expensive. Therefore, usually limited to 8-bit resolution. 26
R-2R Ladder DAC
Each bit corresponds to a switch:
If the bit is high, the corresponding
switch is connected to the inverting input
of the op-amp.
If the bit is low, the corresponding switch
is connected to ground.
Bit: 0 0 0 0
4-Bit Converter
27
R-2R Ladder
V3
Vref V1 V2 V3
Ideal Op-amp
2R 2R
Req
2 R 2 R
R
2 R 2 R
28
R-2R Ladder
Vref V1 V2 V3 V2 V3
R R
R 1
V3 V2 V2
RR 2
I
Likewise,
1
V2 V1
Vout 2
1
V1 Vref
2
Vout IR
29
R-2R Ladder
Results:
Vref V1 V2 V3 1 1 1
V3 Vref , V2 Vref , V1 Vref
8 4 2
30
For a 4-Bit R-2R Ladder
1 1 1 1
Vout Vref b3 b2 b1 b0
2 4 8 16
For general n-Bit R-2R Ladder or Binary Weighted Resister DAC
n
1
Vout Vref bn i i
• Advantages
• Only two resistor values (R and 2R)
i 1 2 • Does not require high precision
resistors
• Disadvantage
• Lower conversion speed than binary
weighted DAC
31
Specifications of DACs
• Resolution Resolution
• Speed Smallest analog increment corresponding to 1 LSB change
• An N-bit resolution can resolve 2N distinct analog levels
Linearity
Common DAC has a 8-16 bit resolution
• Settling Time Vref
Resolution VLSB N
• Reference Voltages 2
• Errors where N number of bits
Speed
Rate of conversion of a single digital input to its analog equivalent
Conversion rate depends on
clock speed of input signal
settling time of converter
When the input changes rapidly, the DAC conversion speed must be high.
32
Settling Time
• Time required for the output signal to settle within +/- ½ LSB of its final value after a
given change in input scale
• Limited by slew rate of output amplifier
• Ideally, an instantaneous change in analog voltage would occur when a new binary word
enters into DAC
33
Types of Errors Associated with DACs
• Gain
• Offset
• Full Scale
• Resolution
• Non-Linearity
• Settling Time and Overshoot
34
•The digital-to-analogue converter of Figure below is required to give an output voltage in the
range 0 to 2.55 V, corresponding to an 8-bit digital input signal 00000000 to 11111111.
(a) Assuming VREF = −15 V, R = 1 kΩ, calculate the value of RF required.
(b) Find the output voltage corresponding to an input signal of 11000101.
35
36
OSCILLATOR
Oscillators are circuits that produce a continuous signal of some type without
the need of an input.
These signals serve a variety of purposes such as communications systems,
digital systems (including computers), and test equipment
An oscillator is a circuit that produces a repetitive signal from a dc voltage.
There are two major classifications for oscillators:
The feedback oscillator relies on a positive feedback of the output to
maintain the oscillations.
The relaxation oscillator makes use of an RC timing circuit to generate a
non-sinusoidal signal such as square wave.
37
• A feedback oscillator consists of amplifier for gain and a positive
feedback circuit that produces phase shift and provides attenuation.
Ve = Vi + Vf (1)
Vo = AVe (2)
Vf = (AVe)=Vo (3)
From (1), (2) and (3)
Vo A As a function of s
Af ≡ =
V 𝑖 ( 1 − Aβ )
where A is loop gain
39
1.RC Oscillators
RC feedback oscillators are generally limited to frequencies of 1MHz or less
The types of RC oscillators that we will discuss are the Wien-Bridge and the Phase Shift
Wien-Bridge Oscillator
It is a low frequency oscillator which
ranges from a few kHz to 1 MHz.
ZS
1 1 sRC
Z S R Z C R
sC sC
1 1
ZP 1 1 1
Z P R Z C sC
R ZC R
R
1 sCR 40
The Phase-Shift Oscillator
• The phase-shift oscillator uses three RC circuits in the feedback path that have a total phase
shift of 180° at one frequency – for this reason an inverting amplifier is required for this
circuit
• Each of the three RC circuits in the feedback
loop provide a maximum phase shift
approaching 90°.
• Oscillation occurs at the frequency
where the total phase shift through the
three RC circuits is 180°.
• The inversion of the op-amp itself provides the additional 180° to meet the
requirement for oscillation of a 360° (or 0°) phase shift around the feedback loop.
The attenuation of the three-section RC feedback circuit is 1/29
To meet the unity loop gain requirement, the closed-loop voltage gain of the inverting
op-amp must be 29. This means that Rf /R3 ≥ 29. 42
• The frequency of oscillation is given by
• Example
43
LC Oscillators
• LC feedback elements are normally used in oscillators that require higher
frequencies of oscillation.
• Also, because of the frequency limitation (lower unity- gain frequency) of
most op-amps, transistors (BJT or FET) are often used as the gain element in
LC oscillators.
• Several types of resonant LC feedback oscillators like the Colpitts, Clapp, Hartley,
and crystal-controlled oscillators.
Colpitts oscillator is one of basic type of resonant
circuit feedback oscillator uses an LC circuit in the
feedback loop to provide the necessary phase shift and
to act as a resonant filter that passes only the desired
frequency of oscillation.
Colpitts oscillators 44
The Colpitts Oscillator
The approximate frequency of oscillation is the resonant frequency of the LC circuit
and is established by the values of C1 , C2 and L according to the formula:
𝑓𝑓𝑟𝑟 1
2𝜋 𝐿𝐶
𝑇
Where CT is the total capacitance the =series capacitors around the tank circuit, given by:
𝐶𝑇 𝐶1𝐶
𝐶12+ 𝐶2
The output voltage is developed across=C1 and the feedback voltage is developed across C2 .
The expression for the attenuation is 𝐵 = 𝐶2 /𝐶1
The condition for oscillation is 𝐴𝑣𝐵 = 1 or 𝐴𝑣=𝐶1 /𝐶2
45
The Hartley Oscillator
The Hartley oscillator is similar to the Colpitts oscillator, except the resonant circuit
consists of two series inductors (or a single tapped inductor) and a parallel capacitor.
The inductors act in a role similar to C1 and C2 in the Colpitts to determine the attenuation,
B, of the feedback circuit B = (L1 / L2).
To assure start-up of oscillation, Av
must be greater than 1/B
46
Relaxation Oscillators :-Reading Assignment
• Relaxation oscillators make use of an RC timing and a device that changes states to
generate a periodic waveform (non-sinusoidal) such as:
• Triangular-wave
• Square-wave
• Sawtooth
1. Triangular-wave oscillator circuit is a combination of a comparator and
integrator circuit.
𝑓 𝑟=
1
( )
𝑅2
4 𝐶 𝑅1 𝑅 3
𝑉 𝑈𝑇𝑃 =+𝑉 𝑚𝑎𝑥
( )
𝑅3
𝑅2 ❑
𝑉 𝐿𝑇𝑃 =−𝑉 max
( )
𝑅3
𝑅2 ❑ 47
2. Square-wave Oscillator
A square wave relaxation oscillator is like the Schmitt trigger or Comparator circuit.
The charging and discharging of the capacitor cause the op-amp to switch states rapidly and produce
a square wave.
The RC time constant determines the frequency.
48
3. Sawtooth Voltage-Controlled Oscillator (VCO)
• Sawtooth VCO circuit is a combination of a Programmable Operation
Unijunction Transistor (PUT) and integrator circuit. Initially, dc input = -VIN
• Volt = 0V, Vanode < VG
• The circuit is like an integrator.
• Capacitor is charging.
• Output is increasing positive going ramp.
When Vout = VP
• Vanode > VG , PUT turn ‘ON’
( )
𝑉 𝐼𝑁 1
𝑓= • Vanode < VG , PUT turn ‘OFF’
𝑅𝑖 𝐶 𝑉 𝑃 − 𝑉 𝐹 49
Summary
Sinusoidal oscillators operate with positive
feedback.
Two conditions for oscillation are 0º feedback phase shift and feedback loop
gain
Theofinitial
1. startup requires the gain to be momentarily greater than 1.
RC oscillators include the Wien-bridge and phase
shift.
LC oscillators include the Crystal Oscillator.
The crystal actually uses a crystal as the LC tank circuit and is very stable
and accurate.
A voltage controlled oscillator’s (VCO) frequency is controlled by a dc
control voltage.
50