Hi again,
On 04/03/2020 12:58, Claude Heiland-Allen wrote:
On 2020-03-04 11:18, Peter P. wrote:
I am trying to calculate a makeup gain factor for white noise sent into [bp~] and [vcf~] bandpass objects depending on the center frequency and the Q (width) so that it measures the same in dBRMS before and after the filter. I am currently measuring it but am wondering if b.) if there is an analytical solution to it already
For an un-normalized 2-pole bandpass filter as depicted at [1], I think the overall gain of the filter for white noise input is
sqrt ( integral from 0 to pi of |1/((exp(it) - (1-b)exp(iw))(exp(it) - (1-b)exp(-iw)))|^2 dt )
I tried it on Wolfram Alpha but it didn't succeed (time limit exceeded). Probably there is no simple closed-form solution?
Then you need to factor in how bp~ [2] and vcf~ [3] convert f and q into w and b, as well as their custom gain factors.
I attached an example with simple numerical integration (using Pd dsp with bang to switch~), seems to work ok (but may be unreliable if q is too high), you could combine with automation for -batch and use that to generate data for surface fitting software? I may try that later...
I think I made a mistake though: I used vcf~'s f q -> w b calculations, but now realized that maybe vcf~ has 1 (complex) pole and bp~ has 2 (a conjugate pair)?
As a bonus, the patch includes a normalized log-log spectrum graph calculated in DSP using tabsend~/tabreceive~ and order forcing.
[1] http://msp.ucsd.edu/techniques/latest/book-html/node143.html [2] https://github.com/pure-data/pure-data/blob/e2ef8158e83900734d263a3fda343a47... [3] https://github.com/pure-data/pure-data/blob/e2ef8158e83900734d263a3fda343a47...