43
Digital Signal Processing Alexander Nelson October 14, 2019 University of Arkansas - Department of Computer Science and Computer Engineering

Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Digital Signal Processing

Alexander Nelson

October 14, 2019

University of Arkansas - Department of Computer Science and Computer Engineering

Page 2: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Digital Signal Processing

Digital Signal Processing – signal processing in the discrete domain

Signal Processing – “analysis, synthesis, and modification of

signals”

Signals – “functions conveying information about behavior or

attributes of some phenomenon”

1

Page 3: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Signals

Signals – “functions conveying information about behavior or

attributes of some phenomenon”

Real world signals are typically analog

Often sinusoidal in nature

2

Page 4: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Information

Information – “Any entity or form that provides the answer to a

question or resolves uncertainty”

Signals provide information about a phenomenon

Information resolves uncertainty about a question or phenomenon

3

Page 5: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Information: Example

Example:

Question – What is the temperature of an object?

Temperature – physical quality of a material

Signal – Analog quantity of temperature over time

Thermometer – Instrument that measures the physical quantity

Digital Signal – Discrete value of the signal measured by the

thermometer

Information – How much uncertainty the signal resolves

4

Page 6: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Entropy – Information Theory

Entropy – Average amount of information produced by stochastic

source of data

Coin toss - 1 bit of entropy per toss

5

Page 7: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Entropy Example

Assume I have a properly shuffled card deck

What is the uncertainty?

6

Page 8: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Entropy Example

Assume I have a properly shuffled card deck

What is the uncertainty?

What is the probability of drawing any particular card? = 1/52

7

Page 9: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Entropy Example

Assume I have a properly shuffled card deck

What is the uncertainty?

What is the probability of drawing any particular card? = 1/52

Bits of information = log2(52) = 5.7 bits of information

8

Page 10: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Entropy Example

How many bits if you knew it wasn’t a heart?

How many bits if you knew it was a spade?

How many bits if you knew it was the 3 of clubs?

9

Page 11: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Digital Signal Processing

Page 12: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Sensors

Sensor – Component that measures physical phenomena

Usually provides an Analog signal – Need to convert to digital

Raw analog signals carry information

Signal processing enables understanding of that information

10

Page 13: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Sensor Limits

Limitations:

• Range – How wide the physical quantity can be measured

• Resolution – How specific can the measurement be

• Accuracy/Precision – How close is measured value to actual

value

• Raw – Typically measuring voltage or other physical quantity

that relates to the actual value – Requires processing

11

Page 14: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Example

Range – 4-34pF

Sensitivity – 4pf/10000

count = 0.4fF

Non-linear – Above 25pf,

non-linear response

Raw – Capacitance must

be related to physical

quantity

12

Page 15: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Example

Capacitance to position

Fabric sensors detect distance to

person

13

Page 16: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Actuator

Actuator – Component with in input that converts input to energy

e.g.

• Servo – Kinetic Energy

• LED – Light Energy

• Thermal – Heating elements

14

Page 17: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Example – Servo

Servo – Converts PWM signal to angle

15

Page 18: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Transform

Transform – Takes input, modifies, & generates output

Examples:

Smart streetlight – Samples light sensor, turns on streetlight

gradually at sunset

Stereo – Samples CD input and volume dial, plays sound on

speakers

Conceptually:

Input→Transform→Output

16

Page 19: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

ADC – Analog to Digital Converter

Mixed-Signal Transform – Converts analog signal to digital signal

DAC is also a mixed-signal transform – converts digital to analog

ADC has the following characteristics:

• Input Range – Voltage of the high and low values

• Output Range/Quantization – Number of bits that the value

can map to

• Sampling Rate – Frequency of measuring the value

17

Page 20: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

ADC – Amplification

Many signals don’t have enough peak-to-peak variance to

recognize with high sensitivity

Signal under-loading – ADC isn’t sensitive enough

Amplifier – Transform – Multiplies signal by some value (called

Gain)

Gain – Multiple that signal is multiplied by

Gain > 1 – Amplifier, Gain <1 – attenuator, Gain = 1 – buffer

18

Page 21: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

ADC – Amplification

Goal of gain – Obtain peak-to-peak value of signal near the input

range of ADC

Signal overloading – Too much gain; signal outside range of ADC

Clipping – Loss of signal values beyond input range

Signal underloading – Not enough gain; ADC not sensitive

19

Page 22: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Overloading

20

Page 23: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Bias

Bias – Signal average is not centered at center of ADC value

i.e. For ADC with range [-1,1], if x̂ != 0, biased in some direction

For periodic signals (e.g. Alternating Current) removing bias often

referred to as removing the DC (Direct Current)

21

