0
\$\begingroup\$

At first is sampled data from the IMP23ABSU MEMS mic converted to V by multiplying each sample by the conversion factor \$ \frac{1}{32786} \$. Then i want to calculate the FFT and PSD after applying a passband with 20-80kHz range and windowing. Since im working with a lot of samples (around 17.538.000) it seems only right to represent the data in logarithmic scale. For that im in need of converting the data into dBV.

The mic has a sensitivity of -38 dBV ±1 dB @ 94 dBSPL, 1 kHz. If i convert the sensitivity to V i get a correction factor of 0.012589 by calculating \$corr_V=10^{\frac{-38}{20}}\$. How can i convert the data now to dBV using this correction factor? Do i just multiply each sample by the correction factor? How can i then represent the dBV correctly using the FFT?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ "Since im working with a lot of samples (around 17.538.000) it seems only right to represent the data in logarithmic scale." – Are you saying you want to represent the samples logarithmically? That sounds like quite an unusual thing to do, and it will make calculating the FFT significantly harder. \$\endgroup\$ Commented Nov 19, 2023 at 13:45
  • \$\begingroup\$ @Tom You asked this on DSP.SE already. Please do not cross-post. \$\endgroup\$
    – Justme
    Commented Nov 19, 2023 at 17:05

2 Answers 2

1
\$\begingroup\$

You don't convert each sample. You make the conversion to dB after the Fourier transform is complete (explanation below). The order is: window the data, conduct the DFT (FFT is one method of DFT), convert to decibels. If there is a correction factor, as in this case, then mathematically you can apply it to either the samples or the transformed data. Logically though correction belongs with the conversion, applied at the end.

A bit of background. Audio values are converted to decibels to reflect perceived sound levels. As we hear power, decibels should reflect this and not voltage (it is why we calculate 20 log and not 10 log when turning voltages to decibels). We can infer power from a series of voltage samples, but not from a single sample (there being no such thing as instantaneous power). The DFT provides the integration over time that our power inference needs. You could use any size DFT, but as the ear has an integration time of around 125 to 250ms, such block sizes best match our perception.

If you weren't calculating the DFT then you would still have to integrate your samples to get a power value. Such an integration should obviously reflect mean power not mean voltage. A simple mean does not work (for a sine wave with no dc offset it would be zero). For this reason we use RMS, first taking the mean of the squares to infer average power and then expressing the root to put that power figure back in voltage terms.

\$\endgroup\$
-1
\$\begingroup\$

You could take the logarithm of the voltage and then scale it to get the equivalent in dB re 1 V. You can get details on how to do this in an article by Olin Lathrop:

https://electronics.stackexchange.com/a/66017/312289

\$\endgroup\$
1
  • \$\begingroup\$ Of course you could do that, if you knew what is the relation between volts and sample values. But you don't know that. \$\endgroup\$
    – Justme
    Commented Nov 19, 2023 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.