An introduction to Digital Signal Processing

Felix Donkers

© Felix Donkers

Outline

• Introduction ◦ Definition Digital Signal Processing ◦ Application areas • DSP systems ◦ Analog versus digital ◦ Sensors ◦ AD / DA conversion • DSP theory ◦ Time domain versus frequency domain ◦ Nyquist / Shannon sampling theorem ◦ Digital filters ◦ Quantisation noise and dynamic range • Practical exercises ◦ DTMF detection ◦ Digital reverb • Further reading

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 2

Title of Presentation Outline

• Introduction ◦ Definition Digital Signal Processing ◦ Application areas • DSP systems ◦ Analog versus digital ◦ Sensors ◦ AD / DA conversion • DSP theory ◦ Time domain versus frequency domain ◦ Nyquist / Shannon sampling theorem ◦ Digital filters ◦ Quantisation noise and dynamic range • Practical exercises ◦ DTMF detection ◦ Digital reverb • Further reading

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 3

Digital Signal Processing – definition

(Digital) Signal Processing [source: WikipediA ]

DSP is the analysis, interpretation , and manipulation of signals (in the digital domain) .

Signals of interest include sound, images, radar, biological signals such as ECG , and many others .

Processing of such signals includes storage, reconstruction , transmission, separation of information from noise , compression, feature extraction, etc .

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 4

Title of Presentation Digital Signal Processing – definition

Signal improvement Signal feature extraction - beats per minute DSP (music) DSP - color (ambilight)

Signal acquisition Signal synthesis

ACQ SYN

Signal compression Signal transmission

ENC DEC TR REC

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 5

Digital Signal Processing – application fields

Sensor signal processing is still hot & high tech

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 6

Title of Presentation Digital Signal Processing – another example

Mic electronics: • Amplifier • Pre-filtering (conditioning) •Noise filter •Anti-aliasing

ADC DSP DAC

PA electronics: • Post filtering • Smooting filter • Rendering • Power amplifier • Loud speakers

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 7

Digital Signal Processing – application examples

Etc, etc, etc

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 8

Title of Presentation Outline

• Introduction ◦ Definition Digital Signal Processing Application areas • DSP systems ◦ Analog versus digital ◦ Sensors ◦ AD / DA conversion • DSP theory ◦ Time domain versus frequency domain ◦ Nyquist / Shannon sampling theorem ◦ Digital filters ◦ Quantisation noise and dynamic range • Practical exercises ◦ DTMF detection ◦ Digital reverb • Further reading

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 9

Analoge versus digital signals

• Signals: – Representation of time variant physical measures – E.g. temperature, humidity, speed, weight, light intensity, sound, ..., … A

Analogue signal • Analogue signals: Digital signal – Continuous (often electrical) representation of physical signals. – Amplitude and time continuous

• Digital signals: t – Discrete representations (numbers) of physical signals – Amplitude discrete (vertical grid) and time discrete (horizontal grid)

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 10

Title of Presentation Sensors (some examples)

Microphone Temperature Magnetic field Pressure Accelero- Strain gauge LDR sensor (Hall) sensor sensor meter

Biosensor Photocell CCD Ultrasone sensor Interferro- sensor

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 11

When to use DSP?

• In general: • When you run into the boundaries of the performance of your sensors, actuators and/or overall system.

• Example: temperature measurement • If you’re only interested in rough figures (e.g. +/- 10 °C) • Just use the sensor as is • If you’re interested in fair accuracy (e.g. +/- 1 °C ) • Calibrate the sensor (offset / gain) • If you need accurate figures (e.g. +/- 0.1 °C) • Average multiple measurements (which is already a simple form of DSP)

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 12

Title of Presentation Example : DSP in cell phones

• RF demodulation & channel EQ (for optimal ISI) (GSM, EDGE, GPRS, UMTS, WCDMA, HSDPA, DVB-T, DAB, FM, GPS, …) • Clock extraction & bit detection • Error detection & correction • Audio & video coding (speech, mp3, JPG, MPG, … (de-)compression) • Error concealment (i.e. what to do if error correction fails) • Midi-synthesis (e.g. ringtone) • TTS synthesis (e.g. caller-ID) • Auto – DJ (incl. feature extraction) • Image scaling & enhancements • Audio enhancement (e.g. EQ, virtual surround) • GPS decoding • DTMF synthesis • ……