Page 24: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Bias/DC

Recall Lab 7 with the FFT of the

siren

The DC is the first component of

the FFT

Can be completely subtracted

from the signal with no effect on

the periodic signals

22

Page 25: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Recap

Signal is:

• Analog

• Has bias

• Needs amplification to range of ADC

• Needs to be sampled by ADC

These processes are called “signal conditioning”

23

Page 26: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Signal Fidelity

Fidelity – Correspondence of output signal to input signal

(“accuracy”)

Affected by two parameters:

• Sampling Rate – Affects loss of value in time

• Resolution/Quantization – Affects loss of value in space

These two are related – Faster ADCs often have fewer bits

24

Page 27: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Dynamic Range

Dynamic Range – Measure of the precision of a device w/ respect

to range of values it can convert

Difference b/w dynamic range & range?

25

Page 28: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Dynamic Range

Dynamic Range – Measure of the precision of a device w/ respect

to range of values it can convert

Difference b/w dynamic range & range?

Range = peak-to-peak gap

Dynamic range = Ratio of max range to minimum precision of the

converter

All (static range) N-Bit ADCs have the same dynamic range

Often expressed in decibel logarithmic scale

26

Page 29: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Dynamic Range

range = Vmax − Vmin (1)

gap =range

2N(2)

dynamic range =range

gap(3)

=Vmax − Vmin(

Vmax−Vmin

2N

) (4)

=Vmax − Vmin

Vmax − Vmin× 2N (5)

= 2N (6)

Dynamic Range directly related to number of bits

27

Page 30: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Dynamic Range

dynamic range (dB) = 10× log

(range2

gap2

)(7)

= 10× log

(range

gap

)2

(8)

= 20× log

(range

gap

)(9)

= 20× log(2)N (10)

= N × 20× log(2) (11)

= 6.02× N (12)

e.g. 12-bit ADC has dynamic range of 6.02× 12 = 72.2dB

Human ear has approx. 130dB dynamic range

28

Page 31: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Sampling Rate

Sampling Rate should be responsive to application

Sampling sound at 2KHz results in just 2 samples in 1 ms

Clearly underlying signal cannot be reconstructed

29

Page 32: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Sampling Rate

Nyquist Rate – 2× f of highest frequency signal

Nyquist rate guarantees signal can be reconstructed from samples

Hearing Range of Humans ≈ 20Hz-20kHz

Need to sample at least 40kHz for Nyquist rate

MP3 sampling rate = 44.1kHz

30

Page 33: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Noise & Aliasing

Noise – Unwanted signal; e.g. Microwave oven vs. WiFi/Bluetooth

Noise Reduction – Techniques to remove noise from signal path

Shielding – Electrical considerations to reduce noise

Signal-to-noise ratio – Ratio of desired signal to noise

Aliasing – Presence of unexpected signal in the signal path

Source of noise if unhandled

Example: Car wheel in commercials

31

Page 34: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Aliasing Noise

If we are only trying to reconstruct lower frequency signals, can we

just ignore higher frequencies?

High frequency signals subsampled can alias onto our existing

signal, creating noise

32

Page 35: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Removing Aliasing Noise

Two approaches:

1. Sample fast enough to digitally eliminate noise – Overampling

2. Filter higher frequency signal

Oversampling is expensive in terms of storage & processing

33

Page 36: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Low Pass Filter

Filter – “pass through a device to remove unwanted material”

Signal Filter – Remove unwanted signal/noise

Low Pass Filter – Filter that lets low frequency signals through

sometimes called anti-aliasing filter

Center Frequency – Frequency that all signals below should go

through, all above should stop

Ideal filter 34

Page 37: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Low-Pass Filter

Realistic Low-Pass Filter

Unfortunately, real filters don’t respond perfectly

Some noise will get into the system

35

Page 38: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Complete Input Path

We now have the trappings of a full input DSP Path

36

Page 39: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Playback Path

What about the other direction?

37

Page 40: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Playback Path

What about the other direction?

Playback path – reconstruct the original signal

38

Page 41: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Playback Path

Speaker – Actuator for a sound system

Amplifier/Filter swap places – Don’t amplify sound then try to

remove

39

Page 42: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Digital to Analog Converter (DAC)

Digital to Analog Converter has:

• Input Range – Number of bits

• Output Range – Real quality (e.g. Volts)

• Sampling Rate – Rate at which DAC consumes input,

produces output

40

Page 43: Digital Signal Processingcsce.uark.edu/~ahnelson/CSCE4114/lectures/lecture13.pdf · ADC { Analog to Digital Converter Mixed-Signal Transform { Converts analog signal to digital signal

Complete DSP System

What about modifications?

41