Synth with faux filter as opposed to 1-sample delay filter

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I'm still a noob and I created similar threads a while ago. The concept I am presenting is probably nothing new but I wanted to discuss this concept in a different way.

There is the concept of zero-delay filters. I don't know how it works, but I read that u-he Diva uses a prediction method to calculate the next sample value. The concept of real-time goes even further. A real-time synth would not need prediction because everything is known and calculated on the fly based on all the internal settings.

A very basic concept of a real-time synth/filter: Use a waveshaper to soft-clip a sine wave so that it gradually becomes square-ish. That will sound like a lowpass filter slowly opening. Add a second oscillator to act as the resonator to create the illusion of resonance. Have the second oscillator reset its phase every cycle of the first oscillator, basically, hard-sync.

Hard-Sync + Waveshaper = Faux filter

There are endless ways to change how the sync works (various soft-sync methods, different oscillator shapes, thresholds, micro-envelopes) and how the waveshaping works (various shaping formulas, compression curves) to create any number of timbres/behaviors that could mimic various analog filters. With this, one is able to create emergent chaos in real time, which analog filters are so famous for.

I believe there is a logical fallacy in the 1-sample-delay concept. Imagine a spring attached to a weight. Spring tension and weight result in a mechanical oscillator. There is no delay in this system. Analog filters were originally invented to mimic physical concepts like this. Just like a spring and weight, there is no delay with electricity (assuming the planck length / the speed of causality / speed of light is not to be conceptualized as "delay" in the DSP sense).

Is it possible that the 1-sample-delay concept was just one of many concepts that caught on in the world of audio/music/digital synth design? Is it possible that this concept it the worst possible concept, and that there are better concepts waiting to be popularized? Is it possible that we have exhausted the 1-sample-delay concept to death and still have failed to move away from it?

Post

Your premise is wrong. Analog systems do have delay.

First, don't think of it as delay. Think of it as memory. Analog filters work using capacitors and inductors charging and discharging stored energy in electric/magnetic fields. The energy storage is a memory effect, and the time it takes to charge/discharge is a delay. You can't have filtering without a memory effect.

