CS1371 Introduction to Computing for Engineers - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

CS1371 Introduction to Computing for Engineers

Description:

HW8 still due Thursday. Lab 2 is out. Due Friday 10/21 midnight. ... Load handel. Y 73k samples, at 8k per second - how many seconds. Plot(y,Hz) Sound(y,Hz) ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 14
Provided by: david3049
Category:

less

Transcript and Presenter's Notes

Title: CS1371 Introduction to Computing for Engineers


1
CS1371Introduction to Computing for Engineers
  • Sound -1

2
Administrivia
  • HW8 still due Thursday
  • Lab 2 is out. Due Friday 10/21 midnight.
  • No school on Mon Tues (as if you didn't
    know!!!)
  • Reading
  • Sound Smith, Chapter 18

3
Media Player Beethoven's 9th
  • Actual signal - one dimensional but not much
    information - (show using Bars and Waves gt
    Scope)
  • Show graphic output of frequency in Media Player
  • Horiz and Vert axis
  • Freq (pitch) band
  • Intensity Power Energy

4
Analog to Digital to Digital to Analog
  • When sound hits your ears digital or analog?
  • Or light hits your eyes
  • First step is going digital - three questions
  • How often?
  • What range?
  • How precise?
  • After digitization, have lots of numbers (44k
    samples per second for CD, 8k for others) of some
    bit length (8, 16, 32, etc)
  • Can splice those numbers (Today).
  • Can change those numbers (filtering) (Friday).
  • Then convert back to voltage and output thorugh
    speakers or on a printter

5
Music in matlab
  • Load handel
  • Y 73k samples, at 8k per second - how many
    seconds
  • Plot(y,Hz)
  • Sound(y,Hz)

6
Sound in Matlab
  • Sound(X, Hz) takes a vector of samples (X) that
    were sampled at Hz (Fs) samples per second and
    plays it as a sound.
  • Assumes range of -1 to plus 1 (clips)
  • Hz defaults to 8192 Hz (hertz)
  • Example
  • x 110000 yy sin(x)
  • sound(yy)
  • plot(yy)

7
Can play with frequency through Hz
  • Sound(yy,4096) - longer but lower
  • Sound(yy,16000) shorter but higher
  • For vector Nx1 or 1xN doesn't matter
  • For stereo Nx2

8
Splicing
  • If sounds these are just arrays (vectors) of
    numbers, then we already know how to cut and
    pslice pieces of sound

9
Removing Dear
  • figure
  • damn, Hzd wavread('sounds\sp_givdamn2.wav')
  • subplot(1, 2, 1)
  • plot(damn)
  • sound(damn, Hzd)
  • pause(length(damn)/Hzd)
  • lo 4500
  • hi 8700
  • sdamn damn(1lo) damn(hiend) .5
  • subplot(1, 2, 2)
  • plot(sdamn)
  • sound(sdamn, Hzd)

10
Houston Problem
  • houston, Hzh wavread('sounds\sp_a13prob.wav')
  • subplot(1, 2, 1)
  • plot(houston)
  • sound(houston, Hzh)
  • pause(length(houston)/Hzh)
  • clip 110000
  • prob houston(clipend)2
  • subplot(1, 2, 2)
  • plot(prob)
  • sound(prob, Hzh)
  • pause(length(prob)/Hzh)

11
We Don't Care
  • speech prob sdamn
  • plot(speech)
  • sound(speech, Hzt)

12
Playing with pitch through time
  • If you change the number of samples per second,
    the tone changes. (Remember sine)
  • Likewise, we can stretch or shrink the signal
    (keeping the sampling rate the same) to change
    the pitch. (Better)

13
Scale.m
Write a Comment
User Comments (0)
About PowerShow.com