Discussion:
[music-dsp] soundfont 2.01 low pass filter
Daniel Werner
2004-08-23 07:17:35 UTC
Permalink
Below is an excerpt from the SoundFont 2.01 Specification available at
http://www.soundfont.com/documents/sfspec21.pdf
It describes the low pass filter used to be 6dB/octave (one pole), but
the picture on the next page shows a 12dB/octave (two pole) filter. What
is the correct type? Also, does anyone have code to efficiently generate
coefficients for a resonant low pass filter of this type which can
specify the resonant gain at the cutoff frequency above the gain at 0Hz
in decibels? Are there any general techniques in digital filter design I
should use for calculating resonance?

- Daniel Werner
http://experimentalscene.com

--------------
"9.1.3 Low-pass Filter
The synthesis model contains a resonant low-pass filter, which is
characterized by a dynamic cutoff frequency and a fixed resonance (Q).
Because there is tremendous>variation within the industry as to filter
implementations, this filter is idealized rather than being specified as
a particular realization. The filter is idealized at zero resonance as
having a flat passband to the cutoff frequency, then a rolloff at 6dB
per octave above that frequency. The resonance, when non-zero, comprises
a peak at the cutoff frequency, superimposed on the above response. The
resonance is measured as a dB ratio of the resonant peak to the DC gain.
The DC gain at any resonance is half of the resonance value below the DC
gain at zero resonance; hence the peak height is half the resonance
value above DC gain at zero resonance.
All modulations in cutoff frequency are in octaves, semitones, and cents."
[ from SoundFont 2.01 Specification ]
--------------
adam
2004-08-23 07:42:08 UTC
Permalink
Post by Daniel Werner
Below is an excerpt from the SoundFont 2.01 Specification available at
http://www.soundfont.com/documents/sfspec21.pdf
It describes the low pass filter used to be 6dB/octave (one pole), but
the picture on the next page shows a 12dB/octave (two pole) filter.
What is the correct type?
6dB has got to be a mistake, since it's clear they are describing a
resonant 2nd order filter.

-Adam
Dave Gamble
2004-08-23 08:47:08 UTC
Permalink
Post by adam
Post by Daniel Werner
Below is an excerpt from the SoundFont 2.01 Specification available
at http://www.soundfont.com/documents/sfspec21.pdf
It describes the low pass filter used to be 6dB/octave (one pole),
but the picture on the next page shows a 12dB/octave (two pole)
filter. What is the correct type?
6dB has got to be a mistake, since it's clear they are describing a
resonant 2nd order filter.
I second Adam.

Also, I played with soundfonts once, and I remember the filter being
2nd order.

Dave.
Daniel Werner
2004-08-23 10:14:33 UTC
Permalink
Post by Dave Gamble
Post by adam
Post by Daniel Werner
Below is an excerpt from the SoundFont 2.01 Specification available
at http://www.soundfont.com/documents/sfspec21.pdf
It describes the low pass filter used to be 6dB/octave (one pole),
but the picture on the next page shows a 12dB/octave (two pole)
filter. What is the correct type?
6dB has got to be a mistake, since it's clear they are describing a
resonant 2nd order filter.
I second Adam.
Also, I played with soundfonts once, and I remember the filter being
2nd order.
Dave.
That's why I asked, 6fB seemed wrong, thanks for the answers guys.
Anyway, I have figured out how to calculate the coefficients for a
second order tweaked butterworth lowpass filter with resonance specified
in decibel scale. Basically it changes the two sqrt(2) values in the
traditional butterworth formula by multiplying it with the power ratio
of the sign inverted decibels of resonance. Here is the code:

c = 1.0f / (tanf(pi * (cutoff / samplerate)));
csq = c * c;
q = sqrt(2.0f) * powf(10.0f, -(resonancedB * 0.1f));
a0 = 1.0f / (1.0f + (q * c) + (csq));
a1 = 2.0f * a0;
a2 = a0;
b1 = (2.0f * a0) * (1.0f - csq);
b2 = a0 * (1.0f - (q * c) + csq);

- Daniel Werner
http://experimentalscene.com

Loading...