sound synthesis ce 476 music & computers. additive synthesis we add together different...

44
Sound Synthesis Sound Synthesis Sound Synthesis Sound Synthesis CE 476 Music & Computers CE 476 Music & Computers

Upload: kerry-charles

Post on 19-Dec-2015

220 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Sound SynthesisSound Synthesis

Sound SynthesisSound Synthesis

CE 476 Music & ComputersCE 476 Music & Computers

Page 2: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Additive SynthesisAdditive Synthesis

• We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3.

• We can add spectral envelopes to a number of partials. By this way, we can impose a different amplitude trajectory for each harmonic, independently making each harmonic louder and softer over time, see Applet 4.4.

Page 3: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

sin(4*x) + sin(x)+cos(x/2), x=0..2*Pi

Page 4: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

sin(5*x) + sin(x), x=0..2*Pi

Page 5: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Changing Sound Parameters

• The quality of a synthesized sound can be improved by varying its parameters (partial frequencies (harmonics), amplitudes, and envelope) over time.

• These soundfiles are examples of sentences reconstructed with sine waves. Soundfile 4.2 is the sine wave version of the sentence spoken in Soundfile 4.3, and Soundfile 4.4 is the sine wave version of the sentence spoken in Soundfile 4.5.

Page 6: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Amplitude envelope shape

Page 7: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Attacks, Decays, and Time Evolution in Sounds

• Additive synthesis has some drawbacks. One serious problem is that while it’s good for periodic sounds, it doesn’t do as well with noisy or chaotic ones.

• For instance, creating the steady-state part (the sustain) of a flute note is simple with additive synthesis (just a couple of sine waves), but creating the attack portion of the note, where there is a lot of breath noise, is nearly impossible.

• Therefore, we have to synthesize a lot of different kinds of information: noise, attack transients, and so on.

• The ear and brain are much more interested in things like attacks, decays, and changes over time in a sound. That’s bad news for all that additive synthesis software, which doesn’t handle such things very well.

Page 8: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Subtractive Synthesis:Subtractive Synthesis: FiltersFilters

• A filter is a function that takes in a signal and gives back some sort of transformed signal.

• Usually, what comes out is "less" than what goes in.

• In additive synthesis, we start with simple sounds and add them together to form more complex ones.

• In subtractive synthesis, we start with a complex sound (like noise) and subtract, or filter out, parts of it.

Page 9: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Cutoff Frequency

• A filter is defined as the point at which the signal is attenuated to 0.707 of its maximum value (which is 1.0).

• That is, the power of a signal is determined by squaring the amplitude: sqrt(0.5) = 0.707, i.e, which gives the amplitude of a signal at 0.707 of its maximum value, it is also called half-power.

Page 10: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Low-pass Filter Characteristics

Page 11: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Transition Band

• The area between where a filter "turns the corner" and where it "hits the bottom" is called the transition band.

• The steepness of the slope in the transition band is important in defining the sound of a particular filter.

• If the slope is very steep, the filter is said to be "sharp"; conversely

• If the slope is more gradual, the filter is "soft" or "gentle."

Page 12: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Transition Band

Page 13: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Four Basic Type of Filters

http://music.columbia.edu/cmc/musicandcomputers/chapter4/04_03.php

See Applet 4.5 and 4.6

Page 14: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

IIR and FIR Filters

• Digital filters are classified in two groups as the technical approach:

• FIR: Finite impulse response,– what comes out uses a finite number of samples, and

a sample only has a finite effect. By delaying a signal and then averaging the delayed signal and the nondelayed one.

• IIR: Infinite impulse response. – If we delay, average, and then feed the output of that

process back into the signal, we create a IIR filter. The feedback process actually allows the output to be much greater than the input. These filters can, as we like to say, "blow up."

Page 15: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

FIR FILTERS

Page 16: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Example FIR Filter

Example:Filter Type: Low Pass Sampling Frequency: 2000 Hz Cut off Frequency: 460 Hz Filter Length (# weights): 21M - filter order, it is always equal to the number of taps minus 1 ft - Normalised transition frequency.

Page 17: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Response of the Example FIR Filter

Example:Filter Type: Low Pass Sampling Frequency: 2000 Hz Cut off Frequency: 460 Hz Filter Length (# weights): 21M - filter order, it is always equal to the number of taps minus 1 ft - Normalised transition frequency.

Page 18: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

IIR FILTERS

Page 19: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Subtractive Sound Synthesis

• Sound generators used in subtractive synthesis have large spectra. Therefore, we need to subtract from the sound.

• Mostly filter banks are used to subtract desired harmonics or partials and put them together to create the desired sound.

Page 20: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Sound GeneratorsSound Generators

• Noise generators– White noise– Pink noise

• Oscillators– Sine– Square– Sawtooth– Triangle

• Audio files and sampled sounds– Sounds being produced by live sources in real time

Page 21: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

WHITE NOISEWHITE NOISE

• One of the most commonly used source of sounds for subtractive synthesis is white noise

• Definition: A sound that contains all audible frequencies, whose spectrum is essentially flat, i.e., Amplitudes of individual frequencies (harmonics) are randomly distributed.

Page 22: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Spectrum of White NoiseSpectrum of White Noise

Page 23: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Sonogram of White Noise

Page 24: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

PINK NOISEPINK NOISE

• Pink noise, in contrast to white noise, has a spectrum whose energy decays as frequency rises. More precisely, the attenuation in pink noise is 3 dB per octave.

• Pink noise is also called 1/f noise to indicate that the spectral energy is proportional to the reciprocal of the frequency.

Page 25: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Spectrum of Pink NoiseSpectrum of Pink Noise

Page 26: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Spectrum of a Sine WaveSpectrum of a Sine Wave

Page 27: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Spectrum of a 440 Hz Sine WaveSpectrum of a 440 Hz Sine Wave

Page 28: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

PPseudo-random generatorsseudo-random generators

• white noise is generally produced using random number generators. The resulting waveform contains all of the reproducible frequencies

• Random number generators use

• mathematical procedures that are not precisely random but they generate series that repeat after some number of events.

Page 29: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

PPseudo-random sample generatorsseudo-random sample generators

• These generate random values at a given frequency with a constant value until it is time to generate the next sample. This results in a waveform

• Example of a 100 Hz noise generator: the random value is repeatedly output for a period equal

• to 1/100 of a second, after which a new random value is computed. If the sampling rate were 48,000 Hz, for example, each random value would be repeated as a sample 48,000 / 100 = 480 times.

Page 30: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

PPseudo-random sampleseudo-random sample

Page 31: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

OSCILLATORS AND OTHER OSCILLATORS AND OTHER SIGNAL GENERATORSSIGNAL GENERATORS

• We use classic waveforms such as the sine wawe, square wave, the sawtooth wave, and the triangle.

• Thes waveforms, when geometrically perfect, contain an infinite number of frequency components.

• However, the infinity causes nasty problems when producing digital sound, since an audio interface cannot reproduce frequencies above half of its sampling rate.

• Undesired components are almost always non-harmonic.

Page 32: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

BBand-limited oscillatorsand-limited oscillators

• To avoid the problem with the undesired frequency components band-limited oscillators are used

• Such oscillators, which produce the classic waveforms, are built so that their component frequencies never rise above half of the sampling rate

Page 33: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Waveshaping SynthesisWaveshaping Synthesis

• Waveshaping technique turns simple sounds into complex sounds. We can take a pure tone, like a sine wave, and transform it into a harmonically rich sound by changing its shape.

• A guitar fuzz box is an example of a waveshaper. An unamplified electric guitar sound is fairly close to a sine wave. But the fuzz box amplifies it and gives it sharp corners.

• Waveshaper generally have much more energy in their higher-frequency harmonics, which gives them a "richer" sound.

Page 34: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

How to WavesahpeHow to Wavesahpe

• transfer functions are used to transfrom one waveform into another, e.g.,

• That is, to pass a simple sine wave, x = sin(wt), varying from -1.0 to 1.0 through this waveshaper, then we get

y = x3 = sin3(wt)

:= y ( )f x x3

Page 35: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

y ( )sin t 3

Page 36: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Triangle:=

Sinewave

Trianglewave

( )sin t ( )sin t 5

Page 37: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Normalized WNormalized Waveshaper aveshaper Output Output

• If we use X^3 as the output of X for the input range -1 to 1 than we can get vary high output values, we can keep the output between -1 to 1, by another transfer function:

yx

1 x

Page 38: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

1.5 ( )sin t 0.5 ( )sin t 5

Sinewave

Squarewave

Page 39: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

1.5 ( )sin t 0.5 ( )sin 3 t 5Trianglewave

Sinewave

Page 40: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Square-like ewave

Sinewave

1.5 ( )sin t 0.5 ( )sin 5 t 5

Page 41: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Chebyshev PolynomialsChebyshev Polynomials

• A transfer function is often expressed as a polynomial:

( )f x d0 d1 x d2 x2 d3 x

3 dn xn

The highest exponent n of this polynomial is called the "order" of the polynomial. Order 2 results in a doubling of the pitch. So a polynomial of order 2 produces strong second harmonics in the output.

Page 42: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Chebyshev Polinomial as Chebyshev Polinomial as Frequency MultiplierFrequency Multiplier

• If you input a sine wave of amplitude 1.0, you get out a sine wave whose frequency is N times the frequency of the input wave.

• If the amplitude of the input sine wave is less than 1.0, then you get a complex mix of harmonics.

• Generally, the lower the amplitude of the input, the lower the harmonic content. This gives musicians a single number, sometimes called the distortion index, that the musican can tweak to change the harmonic content of a sound.

• If you want a sound with a particular mixture of harmonics, then you can add together several Chebyshev polynomials multiplied by the amount of the harmonic that you desire.

Page 43: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Example Example Chebyshev polynomialsChebyshev polynomials

Formula for generating Chebyshev polynomials:

Page 44: Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3

Table-Based WaveshapersTable-Based Waveshapers

• We generally precalculate these polynomials and put the results in a table. Then when we synthesize a sound, we just take the value of the input sine wave and use it to look up the answer in the table.