Reply by martinvicanek September 18, 20162016-09-18
>I've gotten decent behaviour however when the peak frequency approaches >Nyquist the bandwidth expands like so...
You could try other matching schemes as outlined here: http://vicanek.de/articles/BiquadFits.pdf --------------------------------------- Posted through http://www.DSPRelated.com
Reply by jtp_1960 September 17, 20162016-09-17
>Back to this project after a long break. > >I've gotten decent behaviour however when the peak frequency approaches >Nyquist the bandwidth expands like so... > >https://s13.postimg.io/pfj6t5tvb/orfanidis_near_nyquist_behaviour.gif > >Any ideas of how to iron this out? > >I've chosen 0.707*peak_gain to be the gain at which the bandwidth is >measured at. I'm presuming something strange is happening when the
rightmost
>bandwidth frequency is hits and exceeds Nyquist? > >Many thanks, >John.
That's how it works with 'low Q' value. I would try other method(s) for filters above fc where Orfandis' method starts give wrong output response. Särkka/Huovilainen paper "Accurate Discretization of Analog Audio Filters with Application to Parametric Equalizer Design" - https://users.aalto.fi/~ssarkka/pub/eq-article.pdf might work if you tweak the method a bit. If you like to test their method in Matlab/Octave you'll find ready to use functions for that paper from https://users.aalto.fi/~ssarkka/pub/ (eq_desifn_demo.zip)). --------------------------------------- Posted through http://www.DSPRelated.com
Reply by September 17, 20162016-09-17
Back to this project after a long break.

I've gotten decent behaviour however when the peak frequency approaches Nyquist the bandwidth expands like so...

https://s13.postimg.io/pfj6t5tvb/orfanidis_near_nyquist_behaviour.gif

Any ideas of how to iron this out?

I've chosen 0.707*peak_gain to be the gain at which the bandwidth is measured at. I'm presuming something strange is happening when the rightmost bandwidth frequency is hits and exceeds Nyquist?

Many thanks,
John.
Reply by June 27, 20162016-06-27
> i coulda just sent you the C code i have for the Orfanidis thing. >
Ooh, I would still like to see the C code if you still have it?
> there is an even better EQ coefficient calculation by a guy named Ken Cooke than the Orfanidis correction. >
And this too? Is that coefficient calculation for the Orfanidis approach or a different approach entirely?
Reply by robert bristow-johnson June 27, 20162016-06-27
On Monday, June 27, 2016 at 1:22:56 PM UTC-4, thejoh...@gmail.com wrote:
> All working now. Apologies for debugging out loud. (Will ask the duck the next time). > > const double bandwidthGain = gainLin / std::sqrt (2); > > ...should have been... > > const double bandwidthGain = dbToLin (gainDb / std::sqrt (2)); > > > And Robert, thank you for all the work you've done in this field. >
i coulda just sent you the C code i have for the Orfanidis thing. there is an even better EQ coefficient calculation by a guy named Ken Cooke than the Orfanidis correction. r b-j
Reply by June 27, 20162016-06-27
All working now. Apologies for debugging out loud. (Will ask the duck the next time).

const double bandwidthGain = gainLin / std::sqrt (2);

...should have been...

const double bandwidthGain = dbToLin (gainDb / std::sqrt (2));


And Robert, thank you for all the work you've done in this field.


All the best, John.
Reply by June 23, 20162016-06-23
> void calculate (double gain, double frequency, double q) > { > const double gainLin = Decibels::decibelsToGain (gain); > const double bandwidthGain = gainLin / std::sqrt (2); > const double hzFrequency = linToHz (frequency); > const double radSampFrequency = hzToRadPerSamp (hzFrequency); > const double radSampBandwidth = radSampFrequency / q; > > calculateCoefficients (1, gainLin, bandwidthGain, radSampFrequency, radSampBandwidth); > } > > I'm sure there is something simple I am missing?
I see now I didn't have gain in the Q calculation at all This is closer but still a mess... const double radSampBandwidth = (radSampFrequency * 2) / (q * gainLin); https://s31.postimg.org/vewdvez4b/Screen_Shot_2016_06_23_at_09_42_42.png
Reply by June 23, 20162016-06-23
> i think you'll find that Q (in terms of the EE definition) is Dw/w0. then, i believe you will get GB/G = 1/sqrt(2) .
Thanks Robert I am much closer. I now have a peak that behaves very well at 6dB gain. However, moving away from 6dB there is still some strange gain-Q interaction; when I push the gain up the resulting peak broadens. For example (using another EQ to null against): At +18dB, a 0.71Q setting on my peak broadens to an effective 0.26Q... https://s31.postimg.org/haxretvq3/Screen_Shot_2016_06_23_at_09_03_54.png (...please ignore GUI labels) My pre-Orfanidis calc code now looks like void calculate (double gain, double frequency, double q) { const double gainLin = Decibels::decibelsToGain (gain); const double bandwidthGain = gainLin / std::sqrt (2); const double hzFrequency = linToHz (frequency); const double radSampFrequency = hzToRadPerSamp (hzFrequency); const double radSampBandwidth = radSampFrequency / q; calculateCoefficients (1, gainLin, bandwidthGain, radSampFrequency, radSampBandwidth); } I'm sure there is something simple I am missing?
> you might be interested in this at stack exchange: http://dsp.stackexchange.com/questions/19225/audio-eq-cookbook-without-frequency-warping/19253#19253
Great I will try tackle that next project.
Reply by robert bristow-johnson June 22, 20162016-06-22
On Wednesday, June 22, 2016 at 6:46:39 PM UTC-4, thejoh...@gmail.com wrote:
> First post! Advance apologies for newb-ness. > > I've made a quick implementation of Orfanidis 'decramped' prescribed nyquist gain peaking filters in C++. > > Seems okay but I would like to be able to specify... > > Peak gain in dB > Peak frequency in Hz > Peak Q say 0.1 to 4 > > rather than... > > (G0 = reference gain at DC = 1) > G = boost/cut gain > GB = bandwidth gain > w0 = center frequency in rads/sample > Dw = bandwidth in rads/sample > > ...that Orfanidis' calculator takes. > > How do I map the parameters properly? >
i think you'll find that Q (in terms of the EE definition) is Dw/w0. then, i believe you will get GB/G = 1/sqrt(2) . looks like you already have w0 = 2*pi*(peak frequency in Hz)/(sample rate in Hz). you might be interested in this at stack exchange: http://dsp.stackexchange.com/questions/19225/audio-eq-cookbook-without-frequency-warping/19253#19253 it sorta generalizes the Orfanidis thing (a la Knud Bank Christensen). you would still need to apply bilinear transform to get H(z). r b-j
Reply by June 22, 20162016-06-22
I should mention that my GUI frequency slider is right now ranged 0 to 1. With centre 0.5 setting corresponding to 632Hz like this...

0 = 1Hz
0.5 = 632Hz
1 = 20kHz