## Book: The Art of VA Filter Design 2.0.0alpha

DSP, Plug-in and Host development discussion.
Z1202
KVRian
958 posts since 12 Apr, 2002
1eqinfinity wrote:
Z1202 wrote:You can't have an absolutely desired transfer function, because you don't have a choice in terms of the denominator (aside from being able to cancel some of its factors). But you can choose the numerator freely.
Hmm...
As far as I understand the desired transfer function absolutely must be expressable by the powers of s available in stages' transfer functions on the right. If the desired H has some power that is not present on the right, it is impossible to derive it from the current topology, right?
Chances are you have all 4 powers on the right. But you really need to write everything in terms of the common denominator to see it.

E.g. for transistor ladder the numerators are
s^4+4s^3+6s^2+4s+1
s^3+3s^2+3s+1
s^2+2s+1
s+1
1
By combining them together you can express any polynomial of s.
Just from the general intuitive considerations the same should be possible for the diode ladder, although I didn't check it.
It's just that for transistor ladder the numerators have a nicer form (s+1)^n. For diode ladder you should have less regularity.

If you want to have s^5, that of course wouldn't be possible. You can't have a larger power in the numerator than in the denominator in an integrator-based filter.

1eqinfinity
KVRist
201 posts since 29 Apr, 2012
Yes, I get it. To put it in a more abstract context, to use Yn we should prove that they form an orthogonal basis.
For the transistor ladder the numerators I derived are
-G^3 /2 + G
G^3 / 4
-G^4 / 8 + G^2 / 2
G^4 / 8
Even prior to expressing them in terms of s it's easy to see that we can get "clean" powers of s.

But I still don't get the thing with ignoring the lhs denominator.

Z1202
KVRian
958 posts since 12 Apr, 2002
1eqinfinity wrote:But I still don't get the thing with ignoring the lhs denominator.
I guess that is a misunderstanding. As I wrote, you don't have a freedom of the denominator choice and have to live with the common denominator of the modal outputs.

However, this denominator is a polynomial of s, the highest-order term being s^4, the lowest-order term 1 (up to some possible constant coefficients). So, putting s^4 in the numerator gives you a horizontal asymptote at w->inf (which you can normalize to 1 by choosing the same coefficient that s^4 in the denominator has) and you have an asymptotic behavior proportional to s^4 at w->0. Exactly what a 4-pole highpass is. The behavior between these limits is defined by the denominator and you don't have much choice there, because putting any other powers of s into the numerator will destroy the 24dB/oct rolloff at w->0. So, if you're not happy with the amplitude response that you will get in this case, you need to use another topology, or give up the 24dB/oct slope, or something else.

If you take transistor ladder as an example, then the common denominator is (1+s)^4+k, while the numerators are (1+s)^n. Combining the numerators you can get any polynomial of up to 4th order in the numerator, but the denominator will still be the same.

1eqinfinity
KVRist
201 posts since 29 Apr, 2012
Z1202 wrote:As I wrote, you don't have a freedom of the denominator choice and have to live with the common denominator of the modal outputs.
Z1202 wrote:You can't have an absolutely desired transfer function, because you don't have a choice in terms of the denominator (aside from being able to cancel some of its factors). But you can choose the numerator freely.
Z1202 wrote:So, putting s^4 in the numerator gives you a horizontal asymptote at w->inf (which you can normalize to 1 by choosing the same coefficient that s^4 in the denominator has) and you have an asymptotic behavior proportional to s^4 at w->0. Exactly what a 4-pole highpass is. The behavior between these limits is defined by the denominator and you don't have much choice there, because putting any other powers of s into the numerator will destroy the 24dB/oct rolloff at w->0. So, if you're not happy with the amplitude response that you will get in this case, you need to use another topology, or give up the 24dB/oct slope, or something else.
1eqinfinity wrote:Upd: interesting, are there any cases when it's impossible to have a precise linear combination, but it's possible to build some acceptable approximation from the available stages.

