Digital Audio Graduate School of Culture Technology, KAIST Juhan - - PowerPoint PPT Presentation

digital audio
SMART_READER_LITE
LIVE PREVIEW

Digital Audio Graduate School of Culture Technology, KAIST Juhan - - PowerPoint PPT Presentation

2018 Fall CTP431: Music and Audio Computing Digital Audio Graduate School of Culture Technology, KAIST Juhan Nam Outlines Introduction Sampling Quantization Digital audio standards Playback Rate Conversion / Resampling


slide-1
SLIDE 1

2018 Fall CTP431: Music and Audio Computing

Digital Audio

Graduate School of Culture Technology, KAIST Juhan Nam

slide-2
SLIDE 2

Outlines

  • Introduction
  • Sampling
  • Quantization
  • Digital audio standards
  • Playback Rate Conversion / Resampling
slide-3
SLIDE 3

Introduction

Sound Image Text

… 0 1 1 0 1 1 0 … … 1 0 0 1 1 0 1 … … 0 0 1 1 0 1 1 …

slide-4
SLIDE 4

Digital Representations

  • Sampling and Quantization
  • Sound (samples)
  • Image (pixels)
  • Trade-off
  • Between quality and data size
slide-5
SLIDE 5

Digital Audio Chain

slide-6
SLIDE 6

Microphone and Speakers

  • Microphones
  • Sound to electrical signal
  • Dynamic mic: Fleming’s right-hand rule
  • Condenser mic: Q = CV, C = A/d
  • Pre-amp
  • Loudspeakers
  • Electrical signal to sound
  • Similar to dynamic mic in principle
  • Fleming’s left-hand rule
  • Crossover networks: woofer / tweeter
  • Power amp

Condenser mic

Source: http://www.shure.com/americas/support/find-an-answer/difference-between-a-dynamic-and-condenser-microphone Source: http://hyperphysics.phy-astr.gsu.edu/hbase/Audio/cross.html

Dynamic mic

(A= area, D= distance)

slide-7
SLIDE 7

Sampling

  • Convert continuous-time signals to discrete-time signals by

periodically picking up the instantaneous values

  • Represented as a sequence of numbers: pulse code modulation (PCM)
  • Sampling period (Ts): the amount of time between samples
  • Sampling rate ( fs =1/Ts )

Ts

x(t) → x(nTs)

Signal notation

slide-8
SLIDE 8

Sampling Theorem

  • What is an appropriate sampling rate?
  • Too high: increase data rate
  • Too low: become hard to reconstruct the original signal
  • Sampling Theorem
  • In order for a band-limited signal to be reconstructed fully, the sampling

rate must be greater than twice the maximum frequency in the signal

  • Half the sampling rate is called Nyquist frequency (𝑔

"/2)

𝑔

" > 2 & 𝑔 '

𝑔

": sampling rate

𝑔

': maximum frequency

slide-9
SLIDE 9

Aliasing

  • If the sampling rate is less than twice the maximum frequency,

the high-frequency content is folded over to lower frequency range

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10

4

−0.8 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1

slide-10
SLIDE 10

Aliasing in Frequency Domain

  • For general signals, high-frequency content is folded over to

lower frequency range

fm

  • fm

fs+fm fs-fm fs

  • fs

Audible range

slide-11
SLIDE 11

To avoid Aliasing

  • Increase sampling rate
  • Or use lowpass filters before sampling

fs > 2⋅ fm

fs/2 fs

  • fs
  • fs/2

fm

  • fm

fs+fm fs-fm fs

  • fs

Lowpass Filter

slide-12
SLIDE 12

Example of Aliasing

12

Frequency sweep of the trivial sawtooth wave

Time (s) Frequency (Hz) 1 1.5 2 2.5 3 3.5 4 4.5 0.5 1 1.5 2 x 10

4

Bandlimited sawtooth wave spectrum

5 10 15 20 −60 −40 −20 Frequency (kHz) Magnitude (dB) 5 10 15 20 −60 −40 −20 Frequency (kHz) Magnitude (dB)

Trivial sawtooth wave spectrum

slide-13
SLIDE 13

Example of Aliasing in Video

https://www.youtube.com/watch?v=jHS9JGkEOmA

slide-14
SLIDE 14

Quantization

  • Discretizing the amplitude of real-valued signals
  • Round the amplitude to the nearest discrete steps
  • The discrete steps are determined by the number of bit bits
  • N bits can range from -2N-1 to 2N-1-1

Quantization step

2N-1-1

  • 2N-1
slide-15
SLIDE 15

Quantization Error

  • Quantization causes noise
  • Average power of quantization noise: obtained from the probability density

function (PDF) of the error

  • Signal to Noise Ratio (SNR)
  • Based on average power

1/2

  • 1/2

P(e) 1

x2p(e)dx

−1/2 1/2

= 112

Root mean square (RMS) of noise 20log10 Srms Nrms = 20log10 2B−1 / 2 112 = 6.02B+1.76 dB RMS of full-scale sine wave

slide-16
SLIDE 16

Digital Audio Standards

  • Determined by the limit in human hearing
  • Maximum audible frequency (bandwidth): 20kHz
  • Dynamic range: depends on frequency (the maximum is about 120dB)

Sound Level (dB)

Human hearing range

slide-17
SLIDE 17

Digital Audio Standards

  • Compact disc
  • Sampling rate: 44.1 kHz: > 2 x 20 kHz
  • Bit depth: 16 bits: SNR = 98.08dB
  • Blu-ray disc / professional audio
  • Sampling rate: 48 / 96 /192kHz: > 2 x 20 kHz
  • Bit depth: 16 / 20 / 24 bits
  • Telephone
  • Sampling rate: 8 / 16 kHz
  • Bit depth: 8 bits (with companding)
slide-18
SLIDE 18

Playback Rate Conversion

  • Playback rate does not have to be the same as the recording

rate

  • Adjusting the playback rate given the recorded audio creates

different tones

  • Sliding tapes on the magnetic header in a variable speed
  • Speeding down: “monster-like”
  • Speeding up: “chipmunk-like”
  • It can be even negative rate: reverse playback
slide-19
SLIDE 19

Demo: Playback Rate Conversion

  • https://musiclab.chromeexperiments.com/Voice-Spinner
slide-20
SLIDE 20
  • Reconstruct the original signal and sample it with a new

sampling rate

  • For a digital system with a constant playback rate
  • Up-sampling makes the original have slower speed and lower pitch
  • Down-sampling makes the original have faster speed and higher pitch

Resampling

slide-21
SLIDE 21

Resampling

  • Resampling changes pitch, length and timbre at the same time!

[The DaFX book] Original Speed Down (Up-sampling) Speed Up (Down-sampling)

slide-22
SLIDE 22

Practice: Audacity

  • Recording
  • Editing
  • Digital Audio Effects