Re: [music-dsp] R: R: Trapezoidal integrated optimised SVF v2

2013-11-13 Thread STEFFAN DIEDRICHSEN

On 13.11.2013, at 12:54, Vadim Zavalishin 
 wrote:

> So, after we have modelled them all, we are not gonna need any further 
> modelling.

;-)

At that time,we should offer real-time spice to let our dear customers tinker 
with their virtual circuits. We’ll offer in-app purchases like “bumble bee 
paper wax caps” or “snake oil inductors”.

Steffan 
--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-13 Thread Vadim Zavalishin

On 13-Nov-13 11:56, Marco Lo Monaco wrote:

I personally don’t think that automatic systems (DK) will be the
panacea of nonlinear modeling (even if everybody here is dreaming of
a realtime spice). Very often only a human can see patterns in
circuits and find shortcuts to simplify things.


+1

Besides the shortcuts, only a human can judge the critical aspects of 
the analog model being discretized. Such as


- how precise should the component models be (e.g. if Ebers-Moll 
transistor model is sufficient or not), where in principle this question 
should be answered for each component separately


- whether the difference between parameter values of identically marked 
components is having any critical effect


- whether the effect caused by a certain element of the model (e.g. a 
nonlinearity) is musically insignificant (so that the element may be 
dropped)


- to which extent we can assume independence of different parts of the 
device (ignore the current leakage and other crosstalk)


and so on.

Perhaps, if in future we have computational powers several orders higher 
than the currently available ones, such automatic system would be more 
realistic, as we will be able to afford ridiculously precise and 
detailed analog component models as the basis of our discretization. But 
from my feeling it's still a long long way. And then, how important is 
being able to automatically convert from analog schematics to digital? I 
mean there has been some amount of brilliant engineering work to design 
those analog devices, but it's not happening much more. So, after we 
have modelled them all, we are not gonna need any further modelling.


OTOH, the lessons we learned from attempting to model those things (and 
you learn more, if you do this "by hand" rather than by some automated 
toolkit) should form an invaluable basis for the development of future 
software. We can design *new* filters, effects, etc, which all are gonna 
have "that analog sound". For that purpose of new designs (rather than 
modelling the old stuff), I believe the *continuous-time* block-diagram 
based approaches are more useful than the differential equations, as 
they are offering a more intuitive view of the signal processing (YMMV). 
The discrete-time block-diagrams are not that intuitive, in my opinion, 
but then again, you don't need to use them, if you implicitly understand 
the discretized version of the same analog block-diagram.


Regards,
Vadim

--
Vadim Zavalishin
Reaktor Application Architect
Native Instruments GmbH
+49-30-611035-0

www.native-instruments.com
--
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

[music-dsp] R: R: Trapezoidal integrated optimised SVF v2

2013-11-13 Thread Marco Lo Monaco
Andy, 
FYI besides the KMethod, DePoli/Borin/Sarti et alias always in the 1990s also 
formulated the W-method which was the dual of KMethod but using the wave 
digital filter theory by Fettweis.
AFAIK is not so easily used because of the increased complexity of 
nonlinearities adaptors involved (you have shear AND rotation transformations).
To me KMethod is much more attractive and it is the be biggest step forward in 
the last 2 decades to approaching non linear simulation, especially regarding 
it's robust formalism and elegant math in it.
Moreover using KCL/KVL is naturally  straightforward when dealing with analog 
schematics.
Using tables seems attractive but for MIMO systems (with order greater than 2) 
it is not feasible (memory and finding algorithms are an issue). Unfortunately  
if you have a timevarying element (i.e. a potentiometer) you have to invert a 
matrix (H), which is good only at control rate, not audio rate.
Pls note that when modeling a tone stack, the KMethod degenerates in the 
state-space classic approach, which is equivalent to yours (C=F=0).
I consider Yeh's work very good since the first time I read it years ago. I 
personally don’t think that automatic systems (DK) will be the panacea of 
nonlinear modeling (even if everybody here is dreaming of a realtime spice). 
Very often only a human can see patterns in circuits and find shortcuts to 
simplify things. Moreover there are so many other dicretization schemes to be 
investigated (multistep).
IMHO the very "big leap ahead" was the KMethod formalism/theory by 
Borin/DePoli, an extension of StateSpace one,  and I guess that in the future 
we will see more papers to come, even if I admit that lately the computer music 
group of University of Padova has been changing their research targets.

