introduction to digital signal processing

34
Introduction to Digital Signal Processing Prepared by: Engr. Tirso Llantada

Upload: tirsollantada

Post on 05-Oct-2015

8 views

Category:

Documents


0 download

DESCRIPTION

dsp intro

TRANSCRIPT

Introduction to Digital Signal Processing

Introduction to Digital Signal ProcessingPrepared by:Engr. Tirso Llantada

Learning ObjectivesWhy process signals digitally?What is DSP?Converting Analog into DigitalElectronicallyComputationallyHow Does It Work?Faithful DuplicationResolution Trade-offs

Consumer Audio Stereo A/D, D/A PLL MixersMultimedia Stereo audio Imaging Graphics palette Voltage regulation

Wireless / Cellular Voice-band audio RF codecs Voltage regulationHDD PRML read channel MR pre-amp Servo control SCSI tranceiversAutomotive Digital radio A/D/A Active suspension Voltage regulationDTAD Speech synthesizer Mixed-signalprocessorDSP:TechnologyEnabler

Applications

Why Process Signals DigitallyDigital signal processing techniques are now so powerful that sometimes it is extremely difficult, if not impossible, for analogue signal processing to achieve similar performance.Analogue signal processing is achieved by using analogue components. (Resistors , Capacitors , Inductors)With DSP it is easy to Change applications, Correct applications, and Update applications.Additionally DSP reduces Noise susceptibility, Chip count, Development time, Cost, Power consumption.

LimitationHigh frequency signals cannot be processed digitally because of two reasons:Analog to Digital Converters, ADC cannot work fast enough.The application can be too complex to be performed in real-time.

What is DSP?Converting a continuously changing waveform (analog) into a series of discrete levels (digital)

What is DSP?The analog waveform is sliced into equal segments and the waveform amplitude is measured in the middle of each segmentThe collection of measurements make up the digital representation of the waveform

What is DSP?

Converting Analog into DigitalElectronicallyThe device that does the conversion is called an Analog to Digital Converter (ADC)There is a device that converts digital to analog that is called a Digital to Analog Converter (DAC)

Converting Analog into DigitalElectronicallyThe simplest form of ADC uses a resistance ladder to switch in the appropriate number of resistors in series to create the desired voltage that is compared to the input (unknown) voltage

Converting Analog into DigitalElectronicallyThe output of the resistance ladder is compared to the analog voltage in a comparatorWhen there is a match, the digital equivalent (switch configuration) is captured

Converting Analog into DigitalComputationally

The analog voltage can now be compared with the digitally generated voltage in the comparatorThrough a technique called binary search, the digitally generated voltage is adjusted in steps until it is equal (within tolerances) to the analog voltageWhen the two are equal, the digital value of the voltage is the outcome

Converting Analog into DigitalComputationallyThe binary search is a mathematical technique that uses an initial guess, the expected high, and the expected low in a simple computation to refine a new guessThe computation continues until the refined guess matches the actual value (or until the maximum number of calculations is reached)The following sequence takes you through a binary search computation

Binary SearchInitial conditionsExpected high 5-voltsExpected low 0-volts5-volts 256-binary0-volts 0-binaryVoltage to be converted3.42-voltsEquates to 175 binary

AnalogDigital5-volts2560-volts0

2.5-volts128

3.42-voltsUnknown (175)

Binary SearchBinary search algorithm:

First Guess:

AnalogDigital5-volts2560-volts0

128

3.42-voltsunknown

Guess is Low

Binary SearchNew Guess (2):

AnalogDigital5-volts2560-volts0

192

3.42-voltsunknown

Guess is High

Binary SearchNew Guess (3):

AnalogDigital5-volts2560-volts0

160

3.42-voltsunknown

Guess is Low

Binary SearchNew Guess (4):

AnalogDigital5-volts2560-volts0

176

3.42-voltsunknown

Guess is High

Binary SearchNew Guess (5):

AnalogDigital5-volts2560-volts0

168

3.42-voltsunknown

Guess is Low

Binary SearchNew Guess (6):

AnalogDigital5-volts2560-volts0

172

3.42-voltsunknown

Guess is Low (but getting close)

Binary SearchNew Guess (7):

AnalogDigital5-volts2560-volts0

174

3.42-voltsunknown

Guess is Low (but getting really, really, close)

Binary SearchNew Guess (8):

AnalogDigital5-volts2560-volts0

3.42-volts175!

Guess is Right On

Binary SearchThe speed the binary search is accomplished depends on:The clock speed of the ADCThe number of bits resolutionCan be shortened by a good guess (but usually is not worth the effort)

How Does It Work?Faithful DuplicationNow that we can slice up a waveform and convert it into digital form, lets take a look at how it is used in DSPDraw a simple waveform on graph paperScale appropriatelyGather digital data points to represent the waveform