I'll go try again.

Upd: I just realised I even was writing q = s - 1 all the time, while it was s + 1. I shoudn't have done it late at night.

1eqinfinity
KVRist
201 posts since 29 Apr, 2012
Z1202 wrote:The trick with s-1 substitution in the book was just a cheap way to avoid solving these equations, employing a particular regularity in the numerators, which is not always there.
I think actually with "simple" transfer functions substituting q for s - 1 or s + 1 is almost always better because on the right one anyway gets a more complex expression most of the times. For example, solving your example from the book without the substitution yields the same coefficients but requires a number of [errorprone] operations, whereas with it if one remembers the (x + 1)^4 formula or has it before the eyes the solution is already there.

1eqinfinity
KVRist
201 posts since 29 Apr, 2012
I got (1, -4, 12, -24, 20) for HP and (0, 1, -2, -2, 6) for BP, none of it sounds good.
However, I came up with a moronic solution to build HP and BP diode modes. If I take transistor modes and substitute
y1 -> y1 - y2
y2 -> y2 - y3
y3 -> y3 - y4
it has at least some resemblance to what I expect them to be.
It'd be interesting to see someone else's coefficients. Maybe it just doesn't sound good.
If I'm doing it right, and if guessed HP sounds better, there might be some other more educated guess that would be better again.

Z1202
KVRian
958 posts since 12 Apr, 2002
1eqinfinity wrote:I got (1, -4, 12, -24, 20) for HP
I don't have time now to do this carefully, but from a quick check this seems to correspond to 8s^4-8s^2-16s-7 rather than to s^4. Could be my mistake though.

Ivan_C
KVRian
1065 posts since 11 Aug, 2004 from Breuillet, France
My turn again

I dediced to give a go to the whole Remez chapter, and for now I can't reproduce the curves you get in the page 120 (fig 7.6). I have already seen a few typos :

- the uniformly spaced zeroes are 9, 27, 45, 63 and 81 not 91°
- the Chebyshev zeroes formula is not the same than in http://homepages.rpi.edu/~tasisa/remez.pdf, could it be :

zn = -cos((2*i-1)*pi/(2*N))

zn = -cos(1/2 + i) * pi / (N+1) ?

Z1202
KVRian
958 posts since 12 Apr, 2002
Ivan_C wrote:My turn again

I dediced to give a go to the whole Remez chapter, and for now I can't reproduce the curves you get in the page 120 (fig 7.6). I have already seen a few typos :
I was wondering how many people would actually bother to read and understand it So, first of all thanks for reading and for the feedback.
Ivan_C wrote:- the uniformly spaced zeroes are 9, 27, 45, 63 and 81 not 91°
. Damn, apparently I was subtracting 9 from 100, but the right angle is 90, not the water boiling temperature in Centigrade
Ivan_C wrote:- the Chebyshev zeroes formula is not the same than in http://homepages.rpi.edu/~tasisa/remez.pdf, could it be :

zn = -cos((2*i-1)*pi/(2*N))

zn = -cos(1/2 + i) * pi / (N+1) ?
On that page in the book the order of Chebyshev polynomial is N+1, not N. Also the "i" is starting at 0, not at 1. Taking your formula
zn = -cos((2*i-1)*pi/(2*N))
we first replace i with i+1:
zn = -cos((2*i+1)*pi/(2*N)) = -cos((i+1/2)*pi/N)
and afterwards N with N+1:
zn = -cos((2*i+1)*pi/(2*N)) = -cos((i+1/2)*pi/(N+1))

Edit: maybe the notation in that formula is not very clear. The cosine is taken from the entire rest of the formula, not just the part in the parentheses (the parentheses signify the order of operations, not the argument of the cosine).

mystran
KVRAF
4981 posts since 12 Feb, 2006 from Helsinki, Finland
Z1202 wrote: Edit: maybe the notation in that formula is not very clear. The cosine is taken from the entire rest of the formula, not just the part in the parentheses (the parentheses signify the order of operations, not the argument of the cosine).
To be honest, I would certainly have interpreted the pi/(n+1) to be outside the cosine as well since there is a pair of parenthesis around (1/2 + n) which is split separately, instead of being written on top of the division bar.