Regards,
Marco

-Messaggio originale-
Da: music-dsp-boun...@music.columbia.edu 
[mailto:music-dsp-boun...@music.columbia.edu] Per conto di Andrew Simper
Inviato: mercoledì 13 novembre 2013 07:12
A: A discussion list for music-related DSP
Oggetto: Re: [music-dsp] R: Trapezoidal integrated optimised SVF v2

On 10 November 2013 18:12, Dominique Würtz  wrote:
> Am Freitag, den 08.11.2013, 11:03 +0100 schrieb Marco Lo Monaco:
> I think a crucial point is that besides replicating steady state 
> response of your analog system, you also want to preserve the 
> time-varying behavior (modulating cutoff frequency) in digital domain.
> To achieve the latter, your digital system must use a state space 
> representation equivalent to the original circuit, or, how Vadim puts 
> it, "preserve the topology". By starting from an s-TF, however, all 
> this information is lost. This is in particular visible from the fact 
> that implementing different direct forms yields different modulation 
> behavior.

Yes, modulation behaviour is a very important point to me.


> BTW, in case you all aren't aware: a work probably relevant to this 
> discussion is the thesis of David Yeh found here:
>
> https://ccrma.stanford.edu/~dtyeh/papers/pubs.html
>
> When digging through it, in particular the so-called "DK method", you 
> will find many familiar concepts incorporated in a more systematic and 
> general way of discretizing circuits, including nonlinear ones. Can't 
> say how novel all this really is, still it's an interesting read anyway.
>
> Dominique

Thanks very much for this link! I have read most of these papers in isolation 
previously, but missed David Yeh's dissertation 
https://ccrma.stanford.edu/~dtyeh/papers/DavidYehThesissinglesided.pdf
which contains a great description of MNA and how it relates to the DK-method. 
I highly recommend everyone read it, thanks David!!

I really hope that an improved DK-method that handles multiple nonlinearities 
more elegantly that it currently does. A couple of things to note here, in 
general, this method uses multi-dimensional tables to pre-calculate the 
difficult implicit equations to solve the non-linearities, but as the number of 
non-linearities increases so does the size of your table as noted in 6.2.2:

"The dimension of the table lookup for the stored nonlinearity in K-method 
grows with the number of nonlinear devices in the circuit. A straightforward 
table lookup is thus impractical for circuits with more than two transistors or 
vacuum tubes. However, function approximation approaches such as neural 
networks or nonlinear regression may hold promise for efficiently providing 
means to implement these high-dimensional lookup functions."

Also note that also in section 2.2 some basic "tone stack" circuits are 
discussed, which contain 3 capacitors 2 pots and a resistor, which are trivial 
enough to solve using direct integration methods. Yeh notes that WDF can only 
handle serial or parallel connections of components, not arbitrary ones like in 
the tonestack, and says specifically (page 26):

"Passive filter circuits are typically suited to implementation as a wave 
digital filter (WDF) (Fettweis, 1986). 

Re: [music-dsp] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread Ross Bencina

On 11/11/2013 12:21 PM, robert bristow-johnson wrote:

but you cannot define your current output sample in terms of the
current output sample.

But that, with all due respect, is what has been done for quite a while.


it's been reported or *reputed* to be done for quite a while.

but when the smoke and dust clear, logic still prevails.


I presume Urs (hi Urs!) is talking about using implicit solvers. Which 
some people have been using for a while.


I guess it depends how you define "current output sample". Is it the 
trial output sample that you're refining, or the sample you actually output?


