What's the most basic implementation of resonant lowpass filter?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

i anticipate that "what you really want" is a used copy of one of several books that seem to work for people.

i'm in a similar boat, never bothered with filter design, costs money for books and good open source. however,

check with smashed transistors posts on complex oscillators ;)

either the complex oscillator, or the quadrature oscillator - "same thing" but the gimpy efficient version i am fond of -
s0 -= f * s1;
s1 += f * s0;

(people say it's "not quite circular" but it outputs a perfect sine and circle if you take the half step)

...both of these can be turned into filters instead of oscillators if you modify them (see smashed transistors notes) by: adding an input, and adding some kind of gain coefficient.

because they have two states, they are resonant filters, but bandpass.

because they use w (2*pi*f/fs) or "angular frequency" they're easy for a beginner to wrap their head around.

not only is this perfect lovely bit of dsp ("ginsu dsp, it filters, it oscillates") a nice way to start thinking about filters, the difference between my efficient form and the slightly less efficient complex oscillator (same thing as 2d geometric matrix rotation) is an expression of zero delay filter versus non-zero delay filter ;)


of course, when i say "ginsu dsp" around here, people act like i am rude and don't know anything. one day they'll apologise and be really sorry when i am dead and send a nice card i know it.
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.

Post

what is "ginsu dsp"?

can you explain how "w (2*pi*f/fs)" fits in to "s0 -= f * s1; s1 += f * s0;"

f = 1000hz
pi = 3.14...
fs = samplerate
w = ?

Where is smashed transistor's post? here?: http://forum.cockos.com/showthread.php?t=143816

Post

Architeuthis wrote:what is "ginsu dip"?
https://youtu.be/6wzULnlHr8w
can you explain how "w (2*pi*f/fs)" fits in to "s0 -= f * s1; s1 += f * s0;"

f = 1000hz
pi = 3.14...
fs = samplerate
w = ?
He's talking about this, basically—in my case, I start with the filter and show that if you get rid of inputs, etc., you end up with a quadrature oscillator, in his case he's going the other way:

http://www.earlevel.com/main/2003/03/02 ... le-filter/
My audio DSP blog: earlevel.com

Post

K got it. But that's not the kind of oscillator I was talking about. If you could create a filter using an oscillator you could arbitrarily set the phase, frequency, amplitude, and shape for different effects.

Maybe what I am really getting at is not a filter per se but a resonator, something that is good at resonating more than it is at filtering.

Just wondering if anyone has detailed a formula like this. Wouldn't a triangle wave make for a super cheap resonator? (Or a cheap sinewave approximation formula to avoid possible aliasing)

Post

Just wondering if anyone has detailed a formula like this. Wouldn't a triangle wave make for a super cheap resonator?
Am I the only one here thinks this question is actually asking what is a resonator? https://en.wikipedia.org/wiki/Resonance

If something oscillates by itself then it is called an oscillator not a resonator. A filter that is completely out of control and not observing its input anymore can be called an oscillator, obviously, and for that state yes a triange wave or a sine wave oscillator would be a close approximation in sound, but, a resonator is something else, by definition. While that would be obvious to any electrical engineer, when these things end up being instruments at the hands of musicians, confusion naturally arises. It's OK, I guess:-)
~stratum~

Post

Sorry, maybe I went a bit off topic mentioning resonators.

But look at the question I am proposing. I give you an oscillator (or two) where you can arbitrarily control phase,amplitude,frequency,shape AND I give you a sawtooth wave for an input. Now make a filter. Has anyone detailed the formula for that? To make it more specific, let's say the shape of the oscillator is triangle.

Edit: Some more specifics: These oscillators never stop oscillating. They are always running / their phase counter is increasing based on the frequency. Now, at 0hz you no longer have oscillation of course. Nothing is stopping you from using the sawtooth to modulate the parameters though. So you could start your oscillator at 0hz and send the sawtooth to the frequency mod. Of course that's just FM. You can modulate any parameter with anything (only using the oscillators I've given you)... you can set the parameters with DC (i.e. each parameter has a "knob" you can turn).

