JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of...

38
JF 12/04 111 BSC Data Acquisition and Control Data Representation Computers use base 2, 0 1 2 3 0 1 2 3 0 10 10 10 10 10 n n n a a a a a 0 1 2 3 0 1 2 3 0 2 2 2 2 2 n n n a a a a a instead of base 10: ally, information is represented by binary digits; either on or off.
  • date post

    20-Jan-2016
  • Category

    Documents

  • view

    214
  • download

    0

Transcript of JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of...

Page 1: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Data Representation• Computers use base 2,

0 1 2 30 1 2 3

0

10 10 10 10 10nn

n

a a a a a

0 1 2 30 1 2 3

0

2 2 2 2 2nn

n

a a a a a

instead of base 10:

• Internally, information is represented by binary digits; “switches” that are either on or off.

Page 2: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Data Converters• Signals must be converted to their digital

representation:– ADC: Analog to Digital Converter.

• ADCs and DAQs are imperfect. Important parameters include:– Sample rate.

– Resolution.

– Linearity.

Computer

• Digital information must be converted to analog signals:– DAC: Digital to Analog Converter.

Computer

Page 3: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Sampling

Page 4: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Sample Rate

• High Sample Rates can better represent high frequency waveforms.

1f 10.4sf 1f 2.35sf

Page 5: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Nyquist Theorem

• What is the lowest sample rate that can represent a signal?

• The Nyquist Theorem states that a wave can be correctly represented when sampled at a rate equal to twice the highest frequency of the wave.

1f 2sf

Page 6: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Aliasing

• Sampling below the Nyquist frequency leads to aliasing:

1f 0.53sf 1f 1.7sf

Page 7: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: What rate?

• Preferably, one should operate far above the Nyquist limit.

1f 10.4sf 1f 2.35sf

• Sampling 10 to 100 times higher than the signal frequency generally works very well.

Page 8: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: What rate?• Unfortunately, it is often impossible to sample this fast.

– The employed device may not be capable of sampling at the desired rate.– The desired rate may be technologically impossible. – Even if it is possible, you may not be able to afford the required device.

• ADC’s– 250kS/s --- $375 for a computer card.– 10MS/s --- $4000.– 200MS/s --- $6000.– 1GS/s ---$10,000.

• DAC’s– Static --- 8 Channels for $700.– 1MS/s --- 4 Channels for $800.– 200M/s --- 1 Channel for $6000.

Page 9: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: What rate?• Unfortunately, it is often impossible to sample this fast.

– The employed device may not be capable of sampling at the desired rate.– The desired rate may be technologically impossible. – Even if it is possible, you may not be able to afford the required device.– Fast sampling may produce or require too much data.

• Limited buffer sizes• Limited computational speeds.

Page 10: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Near Nyquist Sampling

Sampling Simulator.exe

Sampling Simulator.llb

• Using the “Sampling Simulator,” explore the effects of various sampling rates on different waveforms with interpolation off.

• Using interpolation, explore the effects of various sampling rates on different waveforms. Note: that well above the Nyquist frequency, ramp interpolation represents the signal better than flat interpolation.

• Real world signals are continuous. Sampling is discontinuous. Interpolation is used to turn the discontinuous samples into a continuous signal.

No Interpolation “Flat” Interpolation

Commonly used by DACs

“Ramp” Interpolation

Option on expensive DACs

Comb Interpolation

Theoretically optimal

Page 11: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Near Nyquist Sampling

Sampling Simulator.exe

Sampling Simulator.llb

• Below the Nyquist Frequency, aliasing can produce deceptively pretty waveforms. Be careful.

• Just above the Nyquist Frequency, the sampled waveforms look nothing like the original waveform.

Is the Nyquist Theorem wrong?1f 2.05sf

Page 12: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Near Nyquist Sampling

Sampling Simulator.exe

Sampling Simulator.llb

1f 2.05sf

• The sampled spectrum has two peaks;– One at the original signal frequency.

– One above the Nyquist frequency.

• We observe an apparent beat between these frequencies.

Page 13: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Near Nyquist Sampling

Sampling Simulator.exe

Sampling Simulator.llb

1f 2.05sf

• The sampled spectrum has two peaks;– One at the original signal frequency.

– One above the Nyquist frequency.

• We observe an apparent beat between these frequencies.

• The higher frequency can be filtered away to recover the original signal from the sampled signal.

• Filtering must be done carefully.

Page 14: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Near Nyquist Sampling0.7,1f 3sf

Sampling Simulator.exe

Two Tone Signal

Sampling Simulator.llb

Page 15: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Near Nyquist SamplingAM Modulated Signal

Sampling Simulator.exe

2sf 0.05f 0.93cf

Sampling Simulator.llb

Page 16: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: RC Filtering• We need to kill frequencies higher than the Nyquist Frequency.• Could use an RC filter:

Low 1f

• First Order RC filters are not sharp enough.

