Page 1 of 3
Martin (or anybody) I have a great filter idea
Posted:
Fri Aug 23, 2019 5:56 am
by guyman
I noticed that zdf peaking filters compress their bell curve at higher frequencies.
What if you somehow coded one up that cross faded with a high shelf filter in some clever/perfect way so that as the peak bell curve reaches it's limit, the Q, gain, and/or freq structure of both that zdf peaking filter and a zdf high shelf do some sort of perfect blend to a matched attenuation, with the slope, and Q remaining constant...?
Perfectly modulateable sweeps top to bottom, zdf, no latency, clean...
Or is there some simpler preexistant solution I am too complex to realize?
Attached schematic.
Re: Martin (or anybody) I have a great filter idea
Posted:
Fri Aug 23, 2019 2:16 pm
by wlangfor@uoguelph.ca
yes there is. I'd made a post which I will try and find. I believe I called it something about rational mapping. It's a rational mapper made by barrack. I like the one by Martin Vicanek, and the one by Tula but this one allows multiple values instead of a rising or lowering grade.
So you could have a grade of resonance based upon (01) float amplitude! It's a very exciting implementation and I look forward to see what you come up with. I'm pretty sure that's exactly what you need. *looks for the url
here is what you need:
http://dsprobotics.com/support/viewtopic.php?f=2&t=17529&p=55240#p55240
Re: Martin (or anybody) I have a great filter idea
Posted:
Sat Aug 24, 2019 2:08 am
by martinvicanek
I actually spent some time on this.
Hereis a little writeup, and
here is an FS implementation. Is that what you had in mind?
Re: Martin (or anybody) I have a great filter idea
Posted:
Mon Oct 14, 2019 2:45 am
by guyman
Ok after spending a great deal of time on this, I've come to the conclusion that the quality and functionality I am seeking is inherent in my original idea, and once I work out the math, it will be simpler to implement than what I am getting from Martin's approach.
I need ZDF, and the shelves in the ZDFs I have are constructed from combinations of bp and hi/lo pass fliters. So all the filters I need (lo shelf,hi shelf,peaking) can be constructed in the same code box, and the math needed to combine them into one fluid motion across the spectrum can be performed at the same time. unfortunately the best zdfs I have are in assem, and that's all over my head  so I'll have to do it all in blue/dspcodebox and hope someone can write it to assem when I'm done.
le atol, I see what you are sharing with the rational mapper, but from what I can tell I can accomplish this without it, it's just a matter of finding the functions of linking the gain/Q/freq structure of the shelves to the peaking, which works out as the cutoff on the shelves correlates to a change in Q on the peak, and the gain on the shelf correlates to the cutoff on the peak. nothing can be green, and it's all some exponential function linking them. then it's just cross fading their gain structure.
Martin thanks for sharing your work I learned a lot digging through those filters, they just aren't quiet enough for my taste, your work on the zdf is the only thing i've come across I want in my devices.
If any one else is seeking this current infinity stone, I hope my headaches have led to a gem in the above text. The shelves are already the perfect matched way of avoiding the narrowing peak band, realtime, without oversampling.
Re: Martin (or anybody) I have a great filter idea
Posted:
Mon Oct 14, 2019 3:03 am
by guyman
Honestly the most efficient way of doing this, is to work out the math upstream on the zdf filters, so that the end signal is the equivalent of the sum of a low shelf,a high shelf, and a bandpass filter, RAN IN SERIES with the shelves moving in the way described above in response to the bandpass filter's settings. this would need to be worked out in it's coefficients(?) and coded in assem thus inherent to the filter's design... all stream, no green, fast, reliable, quiet, modulateable. any filter math that would be the equivalent of these shelves in parallel would result in phase responses similar to what was going on in the complex filter design in martin's post, making it impossible to run wet dry with the original signal. There would still be a steep rolloff at 22050, but the filter would maintain shape past our hearing range.
Then again I could always be tripping so always in any of my posts feel free to scold, and correct me. Take it with a grain of salt, but I think I have thought this thru, it'll just be a busy week working this math out in my spare time as I am not quick with it.
Re: Martin (or anybody) I have a great filter idea
Posted:
Tue Oct 22, 2019 10:06 pm
by guyman