Seems logic could go either way.

Ross.
--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread Ross Bencina

Hi Ezra,

A few comments:

On 11/11/2013 3:19 PM, Ezra Buchla wrote:

there seems to be some concern about distortion introduced by the
trapezoidal integration. i've tried the algo in both fixed 32 ands
float, and it seems to sound and look ok to but i have not done a
proper analysis either numerically or physically. has anyone else?


All single-step digital integration procedures will necessarily diverge 
from the analog integration.


Here's a graph of the amplitude response of various integrators:

https://docs.google.com/document/d/1O_38tHxkMIrSScLXULuzJAmNxYj01PxEKw50hhY4kkU/edit?usp=sharing

Trapezoidal is "good" because it is stable but as you can see it has 
high-frequency roll-off compared to some others. As noted earlier 
Simpsons rule is not usable if you want your cutoff to go near Nyquist 
but is more "accurate" up to pi/4, which means that if you're using 2x 
oversampling.


Trapezoidal is equivalent to the warping introduced by BLT (bilnear 
transform) I believe. One way to think about it is that a lowpass filter 
in the analog domain has gain 0 at infinite frequency, and infinite 
frequency maps to Nyquist after BLT/Trapezoidal -- so you will get some 
warping.



theo vereslt seems to think the distortion would be unacceptable, and
so i tend to believe that in a really high-fidelity environment it
could be an issue.


The usual suggestion is to oversample by 2x. Many implementations do 
this and it has been discussed here many times over the years. It is 
possible to do other tricks to match the amplitude response at 1x but 
the phase response can get screwed up and you really want something 
close to analog for both amplitude and phase responses.


My take is that for synthesis it's all about your aesthetic -- if you 
want it to sound like an analog synth that's different from if you want 
it to sound "good". There's whole music genres based on commodore 64 SID 
chips or destorted noise.. so anything goes really.




