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

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

View Full Document Right Arrow Icon
1 CSE 471 Media Processing and Multimedia Lots of Practical Audio Techniques Audio synthesis vs. processing Some code examples Delay
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
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…
Background image of page 5

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

View Full DocumentRight Arrow Icon
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
Background image of page 6
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; }
Background image of page 7

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

View Full DocumentRight Arrow Icon
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
Background image of page 8
9 CSE 471 Media Processing and Multimedia What we expected to happen Vibrato should be a varying rate of playout… 0 Time
Background image of page 9

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

View Full DocumentRight Arrow Icon
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
Background image of page 10
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);
Background image of page 11

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

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

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 Right Arrow Icon
Ask a homework question - tutors are online