# lecture4 - CSE 471 Media Processing and Multimedia Lots of...

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

1 CSE 471 Media Processing and Multimedia Lots of Practical Audio Techniques Audio synthesis vs. processing Some code examples Delay

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

View Full Document
2 CSE 471 Media Processing and Multimedia Audio Synthesis Audio synthesis – Generation of sounds using computers On-line synthesis – Output is a signal Off-line synthesis – Output is a file What do we need to do Decide the sound to generate Generate the sample frames
3 CSE 471 Media Processing and Multimedia Audio Processing Audio processing – Manipulation of existing sounds on-line and off-line still apply What do we want to do? Decide what changes we are making Generate the sample frames

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

View Full Document
4 CSE 471 Media Processing and Multimedia Some basic synthesis techniques Gain (changing amplitude) Multiplication Mixing Addition Sampling mathematical functions sin, cos, etc. Creating mathematical functions Wavetables
5 CSE 471 Media Processing and Multimedia Sine wave generator double samplePeriod = 1. / sampleRate; for(double time=0.; time < duration; time += samplePeriod;) { short audio[2]; short sample = short(amplitude * sin(time * 2 * M_PI * freq1)); audio[0] = sample; audio[1] = sample; GenerateFrame(audio); } f(t) = α sin( ϖ t) BTW, Don’t use this…

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

View Full Document
6 CSE 471 Media Processing and Multimedia Function sampling methods How do we vary signals over time? Vibrato – small changes in frequency of a tone at a rate of 5 to 10 Hz A form of frequency modulation Livens up the sound
7 CSE 471 Media Processing and Multimedia Vibrato pass 1 (does not work!) for(int i=0; time < duration; i++) { // The difference in frequency over time double diff = 10. * sin(time * 2 * M_PI * freq2); short audio[2]; short sample = short(amplitude * sin(time * 2 * M_PI * (freq1 + diff))); audio[0] = sample; audio[1] = sample; GenerateFrame(audio); time += 1. / sampleRate; }

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

View Full Document
8 CSE 471 Media Processing and Multimedia Why this fails We are sampling a continuous waveform at points Radians 0 sin ϖ t – Linear mapping of time to radians Time
9 CSE 471 Media Processing and Multimedia What we expected to happen Vibrato should be a varying rate of playout… 0 Time

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

View Full Document
10 CSE 471 Media Processing and Multimedia But, we get… sin( ( ϖ 1 + α sin( ϖ 2 t)) t )= sin( ϖ 1 t + α sin( ϖ 2 t)t ) α sin( ϖ 2 t)t is a phase shift Mapping of time to radians: ϖ 1 t Phase shift: α sin( ϖ 2 t)t
11 CSE 471 Media Processing and Multimedia One solution: Phase modulation sin( ϖ 1 t + α sin( ϖ 2 t) ) instead of: sin( ϖ 1 t + α sin( ϖ 2 t)t ) for(int i=0; time < duration; i++) { double diff = 3.14 * sin(time * 2 * M_PI * freq2);

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 07/25/2008 for the course CSE 471 taught by Professor Owen during the Fall '07 term at Michigan State University.

### Page1 / 43

lecture4 - CSE 471 Media Processing and Multimedia Lots of...

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

View Full Document
Ask a homework question - tutors are online