Re: Martin (or anybody) I have a great filter idea
Posted:
Wed Oct 23, 2019 11:44 pm
by guyman
ok... this is what I will attempt next, tho i may lack the math skills (Martin save me).
One could use the Q of the peak filter to calculate the distance from center frequency to the point/frequency the bell curve ends/merges with the spectrum, for that particular Q value. As that point passes 22050(or perhaps a slightly lower value i dunno..where ever it starts warping), the attenuation of our theoretical "matched shelf" would begin to move towards it's full potential (which would be 100%(01) multiplied by the attenuation in db of the peak filter, fed to the shelf's atten input)...
With full potential attenuation of the shelf reached at the point the center frequency of the bell curve reaches 22050... the distance of the peak filter's center, to the point the bell curve completely tapers becomes the 01 value that is warping the attenuation.
Simultaneously one would take that attenuation value (01), and subtract it from 1, to attain a value from 01 to multiply by the attenuation of the PEAK FILTER, so that it's attenuation moves towards 0 as the shelfs' attenuation reaches full potential. Essentially crossfading the gain structure of the 2 filters.
The shelf's res/q would be set to approx .5 ( by my current experiments), and the cutoff freq. of the shelf would control it's shape/bandwidth to match the Q/bandwidth of the peak filter we are structuring the shelf to match.
If done properly IN STREAM with ZDF filters, this should render a solid, fast, modulateable ZDF PEAK FILTER that does not have frequency warping, and avoids the limitations/noise of other methods I have seen here thus far. This could be done with the low end as well, though I do not see it as pertinent. The goal is to have a filter of the quality of Martin's ZDF filters, without warping, without oversampling.
Is there an underlying way to perform this equivalent operation without 2 zdf filters, and instead 1? If not could one not create both of these filters, in series, married in the way described above in one pass of a code box?
I will post some CRUDE examples soon.
Re: Martin (or anybody) I have a great filter idea
Posted:
Thu Oct 24, 2019 5:07 am
by guyman
Shelf filter still distorts near nyquist no matter what I do, I resign.
okkkkk
Posted:
Sun Oct 27, 2019 2:23 am
by guyman
I know I'm flipping back and forth on this like a madman, but that's because I am.
If anyone is inclined to assist.....
I figured out how to solve the issue if someone can get 2 ZDF high shelving filters to boost/cut with proportional cutoffs when approaching nyquist. something in the computation of the filter causes the cutoff to increase when the filter is being boosted, but NOT WHEN CUT...It's maxing out the 01 on the cutoff internally ( in the algorithm, in asm, can't read it) I have toyed with it enough to know that it is possible, but that it is some scaling factor I have yet to discover.. (x). It could say " when db > 0, multiply cutoff by (x)" x being some scaling factor related to the db boost/cut I think. If I can get the shelving filter to zero out in a phase flip when the boosts/cuts are extreme, when the cutoff frequency is say above ~.65 (hz to 01) then I can SOLVE THIS FILTER. The shelves were set up this way to make them zero out when the cutoff is low, and the boosts minor... not anticipating usage as a Q value for cutoff = 1. THIS IS THE MATH OF THE GAIN/CUTOFF STRUCTURE OF THE FILTER. NOT FREQUENCY WARPING (tho developed to mitigate it's effects on zeroing out under normal function.)
I may be talking to a wall, but maybe not... If you are tackling this issue, please share as I have... If someone had the maths to assist I could talk you through how to create a NON FREQUENCY WARPING ZDF PEAK FILTER WITHOUT OVERSAMPLING.
I just want it for my songs.....
Re: Martin (or anybody) I have a great filter idea
Posted:
Sun Oct 27, 2019 10:16 am
by martinvicanek
Hell, you never give up, do you?
OKay, so here is my solution for a matched, modulateable peaking EQ filter. It is a fourpoint fit to the magnitude response of an analog prototype. The matching frequencies are: DC, peaking frequency (matches value and slope=0), just below Nyquist, and a further point below the peaking frequency at half gain in dB. I have a draft of the theory but it is not yet in a shape for publication.
Filter coefficients are updated at hop(32). You can update more often if your CPU allows. The filter itself is optimized.
Have fun!