260 likes | 564 Views
Digital Signal Processing Techniques. ECE2799 Lecture Prof. W. Michalson. What is Digital Signal Processing?. Generically, Digital Signal Processing refers to manipulating analog signals using digital operations.
E N D
Digital Signal Processing Techniques ECE2799 Lecture Prof. W. Michalson
What is Digital Signal Processing? • Generically, Digital Signal Processing refers to manipulating analog signals using digital operations. • There are special purpose Digital Signal Processors, or DSP chips that are essentially microprocessors that are customized for implementing DSP algorithms. • DSP chips, however, are not necessary for performing signal processing in the digital domain.
Types of DSP • Many things can be called digital signal processing. • Often, DSP programs are applications of discrete-time signal processing to do: • Filtering (high-pass, low-pass, band-pass, etc) • Modulation / Demodulation • DFT / Correlation • Generically, any operation on a digital signal is DSP.
A Simple Example System • Let’s suppose we want to design a digital coffee temperature monitor. • We need some specifications: • Provide indication of “optimal” drinking temperature. • Red LED – Too hot (T > 70 ºC) • Green LED – Perfection! ( 50 ≤ T ≤ 70 ºC) • Blue LED – Brrrrrrr. Too cold. (T < 50 ºC)
We Need REAL Specifications! • From a quick search on Digikey I found an NTC thermistor encased in a glass bead. • R25 = 10KW • Dissipation factor 0.4 mW/ºC • From the thermistor specifications, I found:
Avoiding Self Heating • In my research, I learned that to minimize self heating, I need to make sure that the current through the thermistor is less than the dissipation factor. • Limiting current to 0.2mW means I’ll limit error due to self heating to about 0.5 ºC. • If Vcc = 5V, this means that the total resistance must be > 125 KW.
So, What Will We Measure? • Given these specifications, based on the nominal values in the thermistor data sheet, we would expect to see the following:
Analog Pre-Processing • The voltages we expect to see at the thermistor are pretty small. • Do we need any analog processing? • Maybe, maybe not… • We need to look at the specifications of our ADC. • If the specifications are adequate, we may not have to go any further.
Arduino Uno • Many people are using the Arduino Uno as the processor in their design. • The processor is an ATMega328. • 10-bit ADC • No circuitry between ADC pins and header connectors • Review of the Atmel datasheet shows: • 100 MW analog input resistance. • AREF is AVCC, 1.1V, or VREF.
No Analog Processing??? • So, what happens if I just drive the Arduino with VTH? • The equation for determining the 10-bit ADC value is ADC = (Vin x 1024)/VREF. • Thus, we have:
This Just Might Work!!! • If we set up the ATMega328 ADC to use the internal 1.1V reference, we have a pretty reasonable range to operate in with no additional analog components. • It would make sense to “low pass” filter the data by averaging over several samples. • We’re ignoring “anti aliasing” at our peril!
Our Software • So, in terms of software: • We need to set up the ADC to use the 1.1 Volt reference (a single 8-bit read is sufficient). • We should average over 5-10 samples to reduce noise (no need for fast sampling). • Decision routine: • If ADC < 79, Turn on Red LED, • If 79 ≤ ADC ≤ 146, turn on Green LED, • If ADC > 146, Turn on Blue LED,
Characteristics of A/D Converters • An A/D converter translates an analog input voltage into a digital representation. • Here we see a ±5V signal being mapped to a 16-bit 2’s complement integer: Source: http://www.audiodesignline.com/showArticle.jhtml?articleID=192200610
Word Size and Dynamic Range • The number of bits in an A/D converter determines the “dynamic range” of the converter. • This “dynamic range” is the ratio of the smallest and largest values that can be represented. • DR dB = 20 log (Vmax/Vmin) • Different applications require different dynamic ranges. Source: http://www.audiodesignline.com/showArticle.jhtml?articleID=192200610
Consider an 8-bit Converter • Assume 0-3.3V maps to 00-FF • 256 steps means 0.0129 Volts/step • DR dB = 20 log(3.3/0.0129) = 48 dB • So, comparing this to the previous slide, we see: • 8-bits is about “AM Radio” quality • 12-bits is about “FM Radio” quality • 16-bits is about “CD” quality • But wait, there’s more!
Other Issues Selecting a Converter • It’s generally good to leave some “headroom” when designing so the system won’t distort. • In our example, let’s assume a 0 to 3.3V converter. • Let’s also assume some more specifications: • 12dB headroom Source: http://www.audiodesignline.com/showArticle.jhtml?articleID=192200610
What About Anti-Aliasing? • We know that in general we need a band-limited signal as an input to the converter. • It doesn’t matter how the signal is band-limited, it just matters that it is band-limited. • We have a few choices: • Ignore Nyquist and hope it’s not an issue. • Look at the characteristics of the thermistor and see how susceptible to noise it is. The thermistor may be able to band-limit the signal. • Sample at higher rate and build a separate low-pass filter (and probably gain) prior to the converter.
Signal Above Nyquist II • Every frequency above Nyquist will get aliased into a frequency below Nyquist and thus will be indistinguishable!