CS 100 M Lecture 22 - 22. Working with Sound Files wavread...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
22. Working with Sound Files wavread sound wavwrite
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Reading and Playing [y,rate,nBits] = wavread(‘noCry.wav’) sound(y,rate) We will work with .wav files How is audio information encoded?
Background image of page 2
Discrete vs Continuous Sound is continuous. Capture its essence by sampling. Digitized sound = 1-dim array of numbers
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Quality Issue: Sampling Rate If sampling not frequent enough, then the discretized sound will not capture the essence of the continuous sound… Too slow OK
Background image of page 4
Given human perception, about 20000 samples/second is pretty good. i.e., 20000 Hertz i.e., 20kHZ Sampling Rate (Cont’d)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sampling Rate (Cont’d) 8,000 Hz required for speech over the telephone 44,100 Hz required for audio CD, MP3 files 192,400 Hz required for HD-DVD audio tracks
Background image of page 6
Quality Issue: Resolution Each sampled value is encoded as an eight-bit integer in the .wav file. Possible values: -128, -127,…,-1,0,1,…,127 Loud: -120, 90, 122, etc Quiet: 3, 10, -5 8-bits usually enough. Sometimes 16-bits
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Back to wavread [y,rate,nBits] = wavread('noCry.wav'); n = length(y) n = 77804 rate = 11025 nBits = 8 noCry.wav encoded the sound with 77,804 8-bit numbers which were gathered over a span of about 77804/11025 secs
Background image of page 8
Let’s Look at the Sample Values 0.07031250000000
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 34

CS 100 M Lecture 22 - 22. Working with Sound Files wavread...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online