Julius Smith LAC-12 – 1 / 30
Signal Processing Libraries for FAUST
Julius Smith CCRMA, Stanford University Linux Audio Conference 2012 (LAC-12)
April 14, 2012
Overview Julius Smith LAC-12 2 / 30 F AUST Signal Processing - - PowerPoint PPT Presentation
Signal Processing Libraries for F AUST Julius Smith CCRMA, Stanford University Linux Audio Conference 2012 (LAC-12) April 14, 2012 Julius Smith LAC-12 1 / 30 Overview effect.lib filter.lib oscillator.lib Conclusion Overview Julius
Julius Smith LAC-12 – 1 / 30
Signal Processing Libraries for FAUST
Julius Smith CCRMA, Stanford University Linux Audio Conference 2012 (LAC-12)
April 14, 2012
Overview
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 2 / 30
FAUST Signal Processing Libraries
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 3 / 30
Highlights of Additions Since LAC-08
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 4 / 30
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 5 / 30
Moog Voltage Controlled Filters (VCF)
Overview
effect.lib
filter.lib
Conclusion
Julius Smith LAC-12 – 6 / 30
into second-order “biquad” sections
moog vcf (which has an unwanted one-sample delay in
its feedback path)
parameters are varied
changes (no pops!)
Moog VCF
Julius Smith LAC-12 – 7 / 30
Moog VCF See FAUST example vcf wah pedals.dsp
moog vcf(res,fr)
analog-form Moog VCF
res = corner-resonance amount [0-1] fr = corner-resonance frequency in Hz moog vcf 2b(res,fr)
Moog VCF implemented as two biquads (tf2)
moog vcf 2bn(res,fr)
two protected, normalized-ladder biquads (tf2np)
Phasing and Flanging
Julius Smith LAC-12 – 8 / 30
Phasing and Flanging See FAUST example phaser flanger.dsp
vibrato2 mono(...)
modulated allpass-chain (see effect.lib for usage)
phaser2 mono(...)
phasing based on 2nd-order allpasses (see effect.lib fo
phaser2 stereo(...)
stereo phaser based on 2nd-order allpass chains
flanger mono(...)
mono flanger
flanger stereo(...)
stereo flanger
Artificial Reverberation (effect.lib)
Overview
effect.lib
filter.lib
Conclusion
Julius Smith LAC-12 – 9 / 30
See FAUST example reverb designer.dsp
(ported to FAUST) See FAUST example zita rev1.dsp
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 10 / 30
Ladder/Lattice Digital Filters (filter.lib)
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 11 / 30
properties
Normalized Ladder Digital Filters (filter.lib)
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 12 / 30
Advantages of the Normalized Ladder Filter Structure:
⇒ Extreme Modulation is Safe
“transfer function, 2nd-order, s-plane, normalized, protected”
Ladder and Lattice Digital Filters
Julius Smith LAC-12 – 13 / 30
Lattice/Ladder Filters
iir lat2(bcoeffs,acoeffs)
two-multiply lattice digital filter
iir kl(bcoeffs,acoeffs)
Kelly-Lochbaum ladder digital filter
iir lat1(bcoeffs,acoeffs)
iir nl(bcoeffs,acoeffs)
normalized ladder digital filter
tf2np(b0,b1,b2,a1,a2)
biquad based on stabilized second-order normalized ladder filter
nlf2(f,r)
second-order normalized ladder digital filter special API
Block Diagrams
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 14 / 30
import("filter.lib"); bcoeffs = (1,2,3); acoeffs = (0.1,0.2); process = impulse <: iir(bcoeffs,acoeffs), iir_lat2(bcoeffs,acoeffs), iir_kl(bcoeffs,acoeffs), iir_lat1(bcoeffs,acoeffs) :> _;
Audio Filter Banks (filter.lib)
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 15 / 30
= Power-Complementary Band-Division
(e.g., for Spectral Display) See FAUST example spectral level.dsp
= Allpass-Complementary Band-Division
(Bands Summable Without Notch Formation) See FAUST example graphic eq.dsp
cascade with delay equalizers that convert the (power-complementary) analyzer to an (allpass-complementary) filter bank
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 16 / 30
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 17 / 30
Reference implementations of elementary signal generators:
Sinusoid Generators in oscillator.lib
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 18 / 30
“biquad” two-pole filter section (impulse response)
2D vector rotation (second-order normalized ladder) provides sine and cosine outputs
sine output of oscr
cosine output of oscr
state variable osc., cosine output (modified coupled form resonator)
digital waveguide oscillator
sine output of oscw
cosine output of oscw
Block Diagrams
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 19 / 30
Inspect the following test program:
import("oscillator.lib"); freq = 100; process = oscb(freq),
Sinusoidal Oscillator oscb
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 20 / 30
Sinusoidal Oscillator oscr
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 21 / 30
(coefficients are roundings of s = sin(2*PI*freq/SR) and c = cos(2*PI*freq/SR), so s2 + c2 = 1)
Sinusoidal Oscillator oscs
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 22 / 30
frequencies (exact at dc)
vary slightly with frequency, and exact phase-quadrature
Sinusoidal Oscillator oscw
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 23 / 30
dynamic range)
dynamic range can be accommodated (e.g., in VLSI)
Virtual Analog Waveforms in oscillator.lib
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 24 / 30
imptrain(freq)
periodic impulse train
squarewave(freq)
zero-mean square wave
sawtooth(freq)
alias-suppressed sawtooth
sawN(N,freq)
Waveform” (DPW) method for aliasing suppression
Increase N to reduce aliasing further
(sounds quite good already!)
filterings of bandlimited sawtooth
FAUST Source for sawN
Julius Smith LAC-12 – 25 / 30
sawN(N,freq) = saw1 : poly(N) : D(N-1) : gate(N-1) with { p0n = float(ml.SR)/float(freq); // period in samples lfsawpos = (_,1:fmod) ~ +(1.0/p0n); // sawtooth in [0,1) saw1 = 2*lfsawpos - 1; // zero-mean, amplitude +/- 1 poly(1,x) = x; poly(2,x) = x*x; poly(3,x) = x*x*x - x; ... diff1(x) = (x - x’)/(2.0/p0n); diff(N) = seq(n,N,diff1); // N diff1s in series D(0) = _; D(1) = diff1/2.0; D(2) = diff(2)/6.0; ... gate(N) = *(1@(N)); // blanks startup glitch };
Sawtooth Examples
Julius Smith LAC-12 – 26 / 30
FAUST Examples Using Bandlimited Sawtooth saw2 (saw2(freq) = saw1(freq) <: * <: -(mem) : *(0.25’*SR/freq);)
Pink Noise
Julius Smith LAC-12 – 27 / 30
more uniform than white noise
(approximately) as white noise through a three-pole, three-zero IIR filter that approximates a 1/f power response:
pink_noise = noise : iir((0.049922035, -0.095993537, 0.050612699, -0.004408786), (-2.494956002, 2.017265875, -0.522189400));
three poles and zeros to a minimum-phase 1/√f amplitude response
Conclusion
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 28 / 30
Conclusion
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 29 / 30
summarized
music/audio signal processing
Acknowledgments
Overview
effect.lib filter.lib
Conclusion
Julius Smith LAC-12 – 30 / 30
Special thanks to
matching
af for contributing the pattern-matching facility to FAUST