Edit: It's ok if the resulting resonance shape looks skewed or non-sinusoidal, the point is that it responds/behaves like a filter... I mean, if you overdrive a resonant analog filter you no longer have a perfect sine but it still exhibits properties of a filter.
Last edited by Architeuthis on Tue Jan 24, 2017 5:15 pm, edited 1 time in total.

Post

Perhaps getting back to physical reality could help.

The things called oscillators have no input connectors the way you imagine. Just have a look at one it if it makes sense : http://www.allaboutcircuits.com/textboo ... scillator/

There is no place to connect an input. You can nevertheless connect a wire somewhere and feed a saw signal there. If in the end the circuit does not start making funny smelling smokes, something can happen. Not that anybody would be interested in that, but hacking is always possible, and in the end it may even be a filter, who knows.
~stratum~

Post

The input is [edit: modulation inputs] phase/amplitude/frequency/shape. ;)

Post

OK, now it makes sense, but in the end of the day we still call it an oscillator, don't we?
~stratum~

Post

Stratum, there seems to be a confusion between implementation and usage.

An oscillator for the definition of this thread is something that is implemented with phase/frequency/amplitude/shape as inputs.

A filter for the definition of this thread is something that is implemented with frequency/resonance/audio as inputs.

You can use a filter as an oscillator. Can you use an oscillator as a filter as I have defined it?

I started this thread to ask the question, because I think I have the solution, and wondering if I'm first to come up with something like this. Also, I don't know much about digital filters.

Post

You can use a filter as an oscillator.
This makes sense
Can you use an oscillator as a filter as I have defined it?
This one doesn't. The answer is in what you have just typed, an oscillator lacks an audio input.
~stratum~

Post

:(

Then what if you were to think of a filter in terms of my definition of an oscillator? Then you could say the filter has no audio input AND/OR the audio input is really just a modulation input.

What does the audio input of a filter modulate?

Is that a fair question or am I just stupid? It's ok, I'm stupid most of the time. :tu:

Edit: To not make this totally stupid, let me say this: I think if you use the oscillator modulation inputs in a certain combination you effectively get an audio input.

Post

So you have just typed why, read it:
An oscillator for the definition of this thread is something that is implemented with phase/frequency/amplitude/shape as inputs.

A filter for the definition of this thread is something that is implemented with frequency/resonance/audio as inputs.
It is your definition which says an oscillator isn't a filter.
An audio input isn't a modulation input, it's a signal to be processed, that's why it makes that much difference, according to your own definition.
~stratum~

Post

(make sure you got my edited bit in the last post)
I'm glad to see you're not throwing out my definition in this back-and-forth. Yes. An audio input is a signal to be processed. But this goes back to implementation vs usage.

Ok picture this scenario:

I ask you for one of your eurorack oscillator modules.

I then proceed to f*** up the panel, destroy the knobs/pots/input jacks, leave just a knob for frequency and re-label one inputs as "send audio here!" (well... I also need a VCA for resonance control in this scenario), I hand you back this seriously messed up module (you are really upset now btw), you plug it in, and... wow! It's great as a filter! So now you are not upset anymore. :party: (Edit: Oh, and the audio output would be sin or tri)

...then you can say that somehow I turned some modulation inputs into an audio input... or that the modulation input behaves like an audio input and the oscillator behaves like a filter.

Edit: The advantage is that with an oscillator you know the phase/amplitude/frequency/shape at all times, well not that it has any relevance, those readouts/values ultimately may be meaningless, but they are still modulatable in this scenario... I mean... imagine a filter with a phase input. What would it do? I don't know.
Last edited by Architeuthis on Tue Jan 24, 2017 10:15 pm, edited 2 times in total.

Post

If you say so, why not. This thread now looks like a mess, perhaps you should start a new thread with a clearer description. I'm not upset.

Cheers,
~stratum~

Post Reply

Return to “DSP and Plugin Development”