On 12/23/14 11:36 PM, Andrew Simper wrote:
On 24 December 2014 at 08:55, robert bristow-johnson
<r...@audioimagination.com>  wrote:
the OTAs are there for voltage-controlled gain or, really, a
voltage-controlled resistor to change the tuning of the VCF.  from the
datasheet
They are an idealised voltage controlled current source, it looks
neater to use an OTA symbol for them.

for the anal-retentive, it looks like a non-trivial resistance is hidden from view.


http://users.ece.gatech.edu/~lanterma/sdiy/datasheets/ota/lm13600.pdf

the LM13600 looks like the transconductance, g_m is

    g_m = ( 20/volt ) * I_ABC

okay, i get that.  and it is this transconductance that algebraically goes
with the capacitance to get a time constant and a filter spec.  that's was
my original problem, because it's not an obvious property since the
"resistor" that *must* go with the cap is hidden inside the OTA and, in the
olden daze, i only messed around with op-amps or transistor circuits.
Yes the g term is your 1/R of your resistor, you can set c1, c2 to
whatever you want then set the g term to get where you want in
frequency, they form your RC 1 pole low pass filters, which should be
clear from a glance at the diagram.

when i glance at it, i see no "R" for the RC.  none at all.


It is the way that you can mix the inputs into a Sallen Key filter
that is new.

they're more like gates or switches (and nicely modeled as gains) and a
couple of summers.  also, again it show's my creaky old age, but this is not
what we used to call a "Sallen-Key circuit" (thems were much simpler).  but
it, with all of this voltage-controlled resistor stuff, can take up a
similar form for a SK, at least for the LPF.
They aren't switches, you can mix them at any level you want, as shown
later in the paper to form shelves etc.

listen, when it's a single input and multiple outputs, we don't call it a "multiplexer", we call it a "demultiplexer".

a "mixer" has multiple inputs and (for mono) a single output. i know that m0, m1, m2 can be any values we want in the analysis, but they're gates or switches. that's what they're being used for.

Anyway, please forget about it diagram if it confuses you.
legit circuit diagrams ain't confusing.  signal flow diagrams ain't
confusing.  mixed metaphors can be confusing.  wires are sorta physical
things that you can do Kirchoff's laws on, signal paths are more like
information pipes in which numbers flow.  when i see a line go into a
capacitor, i think it's a wire.  when i see a line go into an adder or a
gain block, i think it's a signal path.
There isn't much point putting in a bunch of matched resistors, it
just makes the diagram messier. Idealised components are all that is
needed and they are unambiguous. Re-draw the diagram yourself if you
prefer, but this was the most succinct way to express the idea.


well, as Marco pointed out to me, it might be useful to include a note that all the adders and gain blocks have infinite input impedance and zero output impedance. and it might be useful to explicitly show the output current of the OTA to be g times the diff-amp input voltage.

in the BPF case, you might also want to compensate Q because the bandwidth
will get squished as w0 gets close to Nyquist.  maybe not, whether it's LPF
or HPF or BPF, the bilinear transform maps the peak heights exactly (just
maps the peaks to slightly different frequencies).  you might want to
preserve the peak height instead and then you don't want to pre-warp Q when
the resonant frequency gets high.
Look later on in the paper at the Bell section.



what page is that? haven't found anything that appears so titled. and i am not reverse engineering code, and other than plots, i don't see much else in the paper. haven't seen anything regarding compensation of effects of bilinear transform.


2nd-order is 2nd-order. 2nd-order IIR filters, whether they be DF1 or DF2 or transposed DF1 or DF2 or Lattice or Normalized Lattice or Hal's SVF or Rader-Gold or whatever form might pop out of your simulation of whatever analog filter, there are, when you boil it down, exactly 5 independent coefficients and 5 degrees of freedom. this is why, 2 decades ago, i made this observation regarding "bell" parametric eq:

 http://www.aes.org/e-lib/browse.cfm?elib=6326

of course, one degree of freedom: the gain at Nyquist, need not be fixed to 0 dB, which Orfanidis made use of and which Knud Christensen has generalized for the 2nd-order IIR filter. so, because of that, i recognize that they ain't *all* equivalent. but most are. point is, if you're modeling your analog bell filter (which has gain out at infinity of 0 dB) using trapezoidal rule for the integration (which is the same as bilinear transform, so the analog frequency of infinity gets mapped to Nyquist) done by the two caps, it *is* one of those that is equivalent in the sense of that "Equivalence" paper. the coefficient calculation is a done deal. it's not a new or different method of getting a bell-shaped frequency response. it's just a possibly different definition of Q or BW.

repeating again, when you convert an analog filter to digital using bilinear transform (and that is what you are doing when you use trapezoidal rule for analog integrators), *and* you compensate the resonant frequency so that, accounting for the bilinear frequency warping, your resulting resonant frequency remains spot-on the user specification, then you will necessarily see

    tan( w0/2 )               (normalized angular frequency)

    tan( w0/(2*Fs) )          (not normalized)

in the equations for the coefficients. this has been known for a half century (Bob Adams keeps reminding us to check the Bell System Journals).

now, it's also known that besides the obvious:

    tan(w0/2)  =   sin(w0/2) / cos(w0/2)

the following trig identities are also valid:

    tan(w0/2)  =   sin(w0) / (1 + cos(w0))

and

    (tan(w0/2))^2   =   (1 - cos(w0)) / (1 + cos(w0))


and, we all know that cos(w0) is a problem for music-dsp folks because w0 is usually in the bottom 4 octaves, which in a linear scale, is *far* below Nyquist. because this trig identity is true:


    cos(w0)  =  1 - 2 (sin(w0/2))^2

we can see that all of the information regarding where this filter is tuned lives in the *difference* cos(w0) is from 1 and not even a floating-point representation for cos(w0) will help. with single-precision floats, and with, say, Fs = 96 kHz (which is what i might recommend for your modeling) you'll get in trouble with w0 down at around 30 or 40 Hz. all of your meaningful bits are falling off the edge with a 23-bit mantissa and the "hidden 1 bit" doesn't help at all (because your information is all in how *close* you are to 1, not to 0).

so using bilinear and pre-warping, we get:


    tan(w0/2)  =   (sin(w0)/2) / (1 - (sin(w0/2))^2)

and

    (tan(w0/2))^2   =   (sin(w0/2))^2 / (1 - (sin(w0/2))^2)


so, no matter how you do it, Andrew, whether you fill pages up with code or difference equations or whatever, you want to replace every occurrence of cos(w0) with [1 - 2 (sin(w0/2))^2] and blast out the whole algorithm with coefficients of sin(w0) and (sin(w0/2))^2 . *especially* if those coefs are represented as single-precision floats. you will have some signal paths with a gain of 1 in there that you didn't have before. big deel. you'll have far better tuning behavior for low pitches than you would with either tan(w0/2) (because that tan() function can get awful big) or with cos(w0) or cos(w0/2).

so, you're discovering what we've known about for a few decades: "The Cosine Problem"

the cosine problem exists because, for low w0, cos(w0) is just too damn close to 1 to be well-differentiated from 1. when rounding or quantization of cos(w0) happens, it becomes the cosine of *some* frequency, just not exactly the frequency, w0, that you intended which means your filter got tuned to some other pitch than intended.


--

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

Reply via email to