Presentation on theme: "Introduction to Data Conversion"— Presentation transcript:
1 Introduction to Data Conversion EE174 – SJSULecture #2Tan 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 valueDAC (Digital-to-Analog Converter): converts a digital value to an analog value (voltage/current)Sample period: for ADC, time between each conversionTypically, samples are taken at a fixed rateVFS / Vref (Full scale or Reference Voltage): Analog signal varies between 0 and Vref, or between +/-VrefResolution: 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 amplitudeData 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 amplitudePhysical variables(temperature, pressure, light,…)Transducerelectrical signalsSignal conditioningvoltagesProcessorInput portsOutput portsBecause ADC is commonly needed,most modern microcontrollers hasan in-built ADC unit.Analogue-to-digital converterdigital signalsDigital-to-analogue converterActuatoranaloguecontrol 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 currentProduces digital output either in serial or parallel formN = # of bitsVFS= Full scale outputΔ = min. resolvable input 1 LSB = VFS /2N
8 ADC ResolutionThe 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 outputWhere 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 VFSExample: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 mVResolution is the smallest input voltage change a digitizer can capture
9 ADC : The process There are two related steps in A-to-D conversion: SamplingQuantizationSampling: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 pointssampling period TsWhat is a suitable sampling period for a signal?
12 The sampling theoremAn analogue signal x(t) with frequencies of no more than Fmax can bereconstructed exactly from its samples if the sampling rate satisfies:Fs ≥ 2 × Fmax.SignificanceIf 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 1Fig 2Fig 1: Sample fs = 1000 Hz (11xFmax)These samples represent accurately the sinusoid because there is no other sinusoid that can produce the same samplesFig 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 samplesFig 3: Sample fs = 95 Hz (1.05xFmax)Clearly, this is an improper sampling of the signal because another sine wave can produce the same samplesThe original sine misrepresents itself as another sine. Thisphenomenon is called aliasing.Fig 3
14 Quantizing the sampled signal A-to-D converterConsider 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 asThe step size (resolution) is the smallest change in input that can be discerned by the ADC:Step size = 𝑽𝒓𝒆𝒇 − 𝑽𝒎𝒊𝒏 𝟐𝑵
15 Quantizing the sampled signal step sizeMaximum digital output23 levelsReferenceVoltage VrefA 3-bit A-to-D converter
16 Quantizing the sampled signal quantization erroranalogue signalquantizedsignal8 levels(N =3)samplingpoints3-bit ADCsampling period
17 ADC : ParametersNumber 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 ADCWhen 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-bNProduces either analog output voltage or currentN = # of bitsVFS= Full scale outputΔ = min. step size 1 LSB = VFS /2N
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: http://www.ni.com/white-paper/4806/en/ Home > Products and Services > White Papers > Understanding Resolution in High-Speed Digitizers/Oscilloscopesume.gatech.edu/mechatronics_course/ADC_F10.pptx