Sound Ampliude and Loudness Audio DSP Professor Deepa Kundur Universiy of Torono Sound: vibraion ransmied hrough a medium (gas, liquid, solid and plasma) composed of frequencies capable of being deeced by ears. Noe: sound canno ravel hrough a vacuum. Human deecable sound is ofen characerized by air pressure variaions deeced by he human ear. The ampliude, frequency and relaive phase of he air pressure componens deermine (in par) he way he sound is perceived. Professor Deepa Kundur (Universiy of Torono) Audio DSP / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP / 54 Ampliude and Loudness Ampliude and Loudness Sinusoids and Sound: Ampliude Sound Volume Volume = Ampliude of sound waves/ s A fundamenal uni of sound is he sinusoidal. x a () = A cos(πf 0 + θ), R quoed in db, which is a logarihmic measure; 0 log(a ) no sound/null is db A volume F0 pich (more on his... ) θ phase (more on his... ) Loudness is a subjecive measure of sound psychologically correlaing o he srengh of he sound. he volume is an objecive measure and does no have a one-o-one correspondence wih loudness perceived loudness varies from person-o-person and depends on frequency and duraion of he sound Professor Deepa Kundur (Universiy of Torono) Audio DSP 3 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 4 / 54
Music Volume Dynamic Range Ampliude and Loudness Frequency and Pich Sinusoids and Sound: Frequency Tess conduced for he musical noe: C6 (F 0 = 046.50 Hz). Dynamic Level Decibels Threshold of hearing 0 ppp (pianissimo) 40 p (piano) 60 f (fore) 80 fff (forississimo) 00 Threshold of pain 0 A fundamenal uni of sound is he sinusoidal. x a () = A cos(πf 0 + θ), R A volume F0 pich θ phase (more on his... ) Professor Deepa Kundur (Universiy of Torono) Audio DSP 5 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 6 / 54 Frequency and Pich Frequency and Pich Pure Frequency Tuning Forks Q: Wha ype of sound does a pure frequency produce? A: A pure one wih a single pich. Q: Can any insrumen produce a pure one by playing a single noe? A: No. A uning fork is a wo-pronged insrumen ha is an acousic resonaor. I is usually made ou of seel and resonaes a a specific consan pich which is a funcion of he lengh of he prongs. Sriking he uning fork will produce he required sounds alhough iniially here may be overones ha die ou quickly. A very common uning fork used by musicians produces he A noe (F 0 = 440 Hz), which is inernaional concer pich used o une orchesras. Professor Deepa Kundur (Universiy of Torono) Audio DSP 7 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 8 / 54
Frequency and Pich Frequency and Pich Frequency and Pich Harmonically Relaed Frequencies and Pich Sinusoids can be represened eiher as: x a () = A cos(πf 0 + θ), R or for mahemaical convenience when inerpreing as Fourier componens as: x a () = Ae j(πf 0+θ), Pich is direcly relaed o he frequency F 0. R To be able o hear a frequency F 0, i has o be in he human audible range (0 Hz o 0,000 Hz). Scienific Designaion Frequency (Hz) k for F 0 = 8.76 C 3.703 4 C 65.406 8 C3 30.83 6 C4 (middle C) 6.66 3 C5 53.5 64 C6 046.50 8 C7 093.005 56 C8 486.009 5 C C C3 C4 C5 C6 C7 C8 Professor Deepa Kundur (Universiy of Torono) Audio DSP 9 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 0 / 54 Frequency and Pich Harmonically Relaed Frequencies Recall harmonically relaed sinusoids have he following analyic form for k Z: Signaure Sounds Frequency and Pich or x a,k () = A cos(πkf 0 + θ) x a,k () = Ae j(πkf 0+θ) They are used in he conex of he Fourier Series o build periodic s: Q: If wo differen people sing he same noe or wo differen insrumens play he same noe, why do hey sound differen? The noes are no pure ones. There are naural overones and underones ha provide disinguishing signaures ha can be viewed in he associaed specra. x() = X (k)e j(πkf 0) k= Professor Deepa Kundur (Universiy of Torono) Audio DSP / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP / 54
Frequency and Pich Fourier Transforms of he Same Noe Tuning Fork Human Audible Range Frequency and Pich 0 f Insrumen A Hearing is usually limied o frequencies beween 0 Hz and 0 khz. 0 f Insrumen B The upper limi decreases wih age. The audible frequency range is differen for animals 0 f Professor Deepa Kundur (Universiy of Torono) Audio DSP 3 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 4 / 54 Animal Audible Range Frequency and Pich Sinusoids and Sound: Phase Phase and Sound Species Approx Range (Hz) human 0-0,000 dog 67-45,000 rabbi 360-4,000 ba,000-0,000 goldfish 0-3,000 Reference: R.R. Fay (988), Hearing in Verebraes: A Psychophysics Daabook. A fundamenal uni of sound is he sinusoidal. x a () = A cos(πf 0 + θ), R A volume F0 pich θ phase Professor Deepa Kundur (Universiy of Torono) Audio DSP 5 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 6 / 54
Phase and Sound Phase and Sound Phase and Sound Phase and Sound An is represened by a real funcion x(). The funcion x( ) represens playing he backwards. Recall, x() F X (F ) x( ) F X ( F ) Since x() is real: Therefore, X (F ) = X ( F ) X (F ) = X ( F ) = X ( F ) since c = c for c C X (F ) = }{{} specrum magniude of x() specrum magniude of x( ) {}}{ X ( F ) Therefore, X (F ) = X ( F ) Tha is, he CTFT magniude is even for x() real. Therefore, he magniude of he FT of an played forward and backward is he same! Professor Deepa Kundur (Universiy of Torono) Audio DSP 7 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 8 / 54 Phase and Sound Audiory Masking Phase and Sound Audiory Masking Therefore, for x() x( ) F X (F ) F X ( F ) occurs when he perceived qualiy of one (primary) sound is affeced by he presence of anoher (secondary) sound X (F ) = X ( F ) he CTFT magniudes for forward and reverse sound s are exacly he same. X (f ) X ( f ) he CTFT phases for forward and reverse sound s are differen. Therefore, he relaive phase of he sinusoidal componens of sound conains very salien percepual informaion much like for images. Simulaneous masking: he secondary sound is heard a he same ime as he primary sound Can be exploied o mask non-ideal processing. Professor Deepa Kundur (Universiy of Torono) Audio DSP 9 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 0 / 54
Why Digiize Audio? Benefis of Audio Fideliy of digial is much higher han analog. Manipulaion ools for digial are much more sophisicaed han hose available for analog. Compression of digial provides significanly reduced sorage requiremens. Sorage of digial (e.g., CDs) are much more convenien and compac. Duplicaion of digial is exac in conras o analog. Convenien recording, enhancemen, mass-producion and disribuion. CDs, online sores such as itunes, ec. daa files are disribued insead of physical media soring he informaion such as records and apes. Professor Deepa Kundur (Universiy of Torono) Audio DSP / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP / 54 Concerns abou Audio vs. Audio: Audio Sysem Transducer (e.g., microphone) Convenien recording, enhancemen, mass-producion and disribuion. unlawful manipulaion of recorded is difficul o deec piracy: unlawful copying and redisribuion of copyrighed conen Loudspeaker Sorage microphone: convers sound ino an elecrical ; air pressure moion of conducor/coil magneic field elecrical loudspeaker: convers elecrical ino acousic waves; elecrical magneic field moion air pressure Professor Deepa Kundur (Universiy of Torono) Audio DSP 3 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 4 / 54
vs. Audio: Audio Sysem vs. Audio: Audio Chain Transducer (e.g., microphone) A/D Converer Error Correcion Coding (ECC) Sorage Sorage Loudspeaker D/A Converer ECC Decoding associaed circuis suffer from inheren noise (noise floor) capaciance and inducance of he circuis limi bandwidh, and resisance limis ampliude fideliy limied by quanizaion noise bandwidh limied by sampling rae dynamic range limied by bi resoluion Professor Deepa Kundur (Universiy of Torono) Audio DSP 5 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 6 / 54 Audio DSP Sysem Audio DSP Sysem Anialiasing Sample and Hold A/D Processing for Sorage D/A Reconsrucion Anialiasing Sample and Hold A/D Processing for Sorage D/A Reconsrucion inpu (from microphone ransducer) Bandlimied analog Sampled daa {0000} {0000} Cs-ime ds-amp saricase oupu inpu (from microphone ransducer) Bandlimied analog Sampled daa {0000} {0000} Cs-ime ds-amp saricase oupu Ani-aliasing : ensures ha analog inpu does no conain frequency componens higher han half of he sampling frequency (o avoid aliasing) Example: C673 DSP, F s = 8 khz, herefore ani-aliasing filer mus have a passband of 0 Hz o 4000 Hz. Professor Deepa Kundur (Universiy of Torono) Audio DSP 7 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 8 / 54
Inpu Signal Audio DSP Sysem Anialiasing Sample and Hold A/D Processing for Sorage D/A Reconsrucion -3 - - 3 4 - inpu (from microphone ransducer) Bandlimied analog Sampled daa {0000} {0000} Cs-ime ds-amp saricase oupu Ani-aliased Signal Sample and Hold: holds a sampled analog value for a shor ime while he A/D convers and inerpres he value as a digial -3 - - 3 4 - Professor Deepa Kundur (Universiy of Torono) Audio DSP 9 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 30 / 54 Ani-aliased Signal Audio DSP Sysem Anialiasing Sample and Hold A/D Processing for Sorage D/A Reconsrucion -3 - - 3 4 - inpu (from microphone ransducer) Bandlimied analog Sampled daa {0000} {0000} Cs-ime ds-amp saricase oupu Sampled Daa Signal ani-aliased A/D: convers a sampled daa value ino a digial number, in par, hrough quanizaion of he ampliude -3 - - 3 4 - x() Professor Deepa Kundur (Universiy of Torono) Audio DSP 3 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 3 / 54
Sampled Daa Signal Audio DSP Sysem ani-aliased Anialiasing Sample and Hold A/D Processing for Sorage D/A Reconsrucion -3 - - 3 4 - inpu (from microphone ransducer) Bandlimied analog Sampled daa {0000} {0000} Cs-ime ds-amp saricase oupu Signal sampled daa -3 - - 3 4 - Processing for Sorage: ransmission/sorage conains inheren non-idealiies ha cause errors in he received/rerieved daa symbols error correcion coding (ECC) is employed o add redundancy o he digial so ha errors can be compensaed for during decoding Professor Deepa Kundur (Universiy of Torono) Audio DSP 33 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 34 / 54 Error Correcion Coding Example: N-repeiion code Inpu Signal Bi Coded Sequence 0 } 0 0 0 {{ 0} N zeros } {{ } N ones Therefore, for N = 3 he following inpu sequence: 0 0 would be coded as follows: 0 0 0 0 0 0. Error Correcion Coding Q: How would you inerpre receiving he following coded sequence (wih possible error): 0 0 0 0 0? }{{} 0 0 }{{} 0 0 0 0 }{{} 0 A: Decoding can make use of majoriy voe logic. x() Professor Deepa Kundur (Universiy of Torono) Audio DSP 35 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 36 / 54
Error Correcion Coding Coder for N = 3: Inpu Signal Bi Coded Sequence 0 0 0 0 Majoriy voe logic decoder for N = 3: Received Coded Seq Decoded Signal Bi 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Audio DSP Sysem inpu (from microphone ransducer) Anialiasing Bandlimied analog Sample and Hold Sampled daa A/D {0000} Processing for Sorage {0000} D/A Cs-ime ds-amp saricase Reconsrucion D/A: convers a digial ino a saircase -like for furher reconsrucion oupu Professor Deepa Kundur (Universiy of Torono) Audio DSP 37 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 38 / 54 Signal Audio DSP Sysem sampled daa Anialiasing Sample and Hold A/D Processing for Sorage D/A Reconsrucion -3 - - 3 4 - inpu (from microphone ransducer) Bandlimied analog Sampled daa {0000} {0000} Cs-ime ds-amp saricase oupu digial Saircase Signal -3 - - 3 4 - sampled daa Reconsrucion : convers a saircase -like ino an analog filer hrough lowpass filering depending on he applicaion he filer can be similar o he ani-aliasing filer, or may be very cheap (e.g., compac disk receivers), or may using a differen sampling rae for special effecs Professor Deepa Kundur (Universiy of Torono) Audio DSP 39 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 40 / 54
digial Saircase Signal -3 - - 3 4 - sampled daa Reconsruced Signal ani-aliased The qualiy of digiizing is relaed o he following parameers: sampling rae (Hz) bi deph (bis/sample) and dynamic range (relaed o number of quanizaion levels) mono vs. sereo -3 - - 3 4 - Professor Deepa Kundur (Universiy of Torono) Audio DSP 4 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 4 / 54 Audio Qualiy Audio Qualiy and Sampling Rae Noe: For he same cos, digial provides higher -o-noise raio or lower mean-square error beween he real sound and wha is recorded/played. I is less expensive o increase sampling rae and quanizaion deph (i.e., reduce quanizaion noise) han o use less noisy analog circuiry (i.e., reduce noise floor) When s are represened digially he naural noise in he circuis can be circumvened via error correcion coding. Thus, i is possible o have near perfec sorage/ransmission. Audio Qualiy as a Funcion of Sampling Rae: Sampling Rae (Hz) Qualiy Similar o 8,000 elephone,05 AM radio,050 FM radio 44,00 CD 48,000 DAT x() Professor Deepa Kundur (Universiy of Torono) Audio DSP 43 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 44 / 54
Audio Qualiy Audio Qualiy, Sampling Rae, and Bi Deph Audio Qualiy as a Funcion of Sampling Rae, Bi Deph and Sereo/Monophony: Sampling Rae (Hz) Bi Deph Sereo/Mono Qualiy 8,000 8 mono elephone,05 8 sereo low,050 8 sereo,050 6 mono,050 6 sereo 44,00 6 mono good 44,00 6 sereo CD qualiy Audio Qualiy Audio Qualiy Q: Why do some people insis ha analog is superior o digial? A: Wha hey hink sounds good isn he exac original sound, bu a nonlinearly disored version generaed from he analog componens. Noe: Some digial companies now make digial amplifiers ha mimic he disorion from analog amplifiers. Qualiy of is a qualiaive and psychological measure ha is user-specific. Professor Deepa Kundur (Universiy of Torono) Audio DSP 45 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 46 / 54 Audio Equalizaion Equalizer Design Basics Equalizaion Equalisaion EQ amplifying or aenuaion differen frequency componens of an Example: bass/reble conrol in inexpensive car radios Common goals of equalizaion: provide fine granulariy of frequency amplificaion/aenuaion conrol wihou affecing adjacen frequencies. correc for unwaned frequency aenuaion/amplificaion during recording processes enhancing he presence of cerain sounds reducing he presence of unwaned s such as noise. Deermine he processing band of your. human audible range is: 0 Hz o 0 khz if sampling rae of a DSP is Fs hen, he bandwidh of he o process is: 0 o Fs Hz Example: Fs = 6, 000 Hz -8000-0 0 8000 Professor Deepa Kundur (Universiy of Torono) Audio DSP 47 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 48 / 54
Equalizer Design Basics Equalizer Design Basics. Deermine he granulariy of your equalizer (i.e., number of frequency bands o independenly conrol). one approach migh be o equally pariion he bandwdih more popular approaches suied o human audiory sysem models have bands ha increase in widh by wo Example: 3 frequency bands 3. Design your bandpass filers. each bandpass filer is independenly se/conrolled from he ohers ideally, many people would like shelving EQ Example: Ideal bandpass filers -8000-3000 -000-0 0 000 3000 8000-8000 -3000-000 -0 0 000 3000 8000 Professor Deepa Kundur (Universiy of Torono) Audio DSP 49 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 50 / 54 Equalizer Design Basics Common Types of Equalizers 3. Design your bandpass filers. each bandpass filer is independenly se/conrolled from he ohers ideally, many people would like shelving EQ Example: Bell EQ All bell filers and many oher bandpass filers can be characerized by hree parameers: cener frequency widh of he bell curve gain (i.e. peak) of he bell curve cener frequency -8000-3000 -000-0 0 000 3000 8000-8000 -3000-000 -0 0 000 3000 widh 8000 peak ampliude Professor Deepa Kundur (Universiy of Torono) Audio DSP 5 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 5 / 54
Common Types of Equalizers Common Types of Equalizers Parameric Equalizers: he cener frequency, passband widh and peak ampliude can be independenly seleced for each filer mos powerful EQ, predominanly used for recording and mixing Graphic Equalizers: he cener frequency and passband widh of each filer are pre-se; he gains of each filer can be independenly conrolled used for live applicaions such as concers Noch s: he passband widh is small and fixed for each filer; cener frequencies and gains are variable. used in mulimedia applicaions/ masering Professor Deepa Kundur (Universiy of Torono) Audio DSP 53 / 54 Professor Deepa Kundur (Universiy of Torono) Audio DSP 54 / 54