26
Digital measurements and digital instruments

Digital measurements and digital instruments

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Digital measurementsand digital instruments

Analog instruments – some historyMoving-coil ammeter

1

N S B

z⋅I

z⋅Id

α⋅=

⋅⋅⋅⋅=

kM

ldzIBM

S

I

IcIk

ldzBMM SI ⋅=

⋅⋅⋅=⇒= α

r ~ 10-100Ω

I

UIrU ⋅=

input terminals

ammeterR

r

voltmeterRr

range expansion

coefficient

Rr

+1

rR

+1

Types of digital instruments

1. „Traditiona” instruments

bench-top and hand-held multimetersR, L, C, Z, Q – metersfrequency meterscounters

2. Computer cards

electrical signals + + software

3. Virtual Instruments

computer processeing and visualization of data

electrical signalstime, frequencynon-electrical quantities

+ + software

Digital multimeter (DMM)

AC/DC

A/C

AC

DC

R

AC

DC

R

display

3.1415

interfaceRS232GPIB

attenuator

I

R/U Urefshunt

C/U

T/U

Digital measurement chain

bias conditioning circuitry

µCDSPSOC...

analog part digital part

C/ARef

Ref

sensor

CLK

processingA/C 2.718

Ideal Analog-to-Digital Converter (ADC)

q

2q

3q

3q

4q

5qnatural binary code

codes with signBCD

Gray code

→ 000

→ 001

→ 010

→ 011

→ 100

→ 101

sampling(constant rate)

quantization coding

q

LSB

analog input

dig

ital

out

put

000

001

010

011

100

101

110

111

q 2q 3q 4q 5q 6q 7q 8q

FS

FS = q⋅2N

N 2N q (FS=1.024V) q [dB FS]

8 256 4 mV -48

10 1024 1 mV -60

12 4096 250 µV -72

16 65536 15.625 µV -96

24 16777216 61 nV -144

Basic codes

Natural binary code

000000 → 0 (e.g. 0)11111111 → 2N-1 (e.g. 255)

∑−

=

−− ⋅=∈1

00121 2:1,0

N

i

iiNN aLaaaa K

Two’s complement code

100000 → -2N-1 (e.g. -128)

∑−

=

−−− ⋅+⋅−=∈2

0

110121 22:1,0

N

i

ii

NNNN aaLaaaa K

Gray code

0 00000

1 00001

2 00011

3 00010

4 00110

5 00111

6 00101

7 00100100000 → -2N-1 (e.g. -128)01111111 → 2N-1-1 (e.g. 127)

Binary Coded Decimal (BCD) code

D3 | D2 | D1 | D0

b3b2b1b0 | b3b2b1b0 | b3b2b1b0 | b3b2b1b0

3.5 digits: ±1999 ; ±39993¾ digits: ±8999 4.5 digits: ±510005.5 digits: ±119999

∑ ∑−= =

⋅=l

kj i

iij

j aL3

0

210

7 00100

8 01100

9 01101

10 01111

11 01110

12 01010

13 01011

14 01001

15 01000

16 11000

An example ADC: Flash Converter

+

-

+

-

+

-

R

R/2

UREF

IN

R

9q/2

11q/2

13q/2

tran

scod

er

bin

ary

natu

ral co

de

(MSB) B2

?

?

0

0

0

„1 f 7” codeOne Hot

+-

+-

+-

+-

OR gate

111

110

101

100

011

+

-

+

-

+

-

+

-q/2

R/2

R

R

R

R

FS = UREF

N = 3

q = UREF/8

3q/2

5q/2

7q/2

9q/2

tran

scod

er

ther

mom

etri

c co

de→

bin

ary

natu

ral co

de

(LSB) B0

B1

0

0

? -

+-

+-

+-

B1

10

B0

10

B2

01

natural binary code

011

010

001

000

1 11

Succesive Approximation (SAR)

IN S&H

SAR

control conv. STARTconv. STOP

CLK

13q/2

DAC

SARregister

WY 0 1

0

q/2

3q/2

5q/2

7q/2

9q/2

11q/2

13q/2

1

0 1

conversionSTART

READY/BUSY

Dual Slope ConverterIREF

const.IX~UX

const.

C

TI

const.TX

var.

UC

C

TI

dtIC

U

IX

IT

XCI

== ∫0

1

C

TIU

dtIC

UU

XREFCI

XT

REFCIC

⋅−

=−= ∫0

1

C C

I

XREFXC T

TIIU =⇒= 0

( )( )

=⇒⋅+

=

−=

IT

I

IIT

Tn

Tdtt

0

0

022

1cossin

K

ππω

ω

ωω

Noise immunity (suppression):

-

TI TI

+

-

+

TI TI

∑∑∑∑-δδδδ (sigma-delta) Converter

n⋅fCLK

∫∫∫∫

+UREF

+

- QD

n⋅ fCLK

1-bit output (n⋅fCLK)

n-bit output (fCLK)

decimating filter „notch” filter

IN

OUT

A B