• Typical mobile phone platform : – DSP for RF demodulation (200MHz) – ARM7 / ARM9 / ARM11 for base band processing (400MHz) 16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 13

AD / DA conversion

• Resistor network DACs • 8 – 10 bit resolutions • Up to 10 MHz sampling rates

Ruit

U U U U = −R (* MSB + ... + LSB ) uit uit R 2* R 4* R

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 14

Title of Presentation AD / DA conversion

• Resistor network DACs • 8 – 14 bit resolutions • Up to 10 MHz sampling rates • R-2R network is the mostly used DAC architecture for various applications

2R D D D D D V −= ( 0 + 1 + 2 + 3 + 4 +...... ) out R 2 4 8 16 32

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 15

AD / DA conversion

• Successive Approximation ADC • 8 – 14 bit resolutions • Up to 100 kHz sampling rates • Requires S&H to ‘freeze’ input signal • Often used: • in Measurement & Instrumentation environments

• as function block inside microcontrollers step SAR Vin > Action Vdac ? 1 1000 No

2 0000 Reset 3 0100 Yes

4 0100 Keep 5 0110 Yes 6 0110 Keep 7 0111 No 8 0110 Reset

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 16

Title of Presentation AD / DA conversion

• Resistor network ADCs • 6 – 10 bit resolutions • Up to 10 MHz sampling rates • Often used for video capturing

Comparator XOR Binary Output Output Output 1111111 1000000 111

0111111 0100000 110

0011111 0010000 101

0001111 0001000 100

0000111 0000100 011

0000011 0000010 010

0000001 0000001 001

0000000 0000000 000

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 17

AD / DA conversion

• Delta-sigma ADC • 14-20 resolutions • From < 1Hz up to 100 kHz sampling rates • Often used: • in Measurement & Instrumentation environments • Audio conversion

Digital filter

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 18

Title of Presentation Outline

• Introduction ◦ Definition Digital Signal Processing ◦ Application areas • DSP systems ◦ Analog versus digital ◦ Sensors ◦ AD / DA conversion • DSP theory ◦ Time domain versus frequency domain ◦ Nyquist / Shannon sampling theorem ◦ Digital filters ◦ Quantisation noise and dynamic range • Practical exercises ◦ DTMF detection ◦ Digital reverb • Further reading

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 19

Time domain versus frequency domain