additionally, he seems to imply (maybe? i'm not
sure) that not only is the optimization not worth it, but you can't
adequately suppress artifacts during coefficient change at all (which
i've always understood as the main raison for the digital SVF) without
analog components (referenced switched caps as variable R's, an
interesting trick), or more bandlimiting somewhere, or something.


I think the main point in the current discussion is that if you want to 
do *audio rate* modulation (think filter FM) then most "tricks" won't 
save you. You need a filter that can be modulated at audio rate and 
doesn't introduce spurious artifacts. Of course audio-rate FM will 
alias, but that's a separate issue that can be addressed by oversampling 
etc.



the KeepTopology paper by vadim zavalishin (http://t.co/SVJp7iAgqb)
proposes modelling the SVF with digital integrators. it seems like
these would follow the behaviors of the caps pretty closely and be
amenable to parameter change at the cost of some expense of course...'


All filters use digital integrators. There's just a lot of different 
types of integrators.




wouldn't that satisfy the purists? this last exchange seems to
indicate not... but i'm not sure why. again i should just try this
myself but it's a bit more work! ha.


I can recommend the following book as a gentle and no-hype low-math 
introduction to numerical integration. Written by a guy who cut his 
teeth computing trajectories on the Apollo project:


"Math Toolkit for real-time programming"
Jack W. Crenshaw
CMP Books.

Cheers,

Ross.






thank you all for the discussion and sorry for my noise

ezra b
--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread Ezra Buchla
i hope it's ok if i sum up the main themes here with background links,
as i understand it. the thread is just such a mess...

here is the state variable filter from hal chamberlin 1985 or so:
http://t.co/SVJp7iAgqb

pierre dutilleux wrote up a nice discretized and tuned version in dafx 1998:
http://iua.upf.edu/dafx98/papers/
presumably drawing on ("it can be shown that...") this much earlier
AES paper, which i have not purchased
https://secure.aes.org/forum/pubs/conventions/?elib=5937

andrew simper's suggestion is to integrate the capacitor functions
with trapezoidal approximation, allowing for some refactoring and
simplication of the dif. eq.s and  faster code.
http://cytomic.com/files/dsp/SvfLinearTrapOptimised.pdf

there seems to be some concern about distortion introduced by the
trapezoidal integration. i've tried the algo in both fixed 32 ands
float, and it seems to sound and look ok to but i have not done a
proper analysis either numerically or physically. has anyone else?

theo vereslt seems to think the distortion would be unacceptable, and
so i tend to believe that in a really high-fidelity environment it
could be an issue. additionally, he seems to imply (maybe? i'm not
sure) that not only is the optimization not worth it, but you can't
adequately suppress artifacts during coefficient change at all (which
i've always understood as the main raison for the digital SVF) without
analog components (referenced switched caps as variable R's, an
interesting trick), or more bandlimiting somewhere, or something.

the KeepTopology paper by vadim zavalishin (http://t.co/SVJp7iAgqb)
proposes modelling the SVF with digital integrators. it seems like
these would follow the behaviors of the caps pretty closely and be
amenable to parameter change at the cost of some expense of course...
wouldn't that satisfy the purists? this last exchange seems to
indicate not... but i'm not sure why. again i should just try this
myself but it's a bit more work! ha.

thank you all for the discussion and sorry for my noise

ezra b
--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread robert bristow-johnson

On 11/10/13 5:12 PM, Urs Heckmann wrote:

On 11.11.2013, at 01:33, robert bristow-johnson  
wrote:


but you cannot define your current output sample in terms of the current output 
sample.

But that, with all due respect, is what has been done for quite a while.


it's been reported or *reputed* to be done for quite a while.

but when the smoke and dust clear, logic still prevails.


--

r b-j  r...@audioimagination.com

"Imagination is more important than knowledge."



--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread Urs Heckmann

On 11.11.2013, at 01:33, robert bristow-johnson  
wrote:

> but you cannot define your current output sample in terms of the current 
> output sample.

But that, with all due respect, is what has been done for quite a while. It 
isn't the major ingredient of great sound, but it arguably has its perks, 
albeit cpu smoking ones.

I agree with Andy though that the main advantage of preserving the topology is 
the possibility to insert the non-linearities at the right point. When using 
BLT, how would you insert the non-linear effects of a diode or an OpAmp into 
your model, where these things are desirable for a musical result?

- Urs
--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread robert bristow-johnson



On 11/9/13 6:52 PM, Andrew Simper wrote:


Marco writes:

Well, of course the s = (T/2)(z-1)/(z+1) conversion comes from discretizing
a differential equation.


but remember, that's not the only way to convert s to z.  that's the 
bilinear way to do it.


...


What I would say more about this method is that , since it is
intrinsicly a biquad, you not only have to prewarp the cutoff fc but
also the Q. In such

Are you talking about bell filters here? For a low pass resonant filter it

is hard to warp the Q since there is no

extra degree of freedom to keep its gain down, so I'm not sure how

prewarping the Q is possible in this case, but I'd love to hear if it can be
done.

Not only, but wait I could be wrong on this. I always took RBJ cookbook as a
bible and he doesn't really say that the Q cant be prewarped for LPF/HPF
starting from the analog Q. Maybe RBJ can correct me :)


frequency warping is a consequence of using BLT.  the cool thing about 
BLT that other methods that convert s to z do not have is that it maps 
the j*omega axis in the s-plane to the unit circle in the z-plane, 
similarly to how the *exact* transformation does (which is z = 
e^(s/Fs)).  and the frequency mapping is strictly increasing and close 
to the identity function for f

Re: [music-dsp] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread douglas repetto


Urs, I don't know if you're referring to music-dsp here, but this list 
is specifically not meant to be in the academic realm, but rather a 
place where people of all sorts with an interest in music and digital 
signal processing can chat. So I encourage you to share your results here!


I'm sorry there has been unpleasantness on the list recently.

best,
douglas



On 11/10/13 10:00 AM, Urs Heckmann wrote:

We had planned to write a paper about our numerical method for the
non-linear case, including a pretty fast solving algorithm that's
fundamentally more precise than Newton-Raphson. But seeing how this
won't be well received in the academic realm (seemingly too trivial),
we might just share it in more practically oriented place (KVR dev
forum).


--
... http://artbots.org
.douglas.irving http://dorkbot.org
.. http://music.columbia.edu/cmc/music-dsp
...repetto. http://music.columbia.edu/organism
... http://music.columbia.edu/~douglas


--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread Urs Heckmann
The good thing is, a mathtard like me can implement it ;-) We've based a lot of 
our work on Vadim's and Andy's examples. These are a just so much easier to 
comprehend for auteurs than the chiffres typically used in academic papers.

The irony in preserving-the-topology is, one can create stunning sounding 
filters with very basic (i.e. self-taught) EE skills. The process of 
transforming a circuit schematic into a digital model has become pretty 
intuitive, and both Andy and Vadim have been eye openers for this method.

We had planned to write a paper about our numerical method for the non-linear 
case, including a pretty fast solving algorithm that's fundamentally more 
precise than Newton-Raphson. But seeing how this won't be well received in the 
academic realm (seemingly too trivial), we might just share it in more 
practically oriented place (KVR dev forum).

- Urs

On 10.11.2013, at 13:43, Robert Bielik  wrote:

> Yes, I was thinking along the lines of: Circuit schematic -> nodal analysis 
> -> LLVM IL -> highly optimized DSP code :) (a bit like faust)
> 
> /Rob
> 
> Richard Dobson skrev 2013-11-10 13:41:
>> So given all this, what are the prospects for a new Toolkit which those not 
>> blessed with the inner inner knowledge can just plug into our new 
>> Uber-Synths (or Csound)?
>> 
>> (the music-dsp archive seems not to have received anything new since 2010...)
>> 
>> Richard Dobson
>> 
>> 
>> 
>> --
>> 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

--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread Robert Bielik

Yes, I was thinking along the lines of: Circuit schematic -> nodal analysis -> 
LLVM IL -> highly optimized DSP code :) (a bit like faust)

