I've been tasked with filtering a sound with a filter that looks something like this.
I don't have any real DSP training, so I'm not sure if my attempt at tackling this is correct. I can filter things given I have a transfer function (it's applied in the frequency domain - I know this works so it's not a concern), so to build that I'm first converting the values from SPL to FS, then converting the dB value to a normal "sample" value, which I can treat as the transfer function.
I recognize that there's no general conversion for converting dB values from SPL to FS. However that's not really a concern; I just need the relative differences. So I do that with a simple subtraction.
Then I generate the "sample" values by simply going backwards from the formula for converting a sample to dB.
I then use that in my transfer function, multiplying the frequency domain value by the appropriate value here (well, with linear interpolation between the points).
The key part is below.
double[] spls = GetFilter(); // this just gives me the array of spl values I need to filter by
double[] output = new double[spls.Length];
for(int i = 0; i < spls.Length; i++)
{
var fs = spl[i] - 150;
var b = fs/20;
var c = Math.Pow(10, b);
output[i] = c;
}
I'm applying this to white noise; however when I enable the filter, I'm not getting any sound at all. The transfer function values it generates seem rather small, so it might be that rather than any specific problem with my method, but even so I'm not sure.
Am I doing this correctly? Given a filter with dB SPL, can I apply it to a signal by converting the values to dBFS and then "backwards" to a 0-1 value to treat as the transfer function?
