Reply by Martin Eisenberg August 7, 20062006-08-07
Hello again!

Anton wrote:

> I reread the thread and tried to play around with r b-j's > suggestion to shift real zeros between real poles. > I have an order 6 filter using that approach, which can > achieve variable rolloff from 0-6db per octave.
That might just have been a better use of your time than anything I could have delegated (not much anyway) because at the core of my method are an order-50 FIR and two biquads. The FIR could probably be shortened threefold without losing much accuracy -- the limit here is my ability to fit a function to q in (z-q)^n for fixed corner frequency as n varies, which gets easier the longer the truncated series. I didn't want to respond before demonstrating to myself that the method really works, including sweeping; in the meantime I've hacked up a simple VST plugin without regard to efficiency that takes 3% or 4% CPU, as displayed by FruityLoops on an Athlon 800, between sweeps. The plugin lets you try out different sweep lengths, and 150 to 200 samples give clean quick transitions. (With an eye to your previous reply, note that this switch time is a different quantity from the control rate.)
> It is not perfect, as I just placed the poles by hand, so > I am sure it would be possible to make this better.
Well, the series approach has its own imperfections. One is its seeming rigidity: there are three empirical functions involved that I'm not sure could be derived automatically for other design parameters than I used. Another is the computational cost at least of my present implementation. If that doesn't deter you I'll put the code online as soon as it's properly commented.
> Anyway if somebody is interested I can mail the code (octave or C).
Yes, please throw it my way! From your earlier post:
> You say that you can get a FIR from the truncated power series > that you found, and later you said the desired overall rolloff can > be achieved by cascading IIRs. If I understand you correctly here > you want to use the FIR for slopes between 6-12 db and use cascaded > IIRs if a steeper slope is required. > Would that work to use an IIR _highpass_ with 6db slope and the > FIR as lowpass with 9db slope to achieve 3db?
Almost -- the FIR is highpass and a fixed lowpass biquad gives the range 0 to -6 dB/oct. On top of that there's the chain of -6 dB/oct stages and another biquad to sharpen the FIR knee (that should really take the chain into account but doesn't at the moment). Martin -- Yes, I'm reinventing the wheel. Others' have sharp ridges.
Reply by Anton August 4, 20062006-08-04
Hi everybody,

I have a kind of working version.
I reread the thread and tried to play around with r b-j's
suggestion to shift real zeros between real poles.
I have an order 6 filter using that approach, which can
achieve variable rolloff from 0-6db per octave.
It is not perfect, as I just placed the poles by hand, so
I am sure it would be possible to make this better.
(Maybe some optimization/error minimization method?)
Anyway if somebody is interested I can mail the code
(octave or C).  I have to clean the code and add the possiblities
to achieve higher slopes by cascading additional 1st order
filters.  When I have done that I will put it in the internet
anyway.

Martin, I am very interested to see your approach, because as
I said what I have is far from perfect, but still nice
to have it working.

Thanks to all of you for the great suggestions,
Anton
Reply by Anton August 3, 20062006-08-03
Martin Eisenberg <martin.eisenberg@udo.edu> writes:
> Anton, what kind of slope control stream did you have in mind > regarding its source/shape and time scale of change?
Hi Martin, A rather slow rate. If audio runs at 44100, I guess between 500-1000 is absolutely sufficient for my purpose. I could live with much less, but I want to make a plugin for SuperCollider (and maybe for puredata..) and in that case the control rate is 44100/64 = 689. I would really like to help and I have some time for it. If you can share any working efford (matlab, C or just further explanation in english), I would like to try to find a way to make it work in a realtime situation. If I manage to make a SuperCollider plugin or something like that, of course all credits for the real work go to you. I know that you basically allready explained how it works in your previous post, but I don't really get it. You say that you can get a FIR from the truncated power series that you found, and later you said the desired overall rolloff can be achieved by cascading IIRs. If I understand you correctly here you want to use the FIR for slopes between 6-12 db and use cascaded IIRs if a steeper slope is required. Would that work to use an IIR _highpass_ with 6db slope and the FIR as lowpass with 9db slope to achieve 3db? Otherwise I wonder how to cover the range between 0-6 db. thanks a lot, Anton
Reply by Martin Eisenberg August 3, 20062006-08-03
Anton, what kind of slope control stream did you have in mind 
regarding its source/shape and time scale of change?