I don't know how a mathematician would read it, but it could really use an extra pair of parenthesis (unless you want to move the (1/2+n) above the division bar, but it might look ugly with the 1/2 in there).
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.

Z1202
KVRian
958 posts since 12 Apr, 2002
mystran wrote:
Z1202 wrote: Edit: maybe the notation in that formula is not very clear. The cosine is taken from the entire rest of the formula, not just the part in the parentheses (the parentheses signify the order of operations, not the argument of the cosine).
To be honest, I would certainly have interpreted the pi/(n+1) to be outside the cosine as well since there is a pair of parenthesis around (1/2 + n) which is split separately, instead of being written on top of the division bar.

I don't know how a mathematician would read it, but it could really use an extra pair of parenthesis (unless you want to move the (1/2+n) above the division bar, but it might look ugly with the 1/2 in there).
Yes, probably I should correct this, if it's not getting lost in different typo lists

As a kind of a justification, though, I should say that at least back when I was writing this, my expectation was that the reader would really think along, also working through the math and not simply taking the formulas for granted (otherwise I simply could have written down the final solution instead of all this text), in which case it should be clear that the fraction is a part of the cosine argument, since this formula is a solution of the equation directly above

And, as a remark, if the fraction was outside of a cosine, I probably would have expected a dot in between, the missing dot immediately raising the question of where the fraction actually belongs

Ivan_C
KVRian
1065 posts since 11 Aug, 2004 from Breuillet, France
Yes I meant the arguments should all be inside the parenthesis, whatever the i and N offsets because of the notation

mystran
KVRAF
4981 posts since 12 Feb, 2006 from Helsinki, Finland
Somewhat related (or not), one can design pretty good Hilbert-transformers by starting from an elliptic two-phase half-band filter, converting that into a Hilbert-transformer and then using frequency warping to move the lower cutoff-edge to some suitable low frequency at the cost of wider high-frequency transition. Beyond improving the response in general (after all, the low-frequency response is usually much more important than the high-frequency response), this makes it straight-forward to maintain the low-frequency response for varying sampling rates (eg. you can just recalculate the warping coefficient and everything else can stay the same).

This paper probably gives the most straight-forward treatment of the whole thing: https://www.cct.lsu.edu/~eberdahl/Paper ... hnique.pdf
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.

Z1202
KVRian
958 posts since 12 Apr, 2002
mystran wrote:Somewhat related (or not), one can design pretty good Hilbert-transformers by starting from an elliptic two-phase half-band filter, converting that into a Hilbert-transformer and then using frequency warping to move the lower cutoff-edge to some suitable low frequency at the cost of wider high-frequency transition. Beyond improving the response in general (after all, the low-frequency response is usually much more important than the high-frequency response), this makes it straight-forward to maintain the low-frequency response for varying sampling rates (eg. you can just recalculate the warping coefficient and everything else can stay the same).

This paper probably gives the most straight-forward treatment of the whole thing: https://www.cct.lsu.edu/~eberdahl/Paper ... hnique.pdf
I strongly suspect that this technique might be a discrete-time equivalent of the analytic technique I described later in my book (or rather vice versa, the one described in the book is an equivalent of this one, since the book was written later ), possibly both being related via bilinear transform (which then does the job of the "arctangent scale" used in the book). It's somewhat surprising the discrete-time technique seems to be restricted to the odd orders though.

1eqinfinity
KVRist
201 posts since 29 Apr, 2012
Hello again, everyone
Am I right that it's ok to build pure (not multimode) HP ladder using lowpasses, but taking (in - lp) as the filters' outputs?
The underlying filters are then processed as lowpasses, but the Gn and Sn for the whole ladder are derived from yn = xn - (g(x - yn) + sn).