Page 17: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: RC Filtering• Try a 2nd order filter:

Low 1f

Page 18: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: RC Filtering• We need even higher order.

Low 1f

• A 6th order RC filter kills the amplitude by a factor of 100 one octave above its cutoff.

Page 19: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: RC Filtering• But the signal is significantly reduced in the passband as well!

Low 1f

Page 20: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Sharper Filters• Filter designs using inductors (or gyrator synthesized inductors) are much sharper.• Using, as a figure of merit, a reduction by a factor of 100 one octave above the cutoff:

Low 1f

• Chebyshev has the best frequency response.

Page 21: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Temporal Response• Unfortunately, good frequency response generally yields poor temporal response.

• Bessel filters have the best temporal response.

Low 1f

Page 22: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: When is Filtering Required?• Both DACs and ADC usually require filters.

– DACs:• Filtering turns the discontinuous output from your DAC into a continuous signal.

• Occasionally, the device being driven by the DAC is insensitive to the high frequency components in the unfiltered DAC output. If so, filtering is unnecessary.

Page 23: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: When is Filtering Required?• Both DACs and ADC usually require filters.

– ADCs:• Filtering prevents aliasing.

– Input signals are often noisy, and this noise may extend above the Nyquist frequency.

Page 24: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: When is Filtering Required?• Both DACs and ADC usually require filters.

– ADCs:• Filtering prevents aliasing.

– Input signals are often noisy, and this noise may extend above the Nyquist frequency.

On sampling:

• Frequencies above the Nyquist Frequency mirror:

Observed ActualNyquist Nyqui

Samp Actu

t

ale

s

l

ff f

f

f

f

Sampling Simulator.exe

Sampling Simulator.llb

Page 25: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

• Both DACs and ADC usually require filters.– ADCs:

• Filtering prevents aliasing.– Aliasing artifacts confuse the spectrum and distort the waveforms.– Unless the spectrum is very quiet above the Nyquist frequency, the signal must be filtered before it is converted by the ADC.– But filtering itself introduces artifacts:

» Spectral amplitude errors in the passband.

» Distortions to the temporal waveform.

Conversion: When is Filtering Required?

Page 26: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

• Both DACs and ADC usually require filters.– ADCs:

• Filtering prevents aliasing.• Very occasionally aliased signals can still be used.

– Spectrum is predictable, but reversed.– The DAC’s analog bandwidth may make

Conversion: When is Filtering Required?

Page 27: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: When is Filtering Required?• Both DACs and ADC usually require filters.

– ADCs:• Filtering prevents aliasing.• Filtering turns the discontinuous measurements from your ADC into a continuous signal.

• “Ideal” filters for static signal reconstruction can be developed using Fourier Transforms.• Filtering is unnecessary if you are only interested in the spectral content of your signal.

Page 28: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

Conversion: Resolution• Resolution specified in number of bits.

• n-bit converter can represent 2n levels.

42 1622 4 62 64

Page 29: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

BSC Data Acquisition Card

Function Number Rate Resolution

ADC 8 200kS/s* 12 bits

DAC 2 1MS/s 12 bits

Digital In/Out 8 bits

*Though not spec’d to do this the card will digitize faster than 1.6MS/s when acquiring a single channel.

Page 30: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

DAC Circuits: Scaled Resistor

• bn is either 0 (off) or 1 (on.) Then:

0 1 2 3 42 4 8 16outV b b b b b

Page 31: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

DAC Circuits: Scaled Resistor DAC Errors

• Focus on a low and high order bit:

0 124096outV b b • What happens if the high order bit resistor is off by 1%? Say: 0 124055outV b b

or: 0 124137outV b b

• Instead of changing the output from 4095 to 4096, it would change to 4055 or 4137.

0111111111111 1000000000000

Page 32: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

DAC Circuits: Scaled Resistor DAC Errors

• A 16bit DAC requires resistors accurate to 0.002% over a 1:65536 resistance range.• Such accurate resistors cannot be fabricated.• Accurate resistors can be fabricated over a narrow resistance range.

•Laser trimming.

Page 33: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

DAC Circuits: R-2R

Virtual Ground

Page 34: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

DAC Circuits: R-2R Ladder

Page 35: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

DAC Circuits: R-2R Ladder

Page 36: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

DAC Circuits: R-2R Ladder

0 1 2 3 4

1 1 1 1

16 8 4 2outV b b b b b

Page 37: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

ADC Circuits: Flash (Parallel) Converters

• Very fast.• Low Resolution• Expensive

Page 38: JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.

JF 12/04 111 BSC Data Acquisition and Control

1. ADC Circuits: Successive Approximation

1. Make a guess.2. Convert the guess to a voltage with a DAC.3. Compare the guess voltage to the actual voltage.4. Refine the guess.

.

.

.5. Stop when satisfied with the accuracy of the

answer.

AD Simulator.llb