{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS 100 M Lecture 22

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

This preview shows pages 1–9. Sign up to view the full content.

22. Working with Sound Files wavread sound wavwrite

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

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

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

View Full Document
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
Given human perception, about 20000 samples/second is pretty good. i.e., 20000 Hertz i.e., 20kHZ Sampling Rate (Cont’d)

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

View Full Document
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
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

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern