electronic instrumentation signalsbrd4.ort.org.il/~ksamuel/elin.31361/lectures/011 analog... ·...

19
Electronic instrumentation Analog and Digital Signals in TD Lecturer: Dr. Samuel Kosolapov

Upload: others

Post on 07-May-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Electronic instrumentationAnalog and Digital Signals in TD

Lecturer: Dr. Samuel Kosolapov

Page 2: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Items to be discussed

2

• Analog Signal, Digital Signal, Logic Signal• How to describe signal• Analog Signal versus Digital Signal: Accuracy of digitization• Graphic presentation of the signals in TD (Time Domain) • Instruments: Analog Signal Generator and Digital Signal Generator• Instruments: Analog and Digital Oscilloscope

Page 3: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Signal

3

In the frames of this coursesignal is value of some physical parameter as a function of time.

Important examples:

Voltage Signal == Voltage as a function of time

Temperature as a function of time

Light Intensity as a function of X,Y (TV, Image Processing)

Page 4: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Signal: Analog versus Digital

4

Analog Signal Digital Signal and Logic Signal

Analog signal is a Continuous signal

ANY (voltage) level is possible at ANY time

For example:2.35 V at t= 1.25 sec;0.489 V at t = 1,69 sec

Digital Signal is a Discrete-time signal

