View Single Post
Old 01-17-2018, 05:48 PM   #26
jcjr
Human being with feelings
 
Join Date: Dec 2015
Location: SE TN USA
Posts: 77
Default

A peaking filter doesn't follow the same rules as a simple bandpass filter but I have used some simple analog bandpass filter definitions for "first wild guess" estimation of bandwidth or Q, try to get the peaking filter somewhere in the ballpark for further refinement. Maybe there are far superior ways to do it.

Second-order bandpass filter definitions gleaned from an old analog book, "Active Filter Cookbook" by Don Lancaster.

FC: The center frequency, loudest part of the bandpass response.
FU: The frequency higher than FC where the amplitude is -3 dB below max (FC) gain.
FL: The frequency lower than FC where the amplitude is -3 dB below max (FC) gain.

If we know FU and FL then FC is the geometric mean of FU and FL: FC = sqrt(FU * FL)

If we know FC and FL, then FU = FC * (FC / FL)
If we know FC and FU, then FL = FC / (FU / FC)

Given some multiplier M: FL = FC / M and FU = FC * M

Bandwidth in Hz = FU - FL

Normalized bandwidth (setting so that the center frequency is always 1.0 Hz): NormBW = (FU - FL) / FC

Normalized bandwidth is also the second-order bandpass Damping figure. Q is the inverse of Damping.

NormBW = Damping = 1 / Q
_______________

For example if we have a room plot with a "somewhat-symmetrical peak" FL = 200 Hz and FU = 360 Hz-- We can estimate the filter center frequency at sqrt(200 * 360) = 268 Hz. Because room responses are complex, the actual peak frequency in the room plot might be somewhere else. But if trying to adjust the peak according to its width, we pick the center as the geometric mean of the lower and upper bounds. The response won't be "perfect" before the eq and won't be "perfect" afterward either. Just we hope somewhat improved.

If our equalizer wants a Q setting, we can first-guess Q = 268 / (360 - 200) = 1.68

If our equalizer wants octaves, we might first-guess the ratio between FU and FL. A ratio of 2 would be 1 octave. A ratio of 4 would be two octaves. The actual ratio in this case is 360 / 200 = 1.8. Which can be converted to octaves using log2(): Octaves = log2(FU / FL) = log2 (360 / 200) = 0.85 Octaves

The first-guess probably needs further refinement after being entered into the peaking filter, because the peaking filter doesn't follow quite the same rules as a simple bandpass.
_________________

If we know FC and Q but do not know FU and FL, and we need Octaves, the following should work. It is slightly involved implying maybe there is a simpler solution I'm too dumb to see. Or maybe it is even incorrect. My math was never very good.

Recall Normalized Bandwidth could be written (some multiplier M): ((FC * M) - (FC / M)) / FC

Simplifying: NormBW = 1 / Q = M - (1 / M)

A little algebra: M = 0.5 * (Q^-1 + (Q^-2 + 4)^0.5)

Octave = log2(M / (1 / M)) = log2(M / M^-1) = log2(M^2)

So expressed as a single calculator line--
Octave = log2((0.5 * (Q^-1 + (Q^-2 + 4)^0.5))^2)

Checking against the previous example Q of 1.68, I get Octave = 0.85, the same answer calced in another fashion in the first example.
____________________

If we know octave and want a rough initial guess at Q, maybe this would work as good as any, or perhaps there is a better more direct way--

The FU/FL ratio = 2 ^ Octave

M = (2 ^ Octave)^0.5

Q = (M - M^-1)^-1
jcjr is offline   Reply With Quote