Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Data Conversion

Similar presentations

Presentation on theme: "Introduction to Data Conversion"— Presentation transcript:

1 Introduction to Data Conversion
EE174 – SJSU Lecture #2 Tan Nguyen

2 Vocabulary Typically, samples are taken at a fixed rate
ADC (Analog-to-Digital Converter): converts an analog signal (voltage/current) to a digital value DAC (Digital-to-Analog Converter): converts a digital value to an analog value (voltage/current) Sample period: for ADC, time between each conversion Typically, samples are taken at a fixed rate VFS / Vref (Full scale or Reference Voltage): Analog signal varies between 0 and Vref, or between +/-Vref Resolution: Number of bits used for conversion (8 bits, 10 bits, 12 bits, 16 bits, etc). Conversion Time: The time it takes for a analog-to-digital conversion

3 Data Converter Basics • Real world signals are analog (temp, pressure, position, sound, light, speed, etc) : – Continuous time – Continuous amplitude • DSP can only process: – Discrete time – Discrete amplitude Data conversion from analog to digital and digital to analog is needed

4 Typical embedded application
• Real world signals are analog (temp, pressure, position, sound, light, speed, etc) : – Continuous time – Continuous amplitude • DSP can only process: – Discrete time – Discrete amplitude Physical variables (temperature, pressure, light,…) Transducer electrical signals Signal conditioning voltages Processor Input ports Output ports Because ADC is commonly needed, most modern microcontrollers has an in-built ADC unit. Analogue-to-digital converter digital signals Digital-to-analogue converter Actuator analogue control signals

5 Analog-to-Digital Converter (ADC)
ADC converts an input analog value to an output digital representation. ADC is operated at a rate of fS samples per second. Anti-alias filter is used to avoid any aliasing phenomena. ADCs usually require the input be held constant during the conversion process, indicating that the ADC must be preceded by an Sample-and-Hold Amplifier (SHA) to freeze the band-limited signal just prior to each conversion.

6 ADC Transfer Characteristics
An ideal ADC: Accepts analog input in the form of either voltage or current Produces digital output either in serial or parallel form N = # of bits VFS= Full scale output Δ = min. resolvable input  1 LSB = VFS /2N

7 1-bit ADC

8 ADC Resolution The resolution of a N-bit ADC is a function of how many parts the maximum signal can be divided into. (Vref+ - Vref-) / 2N Note: VFS = (Vref+ - Vref-) = Full scale output Where Vref+ is the positive reference voltage and Vref- is the negative reference voltage. When Vref- = 0 V, we refer to Vref+ as simply Vref or VFS Example: For Vref = 10V, and N=12, what is 1 LS b? A 12 bit ADC has a resolution of 212 = 4,096. Therefore, our best resolution is 1 part out of 4,096, or % of the full scale or 10V / 212 = 2.44 mV Resolution is the smallest input voltage change a digitizer can capture

9 ADC : The process There are two related steps in A-to-D conversion:
Sampling Quantization Sampling: The analogue signal is extracted, usually at regularly spaced time instants. The samples have real values. Quantization: The samples are quantized to discrete levels. Each sample is represented as a digital value.


11 Sampling an analogue signal
points sampling period Ts What is a suitable sampling period for a signal?

12 The sampling theorem An analogue signal x(t) with frequencies of no more than Fmax can be reconstructed exactly from its samples if the sampling rate satisfies: Fs ≥ 2 × Fmax. Significance If maximum frequency of the signal is Fmax, the sampling rate should be at least: If the sampling rate is Fs, the maximum frequency in the signal must not exceed:

13 Example of signal with fmax = 90 Hz sinusoid sampled
Fig 1 Fig 2 Fig 1: Sample fs = 1000 Hz (11xFmax) These samples represent accurately the sinusoid because there is no other sinusoid that can produce the same samples Fig 2: Sample fs = 290 Hz (3.2xFmax) Strange as it seems, it can be proven that no other sine wave can produce the same type of samples Fig 3: Sample fs = 95 Hz (1.05xFmax) Clearly, this is an improper sampling of the signal because another sine wave can produce the same samples The original sine misrepresents itself as another sine. This phenomenon is called aliasing. Fig 3