(discrete number of (voltage) levels. are possible

at specified time (clock)Important to understand:

Digital signal can has more than 2 levels !!!

A Logic signal is a digital signal with only two possible values

For example:“0” and “1” onlyTTL: “0” : 0 .. 0.8V

“1”: 2 .. To Vcc Vcc = 5V +- 10%CMOS: L voltage: 0V to Vdd/2

H voltage: Vdd/2 to Vdd(Vdd = supply voltage)

Page 5: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Signal: Analog & Digital: Explicit (Exact, Detailed) math description

5

Signals can be exactly described by explicit formula or “algorithm”

Analog SignalExplicit formula

𝑉 𝑡 = 𝑆𝑜𝑚𝑒𝐹𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑡, 𝑃𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟𝑠

Digital SignalAlgorithm

(set of conditions and operations)

Example:

V 𝑡 = 𝑠𝑖𝑛 2 ∗ 𝜋 ∗ 𝑓 ∗ 𝑡

Generally usage of “good-behaved” math function is assumed,but “bad behaved” Heaviside and Dirac functionsare widely used in Electronics

Example:

V 𝑡 = 0, t≤0;1, 0<t ≤ 1;0, 1<t;

Piece-wise presentation of the “digital pulse”

Q: Can Digital Signal can be used as Analog Signal ?Q: Can Analog Signal can be used as Digital Signal ?A. Digital signal can always be used as Analog Signal.

Opposite is not always correct

Page 6: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Analog Signal versus Digital Signal

6

Graphical Presentation of the Signal in TD (Time Domain)

Analog Signal Digital SignalANY (voltage) level is possible at ANY time Logical Signal: Only 2 voltage levels are allowed

Graphical presentation:Analog Signal:

Y: Voltage (units : V, mV, dB..)X : Time (units : sec, ms, …)

Digital Signal:Y: Voltage (units : V, mV, counts )X : Time (units : sec, ms, counts)

Debouncing problem.Mechanical switch is not OPEN/CLOSED only. Problem with mechanical

switch in digital circuits

Page 7: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Debouncing. “Hardware Solution” – RC Debouncer

7

Switch debouncing is one of those things you generally have to live withwhen playing with switches and digital circuits. If you want to input a manual switch signal into a digital circuityou'll need to debounce the signal

so a single press doesn't appear like multiple presses.

Those circuits are an example of important concept: “signal conditioning”-intended modification of the input signal

Simple RC Debouncer.Q. How to select RC ?

Better Debouncer (really works in all cases).Q. Why better ?A. http://www.eng.utah.edu/~cs5780/debouncing.pdf

Page 8: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Software Debounce with Arduinohttps://www.arduino.cc/en/Tutorial/Debounce

8

This “obvious counter ” circuit with button and LEDwill not work as expected.

Special “debounce” software is needed.Each time the button is pressed, the input pin 2

goes from LOW to HIGH Then, the output pin 13 is toggled

from LOW to HIGH or HIGH to LOW. There's a minimum delay between toggles (default 50 ms)

to debounce the circuit (i.e. to ignore ”noise”).Full code + Bounce library will be discussed later

LED of Pin 13 is used in this example

Goal: count number of times the button pressed.

Page 9: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Analog Signal versus Digital Signal

9

More Voltage levels Better, but still

Rude approximationNumber of voltage levels

is still very small

Graphical Presentation of the Signal in TD (Time Domain)

Analog Signal Digital Signal

Page 10: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Analog Signal versus Digital Signal

10

Even more voltage levels are allowed. Digitization “defects”can be treated as

“Digitization Noise”.

Graphical Presentation of the Signal in TD (Time Domain)

Analog Signal Digital Signal

Page 11: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Analog Signal versus Digital Signal

11

We can not visually distinguish “Digital” signal from “Analog” signal

on this slide(because number of voltage

levels is high enough).The question is:How much levels are we really needsExample:

Audio: 16 bit ~ 32000 voltage levels

Video 8 bit 256 Gray levels

Graphical Presentation of the Signal in TD (Time Domain)

Analog Signal Digital Signal

Additional parameter is digitization frequency

(time interval between “counts” )It will be discussed later

(Nyquist frequency)

Page 12: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Laboratory Instrument: Classical Analog Signal Generator

12

Principle of operation,design,

properties,Advantages and disadvantageswill be discussed later

Classical Analog Signal Generatorproduces sinusoidal analog signals

by using analog electronic circuits(for example: Wien Bridge oscillator)

Frequency and amplitude are set by usinganalog electronic components

(for example, potentiometers)

Page 13: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Important Laboratory Instrument: Modern Laboratory Signal Generator

13

Principle of operation,design,

properties,Advantages and disadvantageswill be discussed later

Modern Laboratory Signal Generatorproduces a set of important analog and digital signals

by using as analog as digital electronic circuits

Signal parameters are set by usingdigital electronic means

(for example, buttons, touch screen menu)

Page 14: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

How to create, store and “output” Digital Signals: Modern way

14

Any Microprocessor can easily create by using relevant programming language

any signal (described by explicit formulae or algorithm,

store it in the memory (as an array), and “output it” by using

internal or external DACProduced signal can be treated as

still digital signal (DAC without filter)or

as analog signal (DAC with filter)

Page 15: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Digital (Arduino-based) Signal Generators

15

Possible designs of Arduino Uno based signal deneratorswill be discussed later

Adruino Due has two pinsthat can be configured as DAC

Very simple Signal Generator can be build

https://www.arduino.cc/en/Tutorial/DueSimpleWaveformGenerator

Arduino Waveform Generator Shield http://www.instructables.com/id/Arduino-Waveform-Generator-Shield/

Any Microprocessor can easily create any signal

(described by explicit formulae or algorithm, store it in the memory,

and out it by usinginternal or external DAC

Page 16: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Important Laboratory Instrument: Analog Oscilloscope

16

Principle of operation,design,

properties,Advantages and disadvantageswill be discussed later

Analog Oscilloscope: graphically presents Analog (or Digital) Voltage

as a function of time

Operation: Simple Physic. Analog Electronics circuits

Page 17: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Important Laboratory Instrument: Modern Digital Oscilloscope

17

Good scope may cost ~ 10 kNis

Digital Oscilloscope: graphically presentsAnalog (or Digital) Voltage

as a function of time

Operation: Sophisticated electronics(contains analog and digital blocks)

with sophisticated software/firmware

Page 18: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Poor man’s Arduino Based Oscilloscopehttp://www.instructables.com/id/Arduino-Oscilloscope-poor-mans-Oscilloscope/

18

A number of Inexpensive Arduino-based scope designsAnd their parameters will be discussed later

Arduino board without changes and additionscan be used to digitize analog signal

by using analog input pin(s) (ADC)send digitized signal to PC

and present it on the PC monitor.

Sketch for Arduino and software for PC are needed

Example: Inexpensive Arduino-based scope presents signal of simple 555 timer

on the monitor of the PC.

Page 19: Electronic instrumentation Signalsbrd4.ort.org.il/~ksamuel/ElIn.31361/Lectures/011 Analog... · 2016-02-28 · Signal: Analog versus Digital 4 Analog Signal Digital Signal and Logic

Fast Arduino Based Oscilloscope (Girino)http://www.instructables.com/id/Girino-Fast-Arduino-Oscilloscope/

19

Much more sophisticated Arduino scope can be build.However detailed understanding of microcontroller operations and low level programming are needed

+ external electronic is needed to implement “standard” scope’ functions