Martin

-- 
Quidquid latine scriptum sit, altum viditur.
Reply by Martin Eisenberg July 29, 20062006-07-29
Anton wrote:

> So you start from an equation with rational exponent and want > to derive an approximation with a power series to end up with an > expression that contains just integral exponents. Is that > correct? What kind of power series? Like a taylor series? > I am curious to see how you do that.
That could be asking any of several things. As I said, I do it with Maple but the Taylor series is easy to find by hand. However, it turns out that a lowpass with early rolloff needs poles which would necessitate factoring into second-order sections on the fly in an application. Next, we want unit DC gain so the highpass zero can't be right at z = 1. So the series about z = 0 becomes (z-q)^n = sum_k z^k (n)_k (-q)^(n-k) / k! = (-q)^n sum_k (-z)^k (n)_k / (q^k k!), where q is close to 1, we take n to be a nonnegative real, and (n)_k is a falling factorial. Truncating the series gives an FIR with slope of 6*n dB/oct potentially over several octaves and flatter response at extreme frequencies -- more extreme the higher the order. Normalizing for unit response at DC, or indeed any other frequency, makes the complex factor (-q)^n go away. I've found that the sum converges quickest for n in [1,2]; we can get the desired overall rolloff from cascaded IIRs. It remains to get the filter to have a reasonably sharp knee and to see how all this fits in a dynamic setting. Martin -- Research is what I'm doing when I don't know what I'm doing. --Wernher von Braun
Reply by Anton July 27, 20062006-07-27
Martin Eisenberg <martin.eisenberg@udo.edu> writes:
> > But I've thought of a viable scheme in the meantime: Starting from > the observation that the magnitude of (z+1)^n has asymptotic slope > -6*n dB/oct for integral n, I noticed that the same holds if we let n > be nonintegral and develop into a power series in z to get an > implementable system. Cascaded with a low-frequency correction filter > this gives nice preliminary results. I'll follow up here once I have > it all worked out.
Hi Martin, So you start from an equation with rational exponent and want to derive an approximation with a power series to end up with an expression that contains just integral exponents. Is that correct? What kind of power series? Like a taylor series? I am curious to see how you do that. gr. Anton
Reply by Jerry Avins July 26, 20062006-07-26
robert bristow-johnson wrote:
> Jerry Avins wrote:
...
>> If you plot R.B-J's poles and zeros on log paper, you will probably find >> a constant spacing. > > almost, Jerry. if i recall correctly there was some manual adjustment > of the outside poles/zeros due to edge effects. certainly if you were > making an optimized pinking filter that would be good to a zillion > octaves, there would be a lot of alternating poles and zeros (maybe > about 1/2 zillion pair) and in the middle of the list (assuming it is > sorted in order of log frequency) these alternating poles/zeros would > follow constant spacing extremely closely.
That makes sense.
>> 6 dB/octave up and 6 down is what makes 3 dB/octave >> possible. Placing poles and zeros closer together (at log scale) >> increases complexity and reduces ripple. I don't see a theoretical way >> to construct long slopes that are not multiples of 3 dB/octave, >> certainly not adjustable ones. > > i s'pose one might try adjusting the relative spacing of the log > frequency the zeros relative to their adjacent poles. we start out > with a pole at the left and then alternate zeros and poles. the poles > are sorta fixed and equally spaced in log frequency. with the zeros > equally spaced but slidable w.r.t. their neighboring poles, one can > make an adjustment of slope from 0 dB/oct (when the equally spaced and > interspersed zeros are slid to the left right next to their left > neighbors) to -6 dB/oct (when the zeros are slid over to the right next > to their respective right neighbors). does that make any sense?
I actually started to write that; wrote it out and then discarded it when I found what seems to be a contradiction. Now I'm not so sure, but it's 3:00 AM. I'll sleep on it and just maybe, do the math. Even if the slope is adjustable that way it would go from zero (when poles and zeros coincide) to 3 dB/octave (when they alternate midway) and back to zero when they coincide th other way. (Ignore the ends for now.)
> i dunno what you would have to do to make it continuously adjustable > from 0 to -12 dB/oct.
The way we used to make variable attenuators: have a section with a 3 dB/octave range, and as many cascaded 6 dB/octave sections as needed. Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
Reply by robert bristow-johnson July 26, 20062006-07-26
Jerry Avins wrote:
> Anton wrote: > ... > > > This page http://www.firstpr.com.au/dsp/pink-noise/ contains a > > cite from robert bristow-johnson: > > > > "an equiripple approximation to the ideal pinking filter can be > > realized by alternating real poles with real zeros. > > A simple 3rd order solution that i obtained is: ...." > > > > and it shows the coefficients. There must be a method to > > generate the coefficients on the fly for a given slope. > > If you plot R.B-J's poles and zeros on log paper, you will probably find > a constant spacing.
almost, Jerry. if i recall correctly there was some manual adjustment of the outside poles/zeros due to edge effects. certainly if you were making an optimized pinking filter that would be good to a zillion octaves, there would be a lot of alternating poles and zeros (maybe about 1/2 zillion pair) and in the middle of the list (assuming it is sorted in order of log frequency) these alternating poles/zeros would follow constant spacing extremely closely.
> 6 dB/octave up and 6 down is what makes 3 dB/octave > possible. Placing poles and zeros closer together (at log scale) > increases complexity and reduces ripple. I don't see a theoretical way > to construct long slopes that are not multiples of 3 dB/octave, > certainly not adjustable ones.
i s'pose one might try adjusting the relative spacing of the log frequency the zeros relative to their adjacent poles. we start out with a pole at the left and then alternate zeros and poles. the poles are sorta fixed and equally spaced in log frequency. with the zeros equally spaced but slidable w.r.t. their neighboring poles, one can make an adjustment of slope from 0 dB/oct (when the equally spaced and interspersed zeros are slid to the left right next to their left neighbors) to -6 dB/oct (when the zeros are slid over to the right next to their respective right neighbors). does that make any sense? i dunno what you would have to do to make it continuously adjustable from 0 to -12 dB/oct. r b-j
Reply by Martin Eisenberg July 25, 20062006-07-25
Anton wrote:

> I have to finish some non dsp related work, and as if that is > not bad enough, I got a stomach flu and could not do anything.
I hope you'll recover soon! Martin -- Quidquid latine scriptum sit, altum viditur.
Reply by Anton July 25, 20062006-07-25
Martin Eisenberg <martin.eisenberg@udo.edu> writes:

> Hi Anton, > > this is just to let you know I'm still at it as I also want this for > myself. The band-end correction filters are harder to parameterize > than I anticipated but I believe it'll work out. Have you had any > success with the other suggested approaches in the meantime?
Hi Martin, First of all, I am very glad to see that this interests you. I searched the web for a really long time, I asked a teacher and I asked here (comp.dsp) and it seems that there is no well known solution. I had absolutely no success and also very limited time. Otherwise I would have posted my progress. I have to finish some non dsp related work, and as if that is not bad enough, I got a stomach flu and could not do anything. It's just too hot here in Den Haag. I have just some basic knowledge of DSP, so for me this all takes really long. I got some books about digital filters from the library and I try to catch up, but you can't really count on me to come up with any useful results. So it is all on you now ;-) gr. Anton