[sdiy] Vocoder dabblings
Richie Burnett
rburnett at richieburnett.co.uk
Tue Oct 23 21:22:45 CEST 2012
Hi Tom and Noah,
Thanks for your comments!
> It's indisputably "vocodery", which is what you're after. I suppose having
> got it working and the structure of it sorted out, the question would then
> turn to "how does it sound?" and that's where the art takes over...
When I got it working I thought it sounded less robotic and more lifelike
than I expected. In fact, I declined to post an MP3 of me "singing" into it
because the output didn't sound anywhere near transformed enough! Maybe
that's down to the choice of carrier waves in the examples, or the number of
filter bands and their relatively high order. It's intereseting what you
said about distortion too. There's certainly the potential for a lot of
intermodulation distortion in a vocoder as audio-frequency ripple left in
poorly filtered envelope-follower outputs ring-modulates the filtered
carriers passing through each band's "VCA".
> So each filter is two SVFs in series, right?
Each analysis filter consists of four 2nd-order SVF band-passes in cascade.
This gives an 8th-order overall bandpass response. I designed the filters
as "Butterworth squared" or Linkwitz Riley filters, so all of the filter
bank outputs theoretically add to a flat frequency response. So, for each
vocoder band I first designed a 4-pole Butterworth bandpass in MATLAB, broke
this down into two 2nd-order sections, and then pass the audio through each
section twice so that the response is -6dB at the cutoff points instead of
the Butterworth's usual -3dB, and twice as steep in the transition bands.
The synthesis filters are exact copies of the analysis filters - Same
software routines but with different audio inputs and internal state
variables.
> Are these typical 'Chamberlin' SVFs or did you do anything clever to them?
Yes, they are basic Chamberlin SVFs except for a few minor tweaks. The f
and q coefficients for the SVF are calculated from MATLAB's output of
standard Direct Form-1 IIR denominator coefficients. This ensures that the
poles of the resulting Chamberlin filters are precisely where we want them,
rather than the approximate positions achieved by simply shoving frequency
and 1/Q values into the SVF's f and q parameters respectively. The
resulting f and q coefficients are also wrapped up into an "fq" coefficient
as a programming optimisation to speed up the SVF calculation since there's
lots of filters to chew through and their parameters are all static.
Finally a zero is added to the SVF's bandpass responses because the MATLAB
application that generates the Butterworth filter coefficients assumes a
zero at Nyquist frequency when it designs the 2nd order sections, but the
Chamberlin's LP and BP outputs don't naturally posess them!
> The Chamberlin SVF is only supposed to be stable to 1/6th of the sample
> rate,
> so I'm guessing you used an alternative algorithm to avoid the need to
> oversample the filters.
There's no oversampling because the SVFs are operating at quite high-Q.
It's counter-intuitive but the SVF is well behaved when operated at high-Q
(little-q approaches zero) and apt to go unstable at the other end of the
scale where it is highly damped and little-q approaches 2. The 1/6 Fs
figure is for guaranteed stability with all q from 0 to 2. The Chamberlin
SVF is ideally suited to applications like this where highly resonant
sections are required because it is more robust against quantisation errors
than Direct Form-1 IIR filters on a lowly 16-bit DSP. (The multiple peaky
BP filters that are cascaded here to get one wider flat-topped analysis
filter have a Q of about 6, but the MATLAB works all that stuff out. That's
just the Q-factor they come out with, but its well within the stable area of
the Chamberlin right up to the Nyquist frequency with no oversampling
needed.)
> I'm not up to date on digital filtering, so I'd be interested to hear your
> thought process when working out what filter design to choose for this
> application.
I'm guessing the above description is probably already more than you wanted
to know!?!? The equation for calculating the SVF's precise f and q values,
and the combining of them into a new fq coefficient is explained in a DAFX
paper called "The Modified Chamberlin and Zolzer filter structures" by Duane
Wise. In summary, I got MATLAB to design me a whole bunch of Butterworth
IIR filters with Direct Form-1 coefficients, then worked out what values of
f & q would make a SVF have the same transfer function because the digital
SVF has better numerical properties than DF-1 implementation for this
application.
Also check out the reply to Eric as this explains how 14 of the vocoder
bands run at 1/4 sample rate.
> I'm also curious to see just how you implemented the multiplies in the
> SVFs - any fraction-saving, dithering or straight up truncation, etc?
The multiplies are done in single precision (can get away with this because
of the decimation/interpolation for the lower bands,) but the accumulators
are held in 32-bit registers for the duration of each processing block which
really helps. (This is equivalent to fraction saving because the low 16-bit
"fractional" parts of the 16x16 multiply results "accumulate" in the 32-bit
accumulators but aren't fed back into the multiplier.) For the lowest 4
bands the SVF's full 32-bit accumulator states are chucked into memory at
the end of each block, and then popped again when it's time to process that
filter some more. For the other bands I just round the accumulators to
16-bit and stash that until required for the next block.
-Richie,
More information about the Synth-diy
mailing list