CfCLK

UWE=0 UWE>0 UWE<0

C

A

B

Simplified Waveforms

-UREF

Digital-to-Analog Conversion (DAC)

t

ideal DAC output

t

reconstructed signal

f

|H(f)|

fS/2

reconstruction filter

t

Real DAC outputZero-Order Hold interpolation

???????????????

t

Basic DACsBinary-weighted DAC

I I/2 I/4 I/8

MSB LSB

-

+UOUT

R/8 R/4 R/2 R

MSB LSB

UREF

-

+UWY+

R R R

2⋅R

2⋅R

2⋅R

2⋅R

2⋅R

UREF

MSB LSB

UREF/2 UREF/4 UREF/8

-

+

R-2R ladder DAC

UOUT

R R R

2⋅R

2⋅R

2⋅R

2⋅R

2⋅R

UREF

RO

= 2

⋅R

Inverted R-2R ladder DAC

UOUT

+

Conversion errors - quantization noise

1.5Continuous

0.1 40

-0.1

-0.05

0

0.05

0.1

quantization error ε

-0.05 0 0.050

2

4

6

8

10

12

14

error histogram

-1.5

-1

-0.5

0

0.5

1

1.5Continuous

Sampled

4-bit quantizer

-1.5

-1

-0.5

0

0.5

1

1.5Continuous

Sampled

qq

RMS ⋅≈= 289.012

ε

ε

q/2-q/2

p(ε)

-0.1

-0.05

0

0.05

0.1

-0.05 0 0.050

10

20

30

40

]dB[02.62

log20log20

]dB[76.102.6log20

Nq

qq

FSDR

NS

SNR

N

RMS

RMS

⋅===

+⋅==ε

ADC Errors

100

101

110

111

% FSGain Error

100

101

110

111

Offset Error

offset% FS

q000

001

010

011

100

2q 3q 4q 5q 6q 7q 8q000

001

010

011

100

q 2q 3q 4q 5q 6q 7q 8q

Conversion non-linearity

011

100

101

110

111

Integral non-linearity (IN)

011

100

101

110

111

Differential non-linearity (DN)

LSB

LSB

000

001

010

q 2q 3q 4q 5q 6q 7q 8q000

001

010

q 2q 3q 4q 5q 6q 7q 8q+1 LSB-1 LSB -1 LSB +1 LSB

Some drastic examples

011

100

101

110

111

DL<-1LSB

Missing Code

011

100

101

110

111

Non-monotonicity

000

001

010

q 2q 3q 4q 5q 6q 7q 8q -1 LSB +1 LSB000

001

010

q 2q 3q 4q 5q 6q 7q 8q

Does sampling give us the full information about the signal?

the answer is „YES”provided that we respect...

Sampling theorem

Shannon-Kotielnikov, Nyquist-Shannon, ...

It is possible to recover the signal exactly from its samples taken at the constant rate fS if the the signal is band-limited and there are no spectral components above frequency fS/2.

fS – sampling frequencyfS/2 –Nyquist frequencyfS/2 –Nyquist frequency

or stating it more directly:

Sampling rate must be at least two times higher than the bandwidth occupied by the signal.

f

fmax 2fmax

fS>2fmaxsignal

spectrum

A/C

fS

Low-PassFilter

input

signal

AliasingX(f) – signal spectrum (two-sided)

spectrum of sampled signal:

( ) ( )∑+∞

−∞=

⋅−n

sS fnfXfX ~

signal

signal spectrum

fS/2-fS/2

ffmax-fmax

fS 2⋅fS-2⋅fS -fS

fS 2⋅fSfS2⋅fS

aliasing

signal spectrum

Aliasing more accesible...

1.2 kHz0.6 kHz 2 kHz

1 kHz

0

-1 kHz

+1.2 kHz

0.2 kHz

1

1.5

signalfSfN

0 2m 4m 6m 8m 10m -1.5

-1

-0.5

0

0.5

1

...

1.6 kHz0.8 kHz

1 kHz

2 kHz0

-1 kHz

+1.6 kHz

0.6 kHz

1

1.5

0 2m 4m 6m 8m 10m -1.5

-1

-0.5

0

0.5

1

...

1

1.5

1.9kHz

0.95 kHz

2kHz

1kHz

0

-1 kHz

+1.9 kHz0.9kHz

0 4m 8m 12mm

16m 20m -1.5

-1

-0.5

0

0.5

1

Aliasing in practice it can appear with a DSO!

Why?

Sampling theorem (in short)

Sampling rate must be at least two times higher than the bandwidthoccupied by the signal.

f

fmax 2fmax

fS>2fmaxsignal

spectrum

Is this a case of a DSO?

A/C

fS

Low-PassFilter

input

signal

Is it possible to have fS < 2××××fmax ???

100 ps

Equivalent time sampling

Sequential sampling

Random repetitive

100 µs

Random repetitive sampling

1 ps1 TS/s

A/Csignal input

trigger input

sample & hold

tor Y

tor XS&H Control