In computers, the difference is that there is a limit to the memory we can use (note I'm not talking about the number of bits). It's one sample of your signal. In analog, the smallest unit of delay is infinitely small, which results in our filters being built rather than from unit delays, but integrators and differentiators. In ZDF filters, what you do is replace the integrators and differentiators in the analog system with discrete integrators and differentiators using unit delays. However, this results in a zero-delay feedback loop, which means the computer needs to know the output in order to compute the output. This is impossible because computers can't know the future, so you use a variety of means to try and resolve the loop. By no means do these filters get rid of delay entirely.

Now an interesting thing you're onto here is the power of waveshaping and non-linear processing. That's a memory-less effect, the next state depends only on the current state. Now if you limit yourself to talking about synthesizers, there's some cool stuff you can do to "filter without using filters."

Consider a saw-wave wavetable oscillator. Reading through the wavetable at a constant rate creates a saw wave. What if you sped up and slowed down how you read through the table? You could create a sine wave output from a saw wave table... interpolating between the constant read speed and the sped up/down speeds would give you points in between a saw wave and a sine wave, or a low pass filtered saw! This is called phase-distortion synthesis and here's a cool paper on it

http://www.willpirkle.com/Downloads/App ... thesis.pdf

Another thing you can do is directly distort the saw wave using a waveshaping function. The issue is to get "filtering" effects for any given waveform, the waveshaping function will be different depending on the waveform. To figure out the function, you also need to know the initial waveform as well as its filtered version at the get go. So it's cool from an academic perspective, but you still need to know both the input and output and all their states, so you need memory and a filter to get there.

Post

Thanks for not ripping my noob-logic apart! Your response was educational.

Let's get into some specifics. The only problem I have with "memory-based" filters is the resonance characteristic, which ZDF filters attempt to improve upon. The advantage of a memory-less effect is that you get to control every nuance very easily. With memory-based filters I have read there are never-ending problems with tuning/pitch, amplitude, and overall stability of resonance. By using another oscillator to act as faux resonance you never run into these problems. You have full control over timbre and behavior.

What about a hybrid of memory-less and memory-based filter where once uses standard delay techniques to create a lowpass/highpass/whatever, and use an oscillator to create faux resonance? Are there any real-world examples of this technique (such as a VST)? This may actually remove the need for the waveshaper. Well, we still need a waveshaper applied to "resonance" oscillator to create the wide variety of resonance timbres and characteristics that are found in analog filters.

Going a little off topic I have achieved awesome acoustic-like sounds with analog and digital filters by having the filter/resonance stay in tune with the input signal, making use of filter overdriving/feedback and the resultant chaos. This is one of many reasons why resonance needs to be "perfect". I don't know if a memory-less effect can do the same, that is yet to be discovered.

Post

I'm not sure about filtering in general, but for filters based on feedback, such as ZDF filters (as I understand it, this means IIR filters), there is an inherent need for a delay. My understanding is that anytime you want to introduce feedback you necessarily have to introduce a delay, for both continuous and discrete systems. It seems like if the feedback were instantaneous, you'd have a system whose output would instantaneously become either infinite or zero.

Post

Holy_City wrote:This is impossible because computers can't know the future, so you use a variety of means to try and resolve the loop. By no means do these filters get rid of delay entirely.
You have to distinguish between two different things. There's memory that's required to integrate the "virtual current" that flows during the time between two sample instances. The calculation of this requires delays, and this is an entirely undisputed fact.

However, computing an output with the function of the output itself is possible - even though some boffins and self acclaimed specialists seem to be in complete denial of that. An equation which has the left hand side as a portion on the right hand side is called implicit. A simple example:

y = g * (x-y) + s

This is a linear example of an implicit equation because y is claculated by y itself. But because it's linear, it can be solved easily:

y = (g*x+s)/(g+1)

There you go. This is the correct calculation of y by a function of itself, and no memory, delay whatsoever was involved.

However, a completely different matter is a non-linear equation like this, which is typical for analogue filter models:

y = g* ( tanh(x) - tanh(y) ) + s

In this case we can not just rearrange the equation to get y onto the left hand side without any y on the right hand side. However, there is a plethora of mathematical solution for this which approximate the correct result to any accuracy of our choice. A popular one is using iterative root finding methods (bisection, Newton-Raphson, Wkipedia is your friend):

Instead of above equation we write
r = g* ( tanh(x) - tanh(yEst) ) + s - yEst

What we do is, we "estimate" what y would be and call it yEst. Then we calculate the equation and get r, which is called "residue" or the error of our estimate. Once we have the residue, we can improve our estimate using the standard root finding methods as described on Wikipedia, or maybe what the younger ones remember form high school. We do so as often as it takes to minimize the residue until we reach the accuracy we want, usually below a millionth of our normal amplitude.

This is just one method, but there are numerous others that can be driven to various degrees of accuracy, such as the tangential method. What all these methods have in common is, they are fit to remove any necessity for an artificially added unit delay in the simulation of an analogue filter's (or OpAmps whatsoever) negative feedback path ("Negative Gegenkopplung" as I'd call it in German).

Therefore, software does not need to predict the future. It just needs to focus into the present. Again, it's not about miraculously integrating time steps without a memory component. It's about solving implicit equations, i.e. such that need to calcuate the output by a function of the output. And this is a fully understood mathematical discipline since like forever 8)

- U

Post

Ok Urs, going more specific.

With all that mathemagical stuff you are explaining above, can you create a filter with arbitrary overdrive/resonance/feedback characteristics? How difficult would it be to, for example, create a filter that, when overdriven + feedback, creates these resonance shapes:

Image
disclaimer: all drawn by hand in ms-paint, excuse the inaccuracy!

This is the reason I would want to use a separate oscillator + waveshaper for the resonance.

Post

Architeuthis wrote:Ok Urs, going more specific.

With all that mathemagical stuff you are explaining above, can you create a filter with arbitrary overdrive/resonance/feedback characteristics? How difficult would it be to, for example, create a filter that, when overdriven + feedback, creates these resonance shapes:

Image
disclaimer: all drawn by hand in ms-paint, excuse the inaccuracy!