/Rob

Richard Dobson skrev 2013-11-10 13:41:

So given all this, what are the prospects for a new Toolkit which those not 
blessed with the inner inner knowledge can just plug into our new Uber-Synths 
(or Csound)?

(the music-dsp archive seems not to have received anything new since 2010...)

Richard Dobson



--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread Richard Dobson
So given all this, what are the prospects for a new Toolkit which those 
not blessed with the inner inner knowledge can just plug into our new 
Uber-Synths (or Csound)?


(the music-dsp archive seems not to have received anything new since 
2010...)


Richard Dobson



--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread Andrew Simper
On 10 November 2013 18:43, Marco Lo Monaco  wrote:
> if you look at Yeh's work you can have an idea. The (D)KMethod is a
> generalization/extension of the state space ABCD approach to analog systems.
> Vadim's and Andrew are basically the same thing and the inversion is hidden
> in the calculation of the coeffs and also takes benefit of the order 2 size
> of matrix A (which is very simple to invert).

I didn't mean to hide anything from you :) I have mentioned MNA or
modified nodal analysis, and in all the links to qucs it shows how to
add entries to the matrices involved in the solution of the circuit
equations. Here is a direct link to the MNA matrix formulation:

http://qucs.sourceforge.net/tech/node14.html


> There is also a lot of good work made by the finnish guys (Valimaki et al)
> about the usage of the so called "transient suppressors".

Transient suppressors just screams to me of an underlying problem that
should be fixed.


> Without telling too much (sorry I cant :) ) if I have time I will show the
> similarity and the matrix inversion problem analyzing the SVF via a
> statespace approach similar to Andrew's. I am unfortunately fully loaded of
> work, but as I get some free time I will try to publish a pdf.
>
> My 0.02EUR >;-)
>
> Marco

No rush on any of this, whenever you get a chance it would be appreciated.

