Filters to Nyquist?
- KVRAF
- 12615 posts since 7 Dec, 2004
which is one of the methods used in spice, but ultimately unnecessary for the majority of musical uses.
that's of course arguable, but i haven't heard a filter implementation which "sounds better" than the simpler ones when done correctly. "better sound" comes from more specific timbre shaping techniques in my opinion.
that's of course arguable, but i haven't heard a filter implementation which "sounds better" than the simpler ones when done correctly. "better sound" comes from more specific timbre shaping techniques in my opinion.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
- Banned
- 12367 posts since 30 Apr, 2002 from i might peeramid
why these people haven't simply indicated the ubiquitous robert bristow-johnson biquad paper to you yet i'll never know.
i appreciate that capitalism is a bunch of bloodthirsty crap and people like to restrict the distribution of knowledge so we're not flooded with "me too" products, but the synergetic effect of having more people with knowledge catalysing a new paradigm is worth much more to all of us than the temporary benefits of being one of the elite with incoming capital. god knows one of these ignorant morons might turn out to supercede your own ingneuity and create a product that improves life dramatically in unforeseen ways. or is "someone else competing with my product line" all you can see, while you impress the audience with your extensive knowledge and ability to talk over their head?
or am i simply not rich enough to see things otherwise?
kvr - get me a shovel.
i appreciate that capitalism is a bunch of bloodthirsty crap and people like to restrict the distribution of knowledge so we're not flooded with "me too" products, but the synergetic effect of having more people with knowledge catalysing a new paradigm is worth much more to all of us than the temporary benefits of being one of the elite with incoming capital. god knows one of these ignorant morons might turn out to supercede your own ingneuity and create a product that improves life dramatically in unforeseen ways. or is "someone else competing with my product line" all you can see, while you impress the audience with your extensive knowledge and ability to talk over their head?
or am i simply not rich enough to see things otherwise?
kvr - get me a shovel.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
No worries, just wanted to point it out, since getting a constant response while sweeping is often a trickier problem than just keeping it from blowing up.guitarbro wrote:sorry i actually just started getting in deep with filters, and it does "blow up".mystran wrote:"Stable" has a well-defined meaning when it comes to filters, and it means the impulse response has bounded in amplitude, which translates to all the system poles being inside the unit circle on z-plane (with the usual convention of z^-1 to signify a unit delay).guitarbro wrote:Like i said stable meaning relatively constant response throughout.
edit: my point is, if you say "unstable" everyone is going to assume it blows up. If you mean "relatively constant response" say "relatively constant response"
- KVRAF
- 12615 posts since 7 Dec, 2004
possibly because the ...
variations of biquads are however some more types of filters that can go up to nyquist - although with extreme warping far worse than something like a chamberlin svf.
it's just another set of trade-offs, not nearly as ubiquitous as you might think.
for example i've never used such a filter - even once. they don't have any properties i'm interested in.
... may be entirely useless depending upon what you're trying to do.ubiquitous robert bristow-johnson biquad paper
variations of biquads are however some more types of filters that can go up to nyquist - although with extreme warping far worse than something like a chamberlin svf.
it's just another set of trade-offs, not nearly as ubiquitous as you might think.
for example i've never used such a filter - even once. they don't have any properties i'm interested in.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
If one does require the filter to behave nicely while sweeping (which one would generally expect if the discussion starts with SVFs and such) then direct form biquads are not ideal.xoxos wrote:why these people haven't simply indicated the ubiquitous robert bristow-johnson biquad paper to you yet i'll never know.
But yeah, for filters that don't need fast time-variation, "RBJ Audio EQ" is a good Google search term.
At this point (if it wasn't mentioned already) I'd like to raise a question: What purpose do we need a filter for? What properties must it have other than being able to have a cutoff at Nyquist?
- KVRAF
- 12615 posts since 7 Dec, 2004
here is a not so commonly known filter:
output = allpass(input + old_output * feedback, c);
allpass(input, coefficient) =
{
float temp = buffer - input * coefficient;
buffer = temp * coefficient + input;
return temp;
}
coefficient/feedback from -1 to +1.
output = allpass(input + old_output * feedback, c);
allpass(input, coefficient) =
{
float temp = buffer - input * coefficient;
buffer = temp * coefficient + input;
return temp;
}
coefficient/feedback from -1 to +1.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
- KVRist
- Topic Starter
- 358 posts since 4 Dec, 2009 from muskegon MI
aciddose wrote:actually a svf dosn't require 4x, it requires 2x with feedback compensation. actually to make it go fully to nyquist with zero feedback would require infinite time-slices unless i'm mistaken. that's the thing to note - it's stability depends upon how much feedback is applied. with 100% feedback it becomes stable at nyquist.
xhip's filters go to nyquist using this method.
3x and 4x decrease the feedback required at high frequencies, but at the cost of increased computation.
non-linearity doesn't require oversampling if implemented correctly and if dropped off at higher frequencies. audibly the results are the same, but without considerable aliasing that leaving the shaping at full magnitude would result in. (when i say "correctly", i mean in the svf at least the shaping is not applied to the signal at the input, making it dependent only upon filter feedback/frequency)
a good example is a model of a diode and capacitor in parallel in a RC.D circuit.
[A] [resistor] -> [C] [cap] + [D] [diode] -> [ground]
the RC circuit is a simple lossy integrator
B = (A - C) / resistor;
C += B;
the RD.C circuit is as follows:
B = inv_diode_function(A - C) / resistor;
C += B;
D = C;
inv_diode_function can be = max(0, n^2) for a very simple example. the actual inverse diode function would be required for accuracy.
i'll spell it out for you incase you're not catching on: to implement the non-linearity at the input of the OTA in a svf, we end up with the same circuit as outlined above. so to model that, apply the inverse diode function to the delta for input to the integrators in the svf.
considering ordinary unbiased OTAs, a very good approximation is inv_diode_function(n) = n * (0.9 + 0.1 * n*n)
I'm a bit slow mind giving an example in C++
- KVRAF
- 12615 posts since 7 Dec, 2004
that is c(++). 
it isn't c++, since it isn't object oriented. do you really want the c++ version?
integrator += diode(input - integrator);
where
integrator is a class which over-rides += operator, handles the fraction and buffer, overrides operator <class T> to return the value stored in the buffer.
i'm pretty sure you don't want the c++ version.
i'd also put that whole thing into a RCD object, then you could just go:
output = rcdobj(input);
using overloaded operator ().
untested, might work, might have a mistake in it.
all good now?
it isn't c++, since it isn't object oriented. do you really want the c++ version?
integrator += diode(input - integrator);
where
integrator is a class which over-rides += operator, handles the fraction and buffer, overrides operator <class T> to return the value stored in the buffer.
i'm pretty sure you don't want the c++ version.
i'd also put that whole thing into a RCD object, then you could just go:
output = rcdobj(input);
using overloaded operator ().
Code: Select all
template <class T>
class integrator
{
public:
integrator() { buffer = 0; coefficient = 1; }
~integrator() {}
const T &operator +=(const T &v) { return buffer += coefficient * v; }
operator const T &() const { return buffer; }
void setCoefficient(const T &v) { coefficient = v; }
private:
T buffer;
T coefficient;
};
template <class T>
class diode
{
public:
diode() {}
~diode() {}
const T &operator()(const T &v) { return v*(0.9+0.1*v*v); }
};
template <class T>
class RCD
{
public:
RCD() {}
~RCD() {}
const T &operator()(const T &v) { return intgr += d(v - intgr); }
operator const T &() const { return intgr; }
void setCoefficient(const T &v) { intgr.setCoefficient(v); }
private:
integrator<T> intgr;
diode<T> d;
};
all good now?
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
- u-he
- 30192 posts since 8 Aug, 2002 from Berlin
I just think the omnipresence of the RBJ filters (and Chamberlin SVF) is what suppresses a lot of good stuff to become common knowledge. One can still count the implementations of Antti's filter with his hands, and their implementation as multimode filter with three fingers.xoxos wrote:or am i simply not rich enough to see things otherwise?
Google "Antti Huovilainen Nonlinear digital implementation of the moog ladder filter" for near source-code understandable paper, and google "Oberheim Xpander Service Manual" for making it a multimode filter.
As for Vadim's technology, it *is* an eye opener too. I suggest searching for "Emanuel Landeholm Zero delay feedback using sample prediction" on music-dsp. The basic idea is that the delay of 1 sample can be eliminated mathematically with a twist:
Step 1: y(x) = a * x + b * y(x) + s;
Step 2: s += a * x + b * y(x);
As Step 1 can not be solved, we have to do a little 3rd grade math:
y(x) - b * y (x) = a * x + s;
y(x) * ( 1 - b ) = a * x + s;
y(x) = (1/(1 - b)) * (a * x + s); // This one can be solved!
e voilá - a filter with zero delay feedback, mathematically correct. Based on that you can create more complex filters with analogue-like phase response. I havn't done it myself yet but I think it's fairly do-able.
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
And there is a wonderful tuning scheme in Stilson's thesis which can be combined with the transistor-ladder non-linearities if you scale the gain of each stage by -3dB (to get self-osc gain back to 4 instead of 1) and works fine with the multi-mode stuff.Urs wrote:I just think the omnipresence of the RBJ filters (and Chamberlin SVF) is what suppresses a lot of good stuff to become common knowledge. One can still count the implementations of Antti's filter with his hands, and their implementation as multimode filter with three fingers.xoxos wrote:or am i simply not rich enough to see things otherwise?
Or http://www.kvraudio.com/forum/viewtopic.php?t=207647and google "Oberheim Xpander Service Manual" for making it a multimode filter.
That said, I'm personally getting a bit bored of the transistor ladders.
But isn't that obvious? It tends to fail miserably when you insert a nasty non-linearity into the scheme though.. which kinda limits it's usefulness.e voilá - a filter with zero delay feedback, mathematically correct. Based on that you can create more complex filters with analogue-like phase response. I havn't done it myself yet but I think it's fairly do-able.
-
- KVRAF
- 1607 posts since 12 Apr, 2002
It fails but not so miserably. With one nonlinearity you can obtain a perfect solution, with more than one you can still use the "cheap method" and obtain quite useable results. Aliasing is another story, but you may still get better responses even if oversampled.mystran wrote:But isn't that obvious? It tends to fail miserably when you insert a nasty non-linearity into the scheme though.. which kinda limits it's usefulness.e voilá - a filter with zero delay feedback, mathematically correct. Based on that you can create more complex filters with analogue-like phase response. I havn't done it myself yet but I think it's fairly do-able.
Regards,
{Z}
-
- Banned
- 12367 posts since 30 Apr, 2002 from i might peeramid
thanks for the link
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
-
- KVRAF
- 3388 posts since 29 May, 2001 from New York, NY
BTW, the Tarrabia filters mentionned by the original poster are mine (with a typo in my last name), but don't ask me anything clever about the maths behind them: I found them by pure chance while playing around with Butterworth coefficients. I like how they sound, and never got stability issues with them (although their output can get pretty hot with some cutoff/rez combinations).
- u-he
- 30192 posts since 8 Aug, 2002 from Berlin
Well, I have recently obtained 6 analogue synths that should technically sound very similar because all of their filter models would end up exactly like Antti's model. Ok, some use 4-OpAmps-On-A-Chip, some are discrete transistor circuits. Still, they all sound very, very different. There's still a lot of variety to be explored within the model.mystran wrote:That said, I'm personally getting a bit bored of the transistor ladders.
#--
Regarding the usefulness of the zero-delay feedback... one doesn't necessarily have to add "nasty" nonlinearities to all stages to obtain a good sounding filter, and one can save a whole lot of cpu if one can instead add a z-2 step somewhere. Maybe
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
Hehe, yeah, almost certainly. One thing often neglected is DC-blocking in feedback loops, which the classic designs had plenty (say Moog, or 303 which is kinda related). Seemingly subtle changes there can turn a filter from thin to clean to cruchy to a chaotic oscillator (if you add enough phase-shift to get low-freq oscillation, hehe). That's one example that doesn't even need consider any differences in the ladder proper.Urs wrote:Well, I have recently obtained 6 analogue synths that should technically sound very similar because all of their filter models would end up exactly like Antti's model. Ok, some use 4-OpAmps-On-A-Chip, some are discrete transistor circuits. Still, they all sound very, very different. There's still a lot of variety to be explored within the model.mystran wrote:That said, I'm personally getting a bit bored of the transistor ladders.
I think that depends on the sounds your after; and just wanted to point out that non-linearities present a problem, where as in the linear case it obviously works.. though in the linear case you could also get rid of the delay-free loops using discretization that doesn't introduce any to begin with. IIRC I had no trouble doing WDF discretization the trivial way (with the feedback path being the root and having the allowed single non-linearity) but that breaks down as well as soon as you want non-linear stuff in there.Regarding the usefulness of the zero-delay feedback... one doesn't necessarily have to add "nasty" nonlinearities to all stages to obtain a good sounding filter, and one can save a whole lot of cpu if one can instead add a z-2 step somewhere. Maybe![]()
edit: I remember having to do some magic with the buffers in the WDF version though; can't seem to find the code so not sure what it was that I did; it's a while I tried it