14 Quantizing the sampled signal
A-to-D converter Consider an n-bit ADC. Let Vref be the reference voltage. Let Vin be the analogue input voltage. Let Vmin be the minimum allowable input voltage, usually Vmin = 0. The ADC’s digital output, d = Dn-1Dn-2 …D0, is given as The step size (resolution) is the smallest change in input that can be discerned by the ADC: Step size = 𝑽𝒓𝒆𝒇 − 𝑽𝒎𝒊𝒏 𝟐𝑵

15 Quantizing the sampled signal
step size Maximum digital output 23 levels Reference Voltage Vref A 3-bit A-to-D converter

16 Quantizing the sampled signal
quantization error analogue signal quantized signal 8 levels (N =3) sampling points 3-bit ADC sampling period

17 ADC : Parameters Number of bits N: The higher is the number of bits, the more precise is the digital output. Quantisation error Eq: The average difference between the analogue input and the quantized value. The quantization error of an ideal ADC is half of the step size. Sample time Tsample: A sampling capacitor must be charged for a duration of Tsample before conversion taking place. Conversion time Tconv: Time taken to convert the voltage on the sampling capacitor to a digital output.

18 A 5 kHz Sine Wave sampled by a 3-bit versus a 16-bit ADC

19 Digital-to-Analog Converter (DAC)
The digital data is processed by a microprocessor and output to a DAC. DAC is usually operated at the same rate fS as the ADC When the application demands, it is equipped with appropriate circuitry to remove any output glitches arising in connection with input code changes. The resulting staircase-like signal is finally passed through a smoothing filter to ease the effects of quantization noise.

20 DAC Transfer Characteristics
An ideal DAC: Accepts digital input b1-bN Produces either analog output voltage or current N = # of bits VFS= Full scale output Δ = min. step size  1 LSB = VFS /2N

21 ADC Equations Vin = input voltage, Vref+ = ref voltage, Vref- = 0 V, (Note: Vref = VFS) N = number of bits of precision output_code = Vin / Vref * 2N Vin = output_code / 2N * Vref 1 LSB = Vref / 2N

22 DAC Equations Vout = output voltage, Vref = reference voltage,
N = number of bits of precision Input_code = Vout/ Vref * 2N Vout = input_code / 2N * Vref 1 LSB = Vref / 2N

23 Sample ADC, DAC Computations
Example: Given N=3, VFS= 1.6V and input code = 101. Find the output value V0ut Solution: V0 = Δ (b1x22 + b2x21 + b3x20) Δ = VFS /23 = 1.6V / 8 = 0.2V V0 = 0.2V (1x22 + 0x21 + 1x20) = 0.2V x 5 = 1V


25 Sample ADC, DAC Computations
If Vref = 5V, and a 10-bit A/D output code is 0x12A, what is the ADC input voltage? Vin = output_code / 2N * Vref = (0x12A) / 210 x 5 V = 298/1024 x 5 V = 1.46 V (ADC Vin) If Vref = 4V, and an 8-bit A/D input voltage is 2.35 V, what is the ADC output code? output code = Vin / Vref x 2N = 2.35 V / 4 V x 28 = x 256 = = 150 = 0x96 (ADC output code)

26 Improve the accuracy in ADC
Increase the sampling rate which increases the maximum frequency that can be measured. Increase the resolution which improves the accuracy in measuring the amplitude of the analog signal.

27 References:
Home > Products and Services > White Papers > Understanding Resolution in High-Speed Digitizers/Oscilloscopes

Download ppt "Introduction to Data Conversion"

Similar presentations

Ads by Google