All the best,

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


[music-dsp] R: R: Trapezoidal integrated optimised SVF v2

2013-11-10 Thread Marco Lo Monaco
Hi Andrew/Dominque,
The DK-Method is a systematic way to implement on automatic systems the much
more breathru approach called KMethod, who was (how fun) discovered by my
professor in the late 1990s.
I cant either tell the all the story (it would require a lot of time because
it's a well defined and robust theory analogous to the state space one), but
if you look at Yeh's work you can have an idea. The (D)KMethod is a
generalization/extension of the state space ABCD approach to analog systems.
Vadim's and Andrew are basically the same thing and the inversion is hidden
in the calculation of the coeffs and also takes benefit of the order 2 size
of matrix A (which is very simple to invert). What I want to point out is
that it is an intrinsic state space matrix formulation where time variance
of the system demands a matrix inversion either at audio or control rate,
almost the same how you convert on Matlab via bilinear() the analog ABCD
matrix in the equivalent digital one (via bilinear).
Beware that using statespace for timevarying systems is better but not the
best. In ANY system of course you preserve the values of the state variables
(which is good compared to TF) but that doesn’t mean that you wont have
artifacts or transients at all.
There is also a lot of good work made by the finnish guys (Valimaki et al)
about the usage of the so called "transient suppressors".

Without telling too much (sorry I cant :) ) if I have time I will show the
similarity and the matrix inversion problem analyzing the SVF via a
statespace approach similar to Andrew's. I am unfortunately fully loaded of
work, but as I get some free time I will try to publish a pdf.

My 0.02EUR >;-)

Marco

-Messaggio originale-
Da: music-dsp-boun...@music.columbia.edu
[mailto:music-dsp-boun...@music.columbia.edu] Per conto di Dominique Würtz
Inviato: domenica 10 novembre 2013 11:13
A: A discussion list for music-related DSP
Oggetto: Re: [music-dsp] R: Trapezoidal integrated optimised SVF v2

Am Freitag, den 08.11.2013, 11:03 +0100 schrieb Marco Lo Monaco:
> Being in the linear modeling field, I would rather have analized the 
> filter in the classic virtual analog way, reaching an s-domain 
> transfer function which has the main advantage that is ready to many 
> discretization
> techniques: bilinear (trapezoidal), euler back/fwd, but also multi 
> step like AdamsMoulton etc. Once you have the s-domain TF you just 
> need to push in s the correct formula involving z and simplify the new 
> H(z) which is read to be implemented in DF1/2.

I think a crucial point is that besides replicating steady state response of
your analog system, you also want to preserve the time-varying behavior
(modulating cutoff frequency) in digital domain.
To achieve the latter, your digital system must use a state space
representation equivalent to the original circuit, or, how Vadim puts it,
"preserve the topology". By starting from an s-TF, however, all this
information is lost. This is in particular visible from the fact that
implementing different direct forms yields different modulation behavior.

BTW, in case you all aren't aware: a work probably relevant to this
discussion is the thesis of David Yeh found here:

https://ccrma.stanford.edu/~dtyeh/papers/pubs.html

When digging through it, in particular the so-called "DK method", you will
find many familiar concepts incorporated in a more systematic and general
way of discretizing circuits, including nonlinear ones. Can't say how novel
all this really is, still it's an interesting read anyway.

Dominique


--
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] R: R: Trapezoidal integrated optimised SVF v2

2013-11-09 Thread Andrew Simper
On 9 November 2013 22:21, Marco Lo Monaco  wrote:

Hi Marco,

First up I want to thank you for your considered and useful
observations Marco, I appreciate where you are coming from and how you
can clearly communicate your ideas. This makes it possible for me to
reply to your points and offer observations in return which are
hopefully helpful to not only you, but anyone reading this thread.


> Hi Andrew,
>
> >>I think it's useful for everyone, and especially those wanting to handle
> non-linearities or other music behaviour.
>
> Yes, but people who are working in this field and doing virtual analog have
> known these tricks for at least 10 years ago. :)