Starting Waveform Used to Create Digital Data

Waveform Created from Digital Data

How Does It Work?Faithful DuplicationCompare the original with the recreating, note similarities and differences

Noise Filtering Using Averaging

Half Sample Rate

1/3 Sample Rate

1/6 Sample Rate

1/12 Sample Rate

How Does It Work?Resolution Trade-offsWhat conclusions can you draw from the changes in sampling rate?At what point does the waveform get too corrupted by the reduced number of samples?Is there a point where more samples does not appear to improve the quality of the duplication?

How Does It Work?Resolution Trade-offsBit Resolution

High Bit Count

Good Duplication

Slow

Low Bit Count

Poor Duplication

Fast

Sample Rate

High Sample Rate

Good Duplication

Slow

Low Sample Rate

Poor Duplication

Fast

Example 1A signal, 100 Hz, is sampled at 4000Hz. DetermineSampling intervalNumber of samples taken in one cycle of the input signalNumber of samples taken in 4 seconds durationNumber of cycles taken in 4 seconds durationFrequency of the Reproduced Signal

Example 2A signal, 100 Hz, is sampled at 150Hz. DetermineSampling intervalNumber of samples taken in one cycle of the input signalNumber of samples taken in 4 seconds durationNumber of cycles taken in 4 seconds durationFrequency of the Reproduced Signal

Example 3Sketch the spectrum of the sampled version of the given signal

0Hz 20 Hz 40Hz2

1

Example 4Define the equation of the signal representing the samples of the inputX(t) = 3 cos(100t) 2sin(500t + 180)Fs = 400 Hz

V-7V-6V-lowV-1V-2V-3V-4V-5V-highSW-8SW-7SW-6SW-5SW-4SW-3SW-2SW-1OutputAnalog VoltageResistance Ladder VoltageComparator OutputHigherEqualLowerChart10105055757812512210-20-48-100-110-130-75-90-30045809010010010890-8-40-55-80-45-38-15-225434558708055500

RawTimeAmplitude

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th

Chart202038.33333333336069.333333333392.6666666667108.333333333385.666666666737.3333333333-19.3333333333-56-86-113.3333333333-105-98.3333333333-65-40541.666666666771.66666666679096.6666666667102.666666666799.333333333363.333333333314-34.3333333333-58.3333333333-60-54.3333333333-32.6666666667-18.33333333332.66666666672237.666666666748.666666666757.666666666769.333333333368.333333333361.6666666667350

Ave before/afterTimeAmplitude

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th

Chart50105055757812512210-20-48-100-110-130-75-90-30045809010010010890-8-40-55-80-45-38-15-225434558708055500

RawTimeAmplitude

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th

Chart90105578122-20-100-130-90080100108-8-55-45-15254570550

every 2ndTimeAmplitude

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th

Chart50105055757812512210-20-48-100-110-130-75-90-30045809010010010890-8-40-55-80-45-38-15-225434558708055500

RawTimeAmplitude

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th

Chart100507810-100-75090108-40-45-245800

every 3rdTimeAmplitude

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th

Chart50105055757812512210-20-48-100-110-130-75-90-30045809010010010890-8-40-55-80-45-38-15-225434558708055500

RawTimeAmplitude

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th

Chart110125-1104590-38580

every 6thTimeAmplitude

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th

Chart50105055757812512210-20-48-100-110-130-75-90-30045809010010010890-8-40-55-80-45-38-15-225434558708055500

RawTimeAmplitude

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th

Chart120-11090580

every 12TimeAmplitudeevery 12th

Sheet1TimeRawAve before/aftereliminate extremes (100/-100)000011020102503850355605547569755789378612510810071228610081037109-20-19-2010-48-56-4811-100-86-10012-110-113-10013-130-105-10014-75-98-7515-90-65-9016-30-40-301705018454245198072802090909021100971002210010310023108991002490639025-814-826-40-34-4027-55-58-5528-80-60-8029-45-54-4530-38-33-3831-15-18-1532-23-2332522253443384335454945365858583770697038806880395562554050355041000Timeevery 2ndTimeevery 3rdTimeevery 6thTimeevery 1200000000110250612512-11035557812-110249057881018453658712211-10024904109-2014-7530-3811-100170365813-130209041015-902310817026-40198029-452110032-223108354525-8388027-5541029-4531-153325354537703955410

Sheet1

RawTimeAmplitude

Sheet2

Ave before/afterTimeAmplitude

Sheet3

eliminate extremes (100/-100)TimeAmplitude

every 2ndTimeAmplitude

every 6thTimeAmplitude

every 3rdTimeAmplitude

every 12TimeAmplitudeevery 12th