Re: [music-dsp] Linear Trap SVF Sin- generalized and simple analog appromation works well.

2014-06-29 Thread socialmedia
My general comment on this, and several discussions on KvR and similar 
discussion elsewhere, is this. First of all they accept the term State 
variable filter. And then apply advanced mathematics to solve it. And 
then realize a highly inefficient filter, usually with oversampling.


State variable filter, was a name for a particular way of doing a 12dB 
filter in the analog domain, AFAIK.


That can be done with extremely simple math.

in = in - (buf2 * res); Subtract output for negative feedback (resonance)
buf1 = buf1 + ((in - buf1) * cut); One pole (normalized positive feedback)
buf2 = buf2 + ((buf1 - buf2) * cut); Second pole (normalized positive 
feedback)


And then one can do clipping before the filter buffers, to get a good 
approximation of analog resonance behaviour, with the second clipper a 
bit lower. (Or it will do nothing).


Considering this is very fast, if one does similar simple math 
throughout the synth, one can simply use simple oscs aswell, and simply 
use oversampling, and get no problems with dcleaks. An additional 
analog feature, can be a low emphasis, after the osc section, to 
saturate the resonance, a bit more with the bass. And also have a 
clipper before. This happened in many analogs since the components were 
not linear. Which is better to emulate this way, as one gets perfect 
math, and perfect keytracking. And one can additionally add dcoffset at 
input, and highpass at output aswell. (And then take the negative 
feedback after the hp.)


And it sounds great, and I use such DSP myself, as a musician, and 
actually prefer it, over more complex overly theorized stuff, that 
simply sounds worse.


A little video from something I am working on, from time to time, using 
oversampled, as simple as possible, math, for efficiency. 
https://www.youtube.com/watch?v=2_wbhF2YDLs


As one can hear, it really does everything from the dull digital to 
the charateristic analog sounds, so indeed, the complexity in 
emulation is not needed. And makes a very graceful solution from a 
mathematical point of view.


Best Regards,
Ove Karlsen
producer, reseacher, engineer.
Monotheo
www.monotheo.biz

On 6/29/2014 08:44, Andrew Simper wrote:

In a recent KVR thread about sin oscillators I posted a method based
on a tan coefficient trapezoidal integrated SVF. Teemu Voipio
(mystran) pointed out a version that was calculated directly using
complex numbers and only used sin for the coefficients and a state +=
coeff * val type update, so near zero the coefficients are all near
zero, which gave this form better numerical properties.

Also guy called Adriano Mitre did some research into various fixed
point biquads with fixed point computation and has found the old
form I posted ages ago to be very good. I'll leave it to him to
publish exact details, but I wanted to give him the very best I could
offer:

So here it is using sin only for the coefficients:
http://www.cytomic.com/files/dsp/SvfLinearTrapezoidalSin.pdf

Which is linked from this page:
http://www.cytomic.com/technical-papers

These are all just numerical manipulations of the same basic nodal
equations / state space equations to try and squeeze a little more
precision out of things, so thanks to Teemu for the idea of using sin
only for the coefficient calculation.

Also at the bottom I have shown the (horrible) relation between
regular DF1 coefficients and the svf form. I recommend not using this
and instead derive the correct mix terms from analog prototypes, but
I did this to help out Adriano.

All the best,

Andrew Simper

-- cytomic -- sound music software --
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp


--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] Linear Trap SVF Sin- generalized and simple analog appromation works well.

2014-06-29 Thread Andrew Simper
On 29 June 2014 16:05, socialmedia soc...@monotheo.biz wrote:
 My general comment on this, and several discussions on KvR and similar
 discussion elsewhere, is this. First of all they accept the term State
 variable filter. And then apply advanced mathematics to solve it. And then
 realize a highly inefficient filter, usually with oversampling.

 State variable filter, was a name for a particular way of doing a 12dB
 filter in the analog domain, AFAIK.

No. An SVF is a very particular low noise analog structure that you
can do any generic biquad responses from, and with a trapezoidal SVF
you can generate the same responses as you can with a DF1 biquad, so
this is useful for exact parametric eq shapes, as well as scientific
grade notch filtering and a bunch of other applications where a very
accurate linear filter is desirable.


 That can be done with extremely simple math.

 in = in - (buf2 * res); Subtract output for negative feedback (resonance)
 buf1 = buf1 + ((in - buf1) * cut); One pole (normalized positive feedback)
 buf2 = buf2 + ((buf1 - buf2) * cut); Second pole (normalized positive
 feedback)

Here is forward euler type 4 pole cascade with negative feedback (I'm
writing out the z terms just to make it clearer what is going on):

v1z = v1
v2z = v2
v3z = v4
v4z = v4
v1 += cut * (in - v1z - res*v4z)
v2 += cut * (v1 - v2z)
v3 += cut * (v2 - v3z)
v4 += cut * (v3 - v4z)

Now you can cut this down by one section, but you get more passband
cut with increased reonsnace:

v1z = v1
v2z = v2
v3z = v4
v1 += cut * (in - v1z - res*v3z)
v2 += cut * (v1 - v2z)
v3 += cut * (v2 - v3z)

You can drop another section, but the results are terrible as you get
loads of passband cut with resonance:

v1z = v1
v2z = v2
v1 += cut * (in - v1z - res*v2z)
v2 += cut * (v1 - v2z)

This is what you have done, and I don't recommend it, there are much
better low cpu filter structures than this (if you are interested in
that sort of thing). They actually used a 3 pole version in the
Xpander, but mostly people use 4 pole since the passband cut is too
great otherwise.

It is possible to construct a very low cpu Sallen Key as well as SVF
which has perfect trapezoidal shapes without oversampling and you
can apply trivial non-linearities to. The paper I have presented has
very little to do with any of this, I'm trying to generating the
lowest possible noise filter structure that has exact amplitude and
phase as a continuos biquad response at DC, cutoff, and infinity
(infinity being mapped to nyquist for the digital filter).

Andy
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp