Top Banner
First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford
26

John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Sep 17, 2018

Download

Documents

ngodien
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

First steps in digital signal processing

John Coleman

Phonetics LaboratoryUniversity of OxfordUniversity of Oxford

Page 2: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Analogue-to-digital conversion 1:

Sampling

Page 3: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Analogue-to-digital conversion 2:

Quantization

Page 4: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

D-to-A, quantization error

Page 5: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

D-to-A, quantization error

• To reduce the quantization error, use more levels • To reduce the quantization error, use more levels (dynamic range):

• 8 bits: 28 = 256 levels• 12 bits: 212 = 4096 levels• 16 bits: 216 = 65536 levels• 16 bits: 216 = 65536 levels

Page 6: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Pulse Code Modulation

(Alec Reeves 1937)

Page 7: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Sampling theorem; Nyquist frequency

• Sampling rate must be at least twice the highest frequency you want to capturefrequency you want to capture

Page 8: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Operations on sequences of numbers

• Let's call the sample number i and the i'th sample x[i]• Sum or integral, Σx[i]. • Sum or integral, Σx[i]. • If x[i] has positive and negative values, take |x[i]| the

absolute (i.e. unsigned) value of x[i]. • Or, first calculate the square of x[i], x[i]2, and then take

the square root, √(x[i]2). Σ√(x[i]2) is a measure of the overall energy of a signal.overall energy of a signal.

• x[i]2 gets bigger and bigger as x[i] gets longer. • The average amplitude of a signal, calculated over n

samples: √(Σx[i]2/n). This is called the root mean squareor RMS amplitude.

Page 9: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Local (moving) averagee.g., y[n] = ¼ x[n ] + ¼ x[n-1] + ¼ x[n-2] + ¼ x[n-3]

Page 10: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Local (moving) averageEffect: low-pass filtering

Page 11: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Time-domain filtering

4 samples is very short, so its effects are very local –high frequency components. To smooth over a high frequency components. To smooth over a larger slice of the signal, we can do two things:

a) increase the number of samples in x[n] ... x [n-m]

b) make y[n] depend in part on its own previous b) make y[n] depend in part on its own previous value, y[n–1], or several previous values.

Page 12: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Time-domain filtering

• A filter of the second kind has the general form:

y[n] = b0x[n]+ b1 x[n–1] + b2 x[n–1] + ... + bk x[n–k] – a1 y[n–1] + .... + aj y[n–j]

• By varying the a's, b's, and the number and spacing of previous x and y samples, a variety of filters with previous x and y samples, a variety of filters with various kinds of frequency-selecting behaviours can be constructed.

Page 13: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Linear Prediction (preview)

• y[n] = b0x[n]+ b1 x[n–1] + b2 x[n–1] + ... + bk x[n–k] – a y[n–1] + .... + a y[n–j]– a1 y[n–1] + .... + aj y[n–j]

• We can estimate the magnitude of the current sample as a linear combination of the previous p samples (typically 12 to 18 samples):

• x[t] = –a1 x[t–1] – a2 x[t–2] – a3 x[t–3] … – ap x[t–p ] + e[t]

Page 14: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Fourier (Spectral) Analysis

Jean Baptiste Joseph Fourier (1768-1830)

Page 15: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Windowing

Page 16: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Fast Fourier Transform

• Cooley and Tukey, mid 1960's• Cooley and Tukey, mid 1960's• e.g. for Power Spectrum

Page 17: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Fast Fourier Transform

• Cooley and Tukey, mid 1960's• Cooley and Tukey, mid 1960's• e.g. for Power Spectrum

Page 18: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Cepstrum (Noll 1967)

Page 19: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Cepstrum

Page 20: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Linear Prediction of speech

• We estimate the current sample as a linear combination of the previous p samples:combination of the previous p samples:

• x[t] = –a1 x[t–1] – a2 x[t–2] – … – ap x[t–p] + e[t]

Page 21: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Linear Prediction of speech

0 • Original

• Error

Page 22: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Linear Prediction of speech

• Original0 • Original

• Resynthesized excluding error

Page 23: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

A magic trick

• 10 LPC coefficients coefficients from an [ɑ]

• Same 10 coeffs, scaled up and scaled up and zero-padded to 512 samples long

(251 each side)

Page 24: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

A magic trick

• Same 10 coeffs, scaled up and scaled up and zero-padded to 512 samples long

Page 25: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

A magic trick

FFT

LPspectrum

FFT

F1 F2

F3 F4

Page 26: John Coleman Phonetics Laboratory University of … · First steps in digital signal processing John Coleman Phonetics Laboratory University of Oxford

Shameless plug