N = ω +ϕ tf )( ∑ An sin(* n *t n ) = n=1

+

= ω +ϕ tf )( A1 sin(* 1 *t 1) + ω +ϕ A2 sin(* 2 *t 2 ) + ω +ϕ A3 sin(* 3 *t 3 ) + ω +ϕ A4 sin(* 4 *t 4 ) + ω +ϕ A5 sin(* 5 *t 5 )

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 20

Title of Presentation Time domain versus frequency domain

• Test signal

• Music

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 21

Discrete Fourier Transform (DFT)

• To transform a Time Domain Signal into the Frequency Domain (and v.v.)

DFT = Discrete Fourier Transform “1” Σ * e− ωtj

Σ * +

e− ωtjN

Σ *

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 22

Title of Presentation (FFT)

Fast Fourier Transform (FFT):

2 – is a computation efficient implementation of the DFT ( N*log 2(N) instead of N cycles ) – is available in various of-the-shelf math libraries for numerous platforms (PC, DSP, etc) – often assumes a signal length with a power-of-2 (#samples), e.g. 1024

FFT

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 23

Nyquist / Shannon Theory

time domain A Aliasing

t

• According to Nyquist and Shannon, the sampling frequency should be a least twice the highest frequency of the input signal:

◦ fsampling > 2 * finput

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 24

Title of Presentation Nyquist / Shannon Theory

frequency domain

remember basic trigonomet rics : 1 1 cos( α *) cos( β ) = *cos( α − β ) + *cos( α + β ) fin 2 2

f f f fin, mirror in, mirror LPF in, mirror in, mirror

aliasing !! fs > 2* f max

fs, nok fs, ok fs, ok

5 10 15

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 25

Digital Filters (FIR)

x[n-1] x[n-2] x[n-3] x[n-i] x[n-M] x[n] T T T T T

a0 a1 a2 a3 ai aM * * * * * * y[n] + + + + + +

M tap = zY )( = −n zH )( ∑ an * z zX )( n=0 = + −1 + −2 + −3 +K+ −M • FIR filters: zH )( a0 a1 * z a2 * z a3 * z aM * z – Have an Finite Impulse Response – Have many “filter taps”, implying relatively high computational load – Can not become unstable Do #255 – Can have linear phase response (tranversal filters) Mac x0, y0, a x(R0+N0), x0 y(R4+), y0 End Macr x0, y0, a

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 26

Title of Presentation Digital Filters (FIR)

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 27

Digital Filters for image processing (2D-FIR)

X0,0 ……X0,j ……X0,J ……………… … …………………

Xi,0 ……Xi,j …… Xi,J = ………………… ……………… … ? XI,0 ……XI,j ……XI,J

C0,0 C0,m C0,M

Cn,0 Cn,m Cn,M

CN,0 CN, CN,M m

Yi,j = Xi-1,j-1 * C n-1,m-1 + X i,j-1* C n,m-1 + X i+1,j-1 * C n+1,m-1

+ X i-1,j * C n-1,m + X i,j * C n,m + X i+1,j * C n+1,m

+ X i-1,j+1 * C n-1,m+1 + X i,j+1 * C n,m+1 + X i+1,j+1 * C n+1,m+1

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 28

Title of Presentation Digital Filters for image processing (2D-FIR)

Blur filter

1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9

Sharpening filter

-1 -1 -1 -1 +9 -1 -1 -1 -1

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 29

Digital Filters (IIR)

M ‘FIR’ y[n] a * z −m x[n] + + ∑ m = zY )( = m=0 * zH )( N − a0 zX )( n T ∑bn * z n=0 + + a + * za −1 + a * z −2 zH )( = 0 1 2 * * − −1 − −2 b a 1 1 * zb b2 * z 1 T 1 + * * + b2 a2

• IIR filters: – Have an Infinite Impulse Response – Have relatively low footprint figures (computational load and memory) – Can behave like ‘any’ typical analogue filter (Chebyshev, Butherworth, Bessel, Elliptic, etc) – Can become unstable (like analogue filters)

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 30

Title of Presentation Digital Filters (IIR)

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 31

Quantisation noise

• Noise = actual signal – desired signal

ADC DAC

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 32

Title of Presentation Fixed point Signal to Noise Ratio (SNR)

2 P  A  = signal = signal Note: for fixed point SNR   Pnoise  Anoise  Dynamic Range (DR) = SNR

 P   A  SNR (dB =10) log  signal  = 20 log  signal  10   10   CD  Pnoise   Anoise  Vinyl

= ()n ≈ • ()Tape SNR (dB ) 20 log 10 2 02.6 n for linear distribute d signals ge .., sawtooth or triangle = ()n ≈ • + SNR (dB ) 20 log 10 2 02.6 n 76.1 ( for sinusoidal signals )

16 bit 12 bit 10 bit 8 bit 6 bit 4 bit SNR 96 dB 72 dB 60 dB 48 dB 36 dB 24 dB Classical Jazz

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 33

Fixed point arithmetics; Q-notation

• Qm.f : s m f – ‘s’ represents sign bit – ‘m’ represents magnitude (= 2 m) – ‘f’ represents fractional part (= 2 -f)

• Q15.0 s 15 bits – signed integer uses 16 bits, resolution is 2 -0 = 1 – ranges between [-215 , 2 -15 - 2-0] = [-32768, +32767] = [0x8000, 0x7FFF]

• Q14.1 s 14 bits 1 b – signed integer uses 16 bits, resolution is 2 -1 = 0.5 – ranges between [-214 , 2 -14 - 2-1] = [-16384.0, +16383.5] = [0x8000, 0x7FFF]

• Q0.15 s 15 bits – signed integer uses 16 bits, resolution is 2 -15 = 0,000030517578125 – ranges between [-20, 2 0 -2-15 ] = [-1, + 0,999969482421875] = [0x8000, 0x7FFF]

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 34

Title of Presentation Fixed point arithmetics

• Adding numbers: ◦ Q15 + Q15 = Q16 ◦ Q15 – Q15 = Q16

• Multiplying numbers: ◦ Q15 * Q15 = Q30 ◦ Q15 / Q15 = Q30 (result + remainder)

• Multiplying by 2 N equals to “ASL ” s 0 1 0 1 0 1 1

s 1 0 1 0 1 1 0

N • Dividing by 2 equals to “ASR ” s 0 1 0 1 0 1 1

s s 0 1 0 1 0 1

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 35

Floating point Signal to Noise Ratio (SNR) & Dynamic Range (DR)

IEEE 754 float

IEEE 754 32bit float

SNR = 6.02 * (fraction bits + sign bit) [dB] = 6.02 * 24 bit = 144 [dB] DR = 6.02 * 2 exponent bits [dB] = 6.02 * 2 8 bit = 1536 [dB]

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 36

Title of Presentation Questions

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

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 37

Outline

• Introduction ◦ Definition Digital Signal Processing ◦ Application areas • DSP systems ◦ Analog versus digital ◦ Sensors ◦ AD / DA conversion • DSP theory ◦ Time domain versus frequency domain ◦ Nyquist / Shannon sampling theorem ◦ Digital filters ◦ Quantisation noise and dynamic range • Practical exercises ◦ DTMF detection ◦ Digital reverb • Further reading

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 38

Title of Presentation Practical exercise 1 : DTMF detection

DTMF = Dual Tone Multi-Frequency DTMF is a system used in telephony to transmit simple commands like phone numbers. The underlying technology is Frequency Shift Keying (FSK). Each command is transmitted by generating two sinusoids (within the speech audio band). E.g. to transmit digit code ‘5’, sinusoids with frequencies of 770Hz and 1336Hz are generated, see table and figure.

1209 Hz 1336 Hz 1477 Hz 1633 Hz 697 Hz 1 2 3 A 770 Hz 4 5 6 B 852 Hz 7 8 9 C 941 Hz * 0 # D

Sequence, e.g. 01-23456789

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 39

Practical exercise 1: approach

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 40

Title of Presentation Practical exercise 1: algorithm

Audio stream

AAudio continuous frame n streamAudio of audioframe samples,.. Audio e.g frame : .. Audio frame2 Audio frame1 - played back from a pre-recorded PC file or -The sampledspectral audio fromstream a liveis dividedspectral audio signalinto frames usingspectral foran analysiADC s purposes:spectral spectral - Framesizeanalysis > N periodsanalysis of the slowestanalysis sinusoid (increaseanalysis SNR) analysis - Framesize < DTMF burst / M (allow multiple detections per DMTF burst) Spectralspectral analysispeak usesspectral Goertzel peak algorithm,spectral and peak is executedspectral once peak for eachspectral peak frequencyevaluation bin (so 8*)evaluation evaluation evaluation evaluation

Peak evaluation: - No peaks detected implies silence between two DTMF bursts DTMF key extraction DTMF key extraction - 2 peaks implies detection of a DTMF key candidate - More than 2 peaks implies too much noise -> invalid DTMF key To prevent false detections, a DTMF key is only valid if multiple DTMF candidates haveDTMF been key detectedconcatenation to extract DTMF string

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 41

Practical exercise 1: goertzel algorithm

Goertzel Detection algorithm: • Efficient spectral analysis implementation to detect single tones, e.g. for DTMF detection. • Is implemented using a high-Q (Notch-like) 2 nd order IIR filter:

• Is more efficient than the Fast Fourier Transform if only a few coefficients are required. • More flexible in choosing the desired time resolution -> ‘N’ (Goertzel block) can have any desired length, • More flexible in choosing the desired center (bin) frequency -> ‘k’ can be any multiple of ‘1/N’

Ones for for every each tone sinusoid & Ones for every tone every sample + +

-1 Coeff1Z Coeff2 + * * Z-1 -1 *

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 42

Title of Presentation Practical exercise 1: create development & test environment

• Development tools for algorithm development ◦ Matlab ◦ Labview ◦ Microsoft .NET (*) ◦ Eclipse with Ansi-C for PC environment ◦ … • Create test vectors ◦ Various *.WAV and *.PCM files with DTMF sequences (10 digits)

• Implement algorithm in floating point arithmetics ◦ For proof of concept of Goertzel and DTMF detection algorithms

• Port algorithm to 32-bit fixed point arithmetics ◦ Quantising & scaling all coefficient and variables ◦ For proof of concept of Goertzel and DTMF detection algorithms in fixed point

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 43

Practical exercise 1: select suitable DSP platform

• Atmel ATmega128; ◦ 8-bit GP-RISC, 16MHz, ◦ 128K FLASH, 4K RAM, 4K EEPROM ◦ 4* (8-bit + 16-bit) Timer/Counter, 8* PWM, 8ch ADC, 2* UART, SPI, WDT, GPIO, JTAG • Microchip dsPIC 33FJ256GP506 (*); ◦ 24i/16d-bit RISC, 40MHz, DSP & C-compiler optimized instruction set ◦ 128k Flash, 16K RAM, 8ch DMA support for memory and peripherals ◦ 9ch timer/counters, 8ch PWM, high speed ADC, 2* SPI, 2* I2C, 2* UART, I2S, CAN, WDT, 53* GPIO, JTAG, nanoWatt features. • Atmel AT32 series; ◦ 32-bit GP-RISC, 33MHz, 43 DMIPS ◦ ≤512K FLASH, ≤64K RAM, DMA support ◦ USB, 10/100 Mbps ethernet, 3ch 16-bit timer/counter, 7ch PWM, I2S, I2C, SPI, 4ch UART, 8ch ADC, 2ch audio DAC, JTAG • Others: ◦ Texas Instruments (TMS320xxx), Analog Devices (Blackfin, Sharc, AD21xxx), Freescale (56xxx), ARMxx, VHDL, etc……

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 44

Title of Presentation Practical exercise 1: why is dsPIC suitable ?

• DSP enabling features: – Modified Harvard architecture (one address bus and two (X/Y) data buses) for single-cycle 3-parameters instructions, e.g. a+b=c – Multiplier supports single cycle 16b*16b = 32b (un)signed MAC (@40Mhz = 25nsec ) – ALU has headroom to allow for multiple accumulates without overflow (40-bit accumulator) – ALU supports automatic saturation (clipping), rounding – Single cycle SHR/SHL by barrel shifter for 40-bit value (N ≤16 bits) – Automatic increment or decrement of X/Y data pointers – AGU supports bit-reversed (for radix-2 FFT), modulo addressing modes and overhead free program loops (do, repeat) – … 16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 45

Practical exercise 1: dsPIC prototyping board

• Features – Board includes integrated debugger / programmer – USB powered DM330011 - MPLAB Starter Kit for dsPIC DSC – dsPIC33FJ256GP506 DSC with 256 KB Flash and 16 KB RAM – 16/24/32 bit codec with a maximum sampling frequency of 48KHz – Low cost audio capture and play back circuitry using the 12 bit ADC and PWM Audio – Microphone and line level inputs with adjustable input gain – 100mW headphone amplifier with digital volume control – 2 switches and 3 LEDs for user application purposes – 4 Megabit serial flash memory for application use – Temperature sensor – CD contains MPLAB IDE with full editor, programmer and debugger; MPLAB C Compiler; code examples and user’s guide – All tools provided for developing and prototyping speech and audio application & algorithms

• Package Contents – dsPIC audio board with integrated debugger – MPLAB Starter Kit with CD containing MPLAB IDE, MPLAB C Compiler for dsPIC DSCs, application notes, and sample programs Price € 44 (April 2008) – USB cable

• dsPIC Filter Design (Lite) is sold seperately

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 46

Title of Presentation Practical exercise 1: software ‘design’

Main process Initialisation, UI, …

DSP process • Goertzel processing, Read ADC Write DAC • DTMF key extraction, • DTMF key concatenation

buffer1 buffer3 ADC DAC buffer2 buffer4

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 47

Practical exercise 1: speed optimisation

• Use loop-enrolling to save indexing overhead

for (i=3; i==0; i--) a[0] += b[0] * c[0]; { a[1] += b[1] * c[1]; a[i] += b[i] * c[i]; a[2] += b[2] * c[2]; } a[3] += b[3] * c[3];

• Use built-in functions / macros for a 16b*16b = 32b signed multiply

Q0[0] += (Int16) ( ( (Int32) Coeff[0] * Q1[0]) >> Q14_SCALER); // speed-optimized code using built-in functions Q0[0] += (Int16) (__builtin_mulss(Coeff[0], Q1[0]) >> Q14_SCALER);

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 48

Title of Presentation Practical exercise 1: demo

PIC starter kit

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 49

Questions

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

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 50

Title of Presentation Outline

• Introduction ◦ Definition Digital Signal Processing ◦ Application areas • DSP systems ◦ Analog versus digital ◦ Sensors ◦ AD / DA conversion • DSP theory ◦ Time domain versus frequency domain ◦ Nyquist / Shannon sampling theorem ◦ Digital filters ◦ Quantisation noise and dynamic range • Practical exercises ◦ DTMF detection ◦ Digital reverb • Further reading

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 51

Practical exercise 2: digital reverb

Reverb A Reverb simulates the component of sound that results from reflections from surrounding walls or objects. It is in effect a room simulator (source: audacity.sourceforge.net).

Speed of sound ≈ 343 m / Sec (at 20 oC) Propagation delay ≈ 3 mSec / m

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 52

Title of Presentation Practical exercise 2: block diagram

Schroeder reverb ‘Dry’ signal Tapped delay

A0 A1 A2 A3

‘Wet’ signal + +

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 53

Practical exercise 2: comb filter

typical K = 30..40 msec

y[n] = x[n] + α * y[n-K]

y[t] 1.0

0.8 0.64 α = 0.8 0.512 0.4 0.33 0.26 0.2

t

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 54

Title of Presentation Practical exercise 2: allpass filter

typical m = 3..5 msec

x(n) q(n) y(n) y(n) = q(n-M) – g * x(n) q(n) = x(n) + g * y(n)

(2nd order all-pass)

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 55

Practical exercise 2: demo

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 56

Title of Presentation Questions

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

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 57

Outline

• Introduction ◦ Definition Digital Signal Processing ◦ Application areas • DSP systems ◦ Analog versus digital ◦ Sensors ◦ AD / DA conversion • DSP theory ◦ Time domain versus frequency domain ◦ Nyquist / Shannon sampling theorem ◦ Digital Filters ◦ Quantisation noise and dynamic range • Practical exercises ◦ DTMF detection ◦ Digital reverb • Further reading

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 58

Title of Presentation Further reading

Literature: • http://www.dspguide.com/pdfbook.htm • http://www.dspguru.com/ • http://www.bores.com • http://www.nl.bol.com/is-bin/INTERSHOP.enfinity/eCS/Store/nl/-/EUR/BOL_DisplayProductInformation- Start?BOL_OWNER_ID=666879353&Section=BOOK Tools: • http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en02 3602 • http://www.mathworks.com/products/signal/index.html?s_cid=adw_digitalsp_cat1 • http://www.ni.com/labview/ Platforms: • http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en53 4506 • http://www.analog.com/embedded-processing-dsp/processors/en/index.html • http://www.xilinx.com/products/design_resources/dsp_central/grouping/index.htm • http://www.altera.com/technology/dsp/dsp-index.jsp

16 May 2010 An introduction to Digital Signal Processing – Felix Donkers No. 59

Title of Presentation