-
Notifications
You must be signed in to change notification settings - Fork 151
[SIGNAL] Added peak calibration #222
[SIGNAL] Added peak calibration #222
Conversation
|
@adrian-stepien I don't understand the logic here. How do you know the SPL corresponding to 0 dBFS? The typical way to calibrate dBFS to dB SPL would be to send in a calibrated signal (typically 94 or 114 dB from an acoustical calibrator/pistonphone) and then compare the current dB reading with the reference value. You can then offset the current reading by whatever difference is found. Where does the assumption of "We know that peak value equals 1. 1 Pa" come from? 0 dBFS can correspond to any dB SPL depending on the gain structure of the equipment/software you are using. I don't think there is any way of hardcoding it like you have to just offset the gain by a fixed value. Also, I'm not so familiar with the whole package, but your line 146 is just multiplying all decibel values by -92.98979. Assuming |
|
As far as I can see, the existing Adrian's implementation adds 27.3 dB re 20uPa/MSB to the dBFS value, where MSB stands for a digital 1. So if you've measured -10 dB FS, your "calibrated" sound pressure level is 17.3 dB SPL. Perhaps the "calibrated" terminology between the |
|
Thanks for the explanation, that clarifies it. I never used it myself like that, but it makes sense. |
|
@topherbuckley Certain devices offer you the calibration based on a peak amplitude. For example NTi XL2 embeds it in the filename, which allows for post-processing (see page 47). |
|
@adrian-stepien thanks for the link. Hadn't seen that before. @tcanders It still wasn't make sense to me how setting the gain by inputting a decibel value and then subtracting 93.979 dB from it does anything of value, so allow me to walk myself through it and maybe help others understand later on. If you had some signal that you measured on this NTi XL2, and it had a marked 27.3 dB SPL peak (ignoring the fact that this is absurdly quiet for any peak :D) signal and you wanted to set the gain such that the entire signal levels were now converted from dBFS to dB SPL. This is the goal right? Lets start with Adrian's assignment of the gain:
And then just simplify this argument to only look at the single value in the array which represents the peak value (27.3 in this case), since I don't know a way to render equations in markdown and this is getting messy already. You could then redefine the gain assignment as:
The actual gain factor from
Fully evaluating the return from
I would expect this to evaluate to the pressure equivalent of 27.3 dB, i.e. 20*np.log10(return/2e-5) = 27.3, and it does! I wanted to continue this derivation to show it analytically, but plugging it in to python and seeing it work is enough for me before bedtime. I'm satisfied with my walk-through, and hopefully this helps someone in my shoes later. |
8c54d3e to
c7bc939
Compare
dad3bc2 to
1ab2ec3
Compare
|
Hi @FRidh, any chance for merging that change? |
|
This needs a rebase first. |
|
@FRidh I see. From what I can see, my branch is 4 commits ahead of the master. |
Knowing what is the SPL corresponding to 0 dBFS its possible to calibrate the signal.
Just to keep it more descriptive.
20b63a2 to
e9fabe9
Compare
|
Hi @adrian-stepien and @FRidh, will there be any more progress merging this PR? |
Knowing what is the SPL corresponding to 0 dBFS its possible to calibrate
the signal.