Here is a direct quote from my first email, and similar quotes will be
found in all initial emails from me, and references to reinforce just
how "not new" this stuff is:

"Please note there is absolutely nothing new here, this is all standard
circuit maths that has been around for ages, and all the maths behind
it was invented by people like Netwon, Leibnitz, and Euler, they
deserve all the credit and came up with ways of solving not just this
linear case but also the non-linear case."

Even if this is old news, there are plenty of people struggling along
with algorithms that don't sound as good and they aren't aware of
alternatives. I'm trying to raise the level of dsp here by pointing
out what to me is obvious and helpful, I'm not pretending to have
invented anything.

> >>You don't need the laplace space to apply all these different
> discretization (numerical integration)
> >>methods, they all come from the time domain and can be derived >>pretty
> quickly from first principles.
>
> Well, of course the s = (T/2)(z-1)/(z+1) conversion comes from discretizing
> a differential equation. Using Laplace is simply more handy IMHO. Mainly
> because once you have your state space model (or TF) representation you can
> choose (via a CAS tool) to discretize it at best. Moreover modeling an
> analog network with s-domain impedence sometimes is quicker/easier. But I
> understand it's only a routine behavior and it's a matter of tastes. I
> remember I have once modeled 50eqs linear system via KVL/KCL always
> remaining in the continuos domain and because I wanted to see different
> behavior I chose the Laplace representation. If I had to solve several times
> those linear system with different integration rules I would have gone nuts
> :)

Please note you only have to solve the numerical integration equations
once to generate a linear equivalent model of the form ic = gc vc -
iceq, then you put that linear equivalent model into your Computer
Algebra System (CAS) to solve things.

So although it may be more handy for you at the moment to do things
via the laplace domain there are compelling reasons not to, even in
the case where you don't modulate the filter at all like an eq. In
noise performance tests I've done (I don't know how to prove this
analytically, but if you do then please go ahead and work it out and
share it with us!) using direct integration on an svf delivers better
results (rms error) than any other filter realisation I've tried which
operates via the laplace transform (DF1, DF2, DF2T, Ladder (not moog),
Direct Wave, etc etc). Here are some plots of the previous method I
posted which is almost identical to the one in the newer pdf, the
ladder structure is the only one to come come close but it falls down
on some of the tests. I suggest if you are not convinced to repeat the
tests yourself (or even come up with new ones) and share the results:

http://www.cytomic.com/files/dsp/SVF-vs-DF1.pdf


> > What I would say more about this method is that , since it is
> > intrinsicly a biquad, you not only have to prewarp the cutoff fc but
> > also the Q. In such
>
> >>Are you talking about bell filters here? For a low pass resonant filter it
> is hard to warp the Q since there is no
> >> extra degree of freedom to keep its gain down, so I'm not sure how
> prewarping the Q is possible in this case, but I'd love to hear if it can be
> done.
>
> Not only, but wait I could be wrong on this. I always took RBJ cookbook as a
> bible and he doesn't really say that the Q cant be prewarped for LPF/HPF
> starting from the analog Q. Maybe RBJ can correct me :)

I would love it if you are right. If RBJ can pull it off I would love
to see how as it would be ultra ultra useful!


> >> You can do all the same warping no matter if you go through the laplace
> space or
> >> directly integrate the circuits, and it doesn't matter what realisation
> you are using, in
> >>particular you can have a look at my previous workbook
> > >where I matched the SVF to Roberts RBJ shapes:
>
> I would love to see it, if you have the chance.

I missed adding the link here, sorry about that, here is the old
version with the bell shape mapped, you can use the same method on the
new version I just didn't bother adding it to the new pdf (you match
all the RBJ shapes with algebra exactly)

http://www.

[music-dsp] R: R: Trapezoidal integrated optimised SVF v2

2013-11-09 Thread Marco Lo Monaco
Hi Andrew,

