480 likes | 922 Views
Sound Synthesis. Part III: Distortion-based synthesis (FM & Waveshaping ). Plan. Distortion-based synthesis FM synthesis Waveshaping Matlab code for synthesis Example of synthesized composition ( Risset ) Summary. Types of synthesis. Distortion (aka nonlinear) Synthesis.
E N D
Sound Synthesis Part III: Distortion-based synthesis (FM & Waveshaping)
Plan • Distortion-based synthesis • FM synthesis • Waveshaping • Matlab code for synthesis • Example of synthesized composition (Risset) • Summary
Distortion (aka nonlinear) Synthesis • Additive synthesis is powerful & flexible BUT requires many simple oscillators. • Plethoric and non-intuitive controls on the sound spectrum. • Using fewer oscillators, with more components. • Complex spectra can be obtained by distorting simple oscillators.
Plan • Distortion-based synthesis • FM synthesis • Waveshaping • Substractive synthesis • Summary
FM Synthesis • Pioneered by John Chowning (1973) • “Alteration of distortion of the frequency of an oscillator in accordance with the amplitude of a modulating signal.” • Similar to Vibrato modulation, but using audible modulating frequency and larger width. • Generate a large number of timbres easily controlled.
FM Synthesis (2) • Modulated frequency infc-d <= fv <= fc+d • Peak frequency deviation d(in Hz) • Vibrato: small d & fm • FM Synth: largerd&fm • Note: if d>fc, thenfvcan be < 0 (negative phase applied!) • Rich spectrum from sine waves only! d Modulating oscillator fm fc + A fv Carrier oscillator
FM Synthesis (3) • Spectrum:fc + k.fm, fork an integer. • Sidebands increase with d • Modulation index I=d/fm • Spectrum amplitude: • Fc+k.fmJk(I) • whereJkis thekthBessel function • Sidebands significant ~ for|k|<I+1(rule of thumb) Magnitude fc fc-fm fc+fm fc-3.fm fc-2.fm fc+3.fm fc+2.fm Frequency Bessel Functions J1(X), J2(X) and J3(X)
FM Synthesis (4) Bessel Functions J1(X), J2(X) and J3(X) • Bessel functions can be negative! • Odd number, low-frequency components have opposite sign J-1(I) = -J1(I) • Negative spectrum represents out-of-phase components. • Combination of in-phase and out-of-phase components of same amplitude cancels out. magnitude fc fc-fm fc+fm fc-3.fm fc-2.fm fc+3.fm fc+2.fm
FM Synthesis: Dynamic Spectrum I*fm • Dynamic spectrum can be obtained by applying envelopes to both carrier and modulating signals. • I is the max value of the modulation index • More limited than additive synthesis, but requires less components. ASD Envelope A fm fc ASD Envelope + fo
FM Synthesis: Dynamic Spectrum TIME FREQUENCY
FM Synthesis: Instrument Design 1/d fm*I • Envelopes functions F1 & F2 change the timbre of the sound (John Chowning, 1973) • A) Bell-like timbre • B) Wood drum sound • C) Brass-like timbre 1/d A fm fc F1 F2 + fo (John Chowning, 1973)
FM Synthesis: Instrument Design (2) 1/d fm*I • A) Bell-like timbre • D = 15s • Fc = 200Hz • Fm = 280Hz • I = 10 1/d A fm 1 fc F1 F2 + d F1 = F2 fo (John Chowning, 1973)
FM Synthesis: Instrument Design (3) 1/d fm*I • B) Wood drum sound • D=0.2 s • Fc=80Hz • Fm=55Hz • I=25 1/d A fm 1 1 fc F1 F2 + d d F1 F2 fo (John Chowning, 1973)
FM Synthesis: Instrument Design (4) 1/d fm*I • C) Brass-like timbre • D=0.6 • fc=440Hz • Fm=440Hz • I=5 (or 3) 1/d A fm 1 fc F1 F2 + d F1 = F2 fo (John Chowning, 1973)
FM Synthesis Instrument Design (5) 1/d fm*(I-J) • D) Clarinet-like timbre • d = 0.5 s. • Fc = 900 Hz • Fm = 600 Hz • I = 2 • J = 4 J*fm 1/d + A fm 1 1 fc F1 F2 d d + F1 F2 fo (John Chowning, 1973)
FM Synthesis: Instruments Summary A) BELL-LIKE B) WOODEN DRUM C) BRASS-LIKE D) CLARINET
Plan • Distortion-based synthesis • FM synthesis • Waveshaping • Matlab code for synthesis • Example of synthesized composition (Risset) • Summary
Waveshaping (1): Definition • Idea: “realizes spectra that have dynamic evolution of their components.” • More computationally efficient than additive (like FM) • Allows generation of band-limited spectrum with a set max harmonic number (unlike FM) A f0 WS waveshaper
Waveshaping (2): Transfer Function • Waveshaper: nonlinear processor that alters the shape of the waveform passing through. • Defined by a transfer function: ys=f(y0) • The shape of the output waveform (and spectrum) changes with amplitude of the input signal! CARRIER TRANSFER FUNCTION OUTPUT INPUT RESULT
Transfer function High amplitude Nonlinear response Low amplitude ~ linear response
Waveshaping (3): Transfer Function TRANSFER FUNCTION OUTPUT INPUT CARRIER RESULT
Waveshaping (4): Some Transfer Functions out out out in in in C) Even A) Linear B) Odd out out out in in in D) Discontinuous E) Sharp points F) Ripple
Waveshaping: Linear Transfer Functions • Eg, f(x) = 0.5x • Reduces amplitude by half. • No distortion, no harmonic added. out in f(x) = 0.5*x
Waveshaping: Odd Transfer Functions • Definition:f(-x) = -f(x) • Eg, f(x) = x^3 • Nearly linear for low amplitude ( low distortion) • Highly non-linear for high amplitude (high distortion) • Generates only odd-numbered harmonics! out in f(x) = x^3
Waveshaping: Even Transfer Functions • Definition: f(-x) = f(x) • Eg.f(x) = 2*x^2-3*x^4 • Creates only even harmonics • Even transfer function doubles the fundamental frequency • raises the pitch by one octave! out in f(x) = 2*x^2-3*x^4
Waveshaping: Other Transfer Functions out • Discontinuities and sharp points will create more harmonics than a smooth function • Generally causes aliasing! • For this reason, it is common to use polynomial transfer functions • f(x) = d0+d1*x+d2*x^2+......+dn*x^n in D) Discontinuous out in E) Sharp points
Waveshaping: Polynomial Transfer Functions See Dodge & Jerse Eg, for a pure tone of amplitude 1, f(x)=x^5 will generate? What about f(x) = 2*x^2 – 3*x^4?
Waveshaping: Polynomial Transfer Functions • The transfer function:f(x) = 2*x^2 – 3*x^4 applied to a pure tone (sinusoidal) carrier of amplitude 1, will generate the following harmonics: • H0 = 2*2/2 - 3*6/8 • H2 = 2*1/2 – 3*4/8 • H4 = -3*1/8
Waveshaping: Spectral matching • For a pure tone cosine carrier of unit amplitude (A=1) – also called distortion index, • Applying a transfer function based on a Chebyshev polynomial Tk(x)will generate only the kth harmonic • General form for Chebyshev polynomials: Tk+1(x) = 2xTk(x)-Tk-1(x)
Waveshaping: Chebyshev Polynomials • T0(x) = 1 • T1(x) = x • T2(x) = 2x^2-1 • T3(x) = 4x^3-3x • T4(x) = 8x^4-8x^2+1 • T5(x) = 16x^5-20x^3+5x • T6(x) = 32x^6-48x^4+18x^2-1 • Etc.
Waveshaping: Using Chebyshev Polynomials • For example, to generate only 1st, 2nd, 4th & 5th harmonics with amplitudes 5, 1, 4, and 3, respectively. • We can design the transfer function: • F(x) = 5*T1(x)+1*T2(x)+4*T4(x)+3*T5(x)
Waveshaping: Instrument Design 255 0.64 0.085 ASD Envelope • Instrument for clarinet-like timbre • From Jean-Claude Risset’sIntroductory Catalogue of Computer Synthesized Sounds. fm 256 + F(x) * A
Waveshaping: Amplitude Scaling • Distortion index A affects sound’s amplitude, and there by loudness. • Similar to acoustic instruments: louder play usually generates more overtones. • Excessive loudness variation excessive bright tones. • Solution: apply a scaling function to the amplitudeR(A,x) = F(Ax)S(A) A f0 S(A) F(x) *
Plan • Distortion-based synthesis • FM synthesis • Waveshaping • Matlab code for synthesis • Example of synthesized composition (Risset) • Summary
Matlab Code • Examples for all sounds are available here: • http://info.ee.surrey.ac.uk/Personal/N.Pugeault/MediacastingL3_2012/ • Parameters can be tweaked to evaluate their influence. • Matlab is convenient for plotting results> spectrogram( y, ntime, noverlap, nfft, fs )> spectrogram( y, 256, 250, 250, fs ) • Can play sounds using the command: > sound( y, fs )
Plan • Distortion-based synthesis • FM synthesis • Waveshaping • Matlab code for synthesis • Example of synthesized composition (Risset) • Summary
Plan • Distortion-based synthesis • FM synthesis • Waveshaping • Matlab code for synthesis • Example of synthesized composition (Risset) • Summary
Additional Reading • C. Dodge, C., & Jerse, T. A. (1997). Computer Music: Synthesis, Composition, and Performance. Schrimer, UK.(see chapters 5 and 6) • Matlab examples for all sounds & instruments are available here: • http://info.ee.surrey.ac.uk/Personal/N.Pugeault/MediacastingL3_2012/