This is the reason I would want to use a separate oscillator + waveshaper for the resonance.
I have only replied to the false assumption that removing the unit delay to solve a function by its own output is impossible. I'm not sure how the unit delay relates to the shape of resonance.

Your faux filter concept reminds me a lot of the way resonance is faked in Phase Distortion synthesis. But that may not be entirely what you wish like to achieve. You might not need that though...

I've fired up Bazille and tried some things: You can create some variation in the waveshape of a self-oscillating filter by modulating its cutoff, its resonance or its resonance path by its own output. Skewed Sine on a 4-pole ladder is Cutoff modulated by 12dB lowpass, assymetrcial sine is Cutoff modulated by 6dB out. Rounded one is Cutoff modulated by rectified (absolute) 24dB out. Your squarish kind of sine output looks a bit like that of a MS-20 filter, I don't know if and how to replicate that in Bazille.

(unfortunately I'm out of town, my internet is too slow to upload screenshots)

Post

Urs wrote:I've fired up Bazille and tried some things: You can create some variation in the waveshape of a self-oscillating filter by modulating its cutoff, its resonance or its resonance path by its own output. Skewed Sine on a 4-pole ladder is Cutoff modulated by 12dB lowpass, assymetrcial sine is Cutoff modulated by 6dB out. Rounded one is Cutoff modulated by rectified (absolute) 24dB out. Your squarish kind of sine output looks a bit like that of a MS-20 filter, I don't know if and how to replicate that in Bazille.
This is the noob in me speaking, but I get the impression (from experience and your description above) that ZDF filters are a very nice approximation of analog filter sound and behavior. ZDFs seem ideal, but are they more difficult to program than traditional digital filters?

Your description above is very "analog-modular." I've done all sorts of things like that on my analog synth to get different shapes/behaviors. Urs, have you explored negative vs positive feedback? Is that the correct term? I simply mean inverting the output before going back into the audio input or CV.

For example, if you feedback a motm-485 (output back into the input [invert before going back in]) the sound is a bit more pleasing, the harmonics sound more saw-like.

Post

Your faux filter concept reminds me a lot of the way resonance is faked in Phase Distortion synthesis.
As well as FM, PWM and so on (basically any "waveform shaping" oscillator).
I.e. "faux filter" idea definitely works, but it's somewhat orthogonal thing and can't replace the "conventional" filtering technique.
(Simply consider an "osc1 + osc2 + noise -> filter" voice (FF is impossible), or something like "pitch modulated multisaw osc -> filter" (FF is possible in theory but impractical due to amount of required computations)).

Post

Max M, I don't see any of those things as a problem. If you produce resonance with a differential equation (as in, create a faux resonance via reading how edgy the input is), you could apply that to any waveform. Now, this may be stepping into traditional digital filter land... Backing up for a moment, I think I might have written my initial post incorrectly. I wrote about using waveshaping to add/remove harmonics like a filter...

Ok forget all that, let me start over. Here's are more fleshed-out concept:

Use a traditional non-resonating digital filter to add/remove harmonics.
Use a differential equation to control the amplitude of an oscillator for faux resonance, we will call this the resonator.
Use hard/soft sync techniques for resetting phase of the resonator.
With little resonance, the resonator is pretty dampened (very short amplitude envelope)
As resonance (feedback) setting is increased, the resonator amplitude gets longer and the waveshaper begins to become saturated.
Increasing resonance further brings the resonator into self-oscillation.
Increasing resonance past self-oscillation saturates the waveshaper so that the resonance becomes very saw or square like (whichever shaper we are employing at the time).

Image
"Threeler" analog filter (loosely based on MS-20)

Essentially, I am describing what is going on here. I've studied every tiny detail of this gif and I think I know exactly what is going on behind the scenes, I feel that I would be able to recreate this with simple DSP.
Last edited by Architeuthis on Thu Feb 04, 2016 8:39 pm, edited 1 time in total.

Post

Architeuthis wrote:This is the noob in me speaking, but I get the impression (from experience and your description above) that ZDF filters are a very nice approximation of analog filter sound and behavior. ZDFs seem ideal, but are they more difficult to program than traditional digital filters?
After six yeras of doing this, I find it very easy to program them. The problem is however not the programming aspect, but the CPU. A close emulation needs 3-10 times the CPU of a filter with unit delays embedded.
Your description above is very "analog-modular." I've done all sorts of things like that on my analog synth to get different shapes/behaviors. Urs, have you explored negative vs positive feedback? Is that the correct term? I simply mean inverting the output before going back into the audio input or CV.

For example, if you feedback a motm-485 (output back into the input [invert before going back in]) the sound is a bit more pleasing, the harmonics sound more saw-like.
Sure, we've done positive feedback in Diva. But for traditional filter response in ladder filters one usually needs negative feedback.

Post

Architeuthis wrote:Use hard/soft sync techniques for resetting phase of the resonator.
With hard/soft sync it's no longer going to be a filter like resonator, but indeed more like a "two osc Phase Distortion block" or so (not exactly equal in details but still very close). Now, taking into count the aliasing/intermodulation you'll have to fight, this won't be very reasonable, if this thing is to be used only to replace/emulate the resonator of a filter. Because nowdays the resonating filters (those TPT SVF mentioned above) are really cheap.

But if we forget about any post-filtering (with or without resonance) and treat this only as another "Nonlinear Abstract Sound Synthesis Algorithm", it makes perfect sense of course.

Post

I need to take another back step, I'm now just remembering things I realized months ago... Rather than using an edge or phase detector for resetting the phase, one would use an even simpler technique: amplitude. Well, an edge detector/differential equation will be used to know how much to excite the resonator. If the resonator has no amplitude upon being excited, the resonator will begin at 0 phase (thereby "resetting" the phase). If the resonator does have amplitude then the resonation is not reset, the resonator simply gets an amplitude boost/ping.

Once you get into self-oscillation, the resonator never has 0 amplitude and therefore never resets phase EXCEPT that now the resonator gets clipped out to silence (if the input is loud enough).

Not sure if this changes anything about your reply, maybe it doesn't.

Post

Max M. wrote:Now, taking into count the aliasing/intermodulation you'll have to fight, this won't be very reasonable, if this thing is to be used only to replace/emulate the resonator of a filter. Because nowdays the resonating filters (those TPT SVF mentioned above) are really cheap.
yes, hard-syncing a sinusoidal oscillator to some master oscillator could be hard to anti-alias. a popular and mathematically elegant way to anti-alias hard-sync is based on bandlimited steps ("BLEPs"). if i'm not mistaken, this technique in its basic form is applicable only to waveforms which have discontinuities (steps) in the waveform itself AND a constant derivative (like saw- and square-waves), but as soon as you have a non-constant derivative (like in a triangle-wave, which has steps in the derivative), you need to add a bandlimited version of the discontinuous derivative as well - and so on. a sinusoid has an infinite number of non-constant derivatives, so it's very hard to hard-sync with anti-aliasing using the blep-technique (take all of this with a grain of salt - it's a while ago, when i was learning about this stuff). ...however, there might be another way to achieve a similar result: feed a bandlimited impulse-train into a filter that has a decaying sinusoid as its impulse response - the impulses would "retrigger" the filter's decaying sinusoid impulse response and thereby do the desired synchronization as well as imposing a ("micro")-envelope to the sine.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Urs wrote:I don't know if and how to replicate that in Bazille.
It's basically a highpass square wave (I'm guessing you knew this already), it is based on MS-20. The square was originally a sine that is now being overdriven/clipped due to the internal voltage limits, and then it's getting high-passed maybe because internally the feedback loop goes through a DC filter or maybe it's simply due to the filter being a highpass filter. Lastly, if the input is, say, a saw wave, there will be some PWM effect to this square because the sine is getting clipped more at the top than at the bottom at the beginning of the input oscillator's phase, and then it is getting clipped more from the bottom near the end.

This description is an example of how I want to think about filters, it's all simple behavior/mechanics. I'd like to create a synth where you have a large set of fundamental and novel parameters for the filter so you can create any behavior you want, mimic any analog filter. There could also be a "filter preset list" so you can load up a classic filter or something not-so-classic.

Post Reply

Return to “DSP and Plugin Development”