>>I think it's useful for everyone, and especially those wanting to handle
non-linearities or other music behaviour.

Yes, but people who are working in this field and doing virtual analog have
known these tricks for at least 10 years ago. :)

> Being in the linear modeling field, I would rather have analized the 
> filter in the classic virtual analog way, reaching an s-domain 
> transfer function which has the main advantage that is ready to many 
> discretization
> techniques: bilinear (trapezoidal), euler back/fwd, but also multi 
> step like AdamsMoulton etc. Once you have the s-domain TF you just 
> need to push in s the correct formula involving z and simplify the new 
> H(z) which is read to be implemented in DF1/2.

>>You don't need the laplace space to apply all these different
discretization (numerical integration) 
>>methods, they all come from the time domain and can be derived >>pretty
quickly from first principles.

Well, of course the s = (T/2)(z-1)/(z+1) conversion comes from discretizing
a differential equation. Using Laplace is simply more handy IMHO. Mainly
because once you have your state space model (or TF) representation you can
choose (via a CAS tool) to discretize it at best. Moreover modeling an
analog network with s-domain impedence sometimes is quicker/easier. But I
understand it's only a routine behavior and it's a matter of tastes. I
remember I have once modeled 50eqs linear system via KVL/KCL always
remaining in the continuos domain and because I wanted to see different
behavior I chose the Laplace representation. If I had to solve several times
those linear system with different integration rules I would have gone nuts
:)


> What I would say more about this method is that , since it is 
> intrinsicly a biquad, you not only have to prewarp the cutoff fc but 
> also the Q. In such

>>Are you talking about bell filters here? For a low pass resonant filter it
is hard to warp the Q since there is no 
>> extra degree of freedom to keep its gain down, so I'm not sure how
prewarping the Q is possible in this case, but I'd love to hear if it can be
done.

Not only, but wait I could be wrong on this. I always took RBJ cookbook as a
bible and he doesn't really say that the Q cant be prewarped for LPF/HPF
starting from the analog Q. Maybe RBJ can correct me :)

>> You can do all the same warping no matter if you go through the laplace
space or 
>> directly integrate the circuits, and it doesn't matter what realisation
you are using, in 
>>particular you can have a look at my previous workbook
> >where I matched the SVF to Roberts RBJ shapes:

I would love to see it, if you have the chance.

>>The basic idea in most circuit simulators is to linearise the non-linear
bits, then iterate to converge on a solution (find the
>>zero) of the equations which also include handling your integration method
(but a final single step after convergence is needed to update the states).
This is all done by turning everything into y = m x + b form, since then if
"y" >>is on both sides like y = m (x - y) + b then you can easily solve it:
y + m y = m x + b, y (1 + m) = m x + b, y = (m x + b)/(1 + m), and that is
about as hard as it gets. For each implicit dependency you have a division
to eliminate it, and
>> sometimes you can group the divisions. Note that the implicit dependency
could be either a linear one (which means you can solve it in one step) or a
non-linear one (which means you need to iterate).

>>I'll post another workbook showing how straightforward this is when I get
a chance.

I guess that this method is very similar to Vadim and it's basically the
very famous "delay-free loop problem" that has been faced for the first time
AFAIK in 1975 by Szczupak and Mitra in "Detection location and removal of
delayfree loops in digital filter configuration". So to me it's nothing new,
but I work in the field so I guess I am more used to this stuff than others
who are not involved in virtual analog plus nonlinearity. Others have then
enhanced and generalized it in the following years.

Btw, you approach (and Vadim's) looks like more a state-space rather than a
TF one. It can be easily generalized for the MIMO case (your SVF is SIMO 1
in 3 outs). Note that if you try to generalize you will end to have a matrix
representation where the transition matrix is to be inverted. So my guess is
that for time varying parameters at audio rate that could be not so
cpu-friendly (inversion is always a pain in the ass). Nonetheless the SVF is
quite a fortunate topology that simplifies the inversion problem.

Take care

Marco

--
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