3

I understand that a sine wave with an effective value of 1 Pa corresponds to a Sound Pressure Level (SPL) of 94 dB. However, when I perform a Fourier Transform on such a sine wave with amplitude of $\sqrt{2}$, the FFT result shows a peak of $\frac{\sqrt{2}}{2}$, which corresponds to a SPL of 91 dB. I'm having difficulty reconciling these two observations.

How can I reconcile the FFT peak value with the SPL in dB?

Simple matlab code:

fs = 48e3;
f = 1000;
t = (0:fs-1)/fs;
x = sqrt(2)*sin(2*pi*f*t).';
X = fft(x);
X = X / length(X);
plot(mag2db((abs(X)/2e-5)))
DSP novice
  • 527
  • 2
  • 10

1 Answers1

4
  1. Why the sqrt(2)?
  2. You need to account for the fact that the DFT is conjugate symmetric, and that the energy is split in the double-sided spectrum between the negative frequencies and corresponding positive frequencies (see this answer).
    As such, to preserve energy, you need to scale the result by 2 (see also):
fs = 48e3;
f = 1000;
t = (0:fs-1)/fs;
x = sin(2*pi*f*t).';
X = fft(x);
X = X / length(X);

% keep positive frequencies L = length(X); X = X(1:L/2+1); % L even % X = X(1:(L+1)/2); % L odd

% scale positive frequencies (remember matlab does not have 0-index) X(2:end-1) = 2X(2:end-1); % L even: do not scale X[0] AND X[L/2] % X(2:end) = 2X(2:end); % L odd: do not scale X[0] plot(mag2db((abs(X)/2e-5)))

Jdip
  • 5,980
  • 3
  • 7
  • 29
  • Because the effective value is the peak value divided by $\sqrt{2}$. If I need a 94 dB sine wave, it will have a unit effective value and thus a peak value of $\sqrt{2}$.
  • – DSP novice Aug 29 '23 at 08:34
  • The DFT does not care about "effective value". The amplitude $A$ of the sine to get SPL level $A_{SPL} \texttt{dB}$ is $p_{ref} * 10^{A_{SPL}/20}$. With $A_{SPL} = 94$, that's $A = 1.0024$ for example. $A = 1$ gives $\approx 93.98 \texttt{dB}$ – Jdip Aug 29 '23 at 08:44
  • In acoustics, 1 Pa -> 94 dB is a reasonable approximation. Thank you I think I understand the problem. DFT essentially decomposes a signal into a sum of complex exponentials, and it might be easier to understand if we consider the DFT's basis functions as sine and cosine instead of complex exponentials. A sine wave with an amplitude of 1, when decomposed through DFT using sine and cosine as basis functions, would essentially represent itself with amplitude of 1. Therefore, when you calculate the dB level for this amplitude of 1, it naturally corresponds to 94 dB. – DSP novice Aug 29 '23 at 08:47
  • That's exactly right @DSPnovice – Jdip Aug 29 '23 at 09:01
  • "A sine wave with an amplitude of 1, when decomposed through DFT using sine and cosine as basis functions, would essentially represent itself with amplitude of 1.". AFAIK, that's only true if you fall exactly on a bin frequency. If your sine wave frequency falls between two bins (e.g. middle), this could be reduced in a way that's not necessarily negligible depending on your application. (This may depend on windowing and correction factors applied.) – Bruno Aug 29 '23 at 18:35
  • 1
    I think the point that OP is trying to make is the fact that both acoustic and reference acoustic pressure are RMS values in pascals. So having a sine wave with an amplitude of 1 Pa would give you a level of ~91 dB SPL. The whole point of scaling the FFT to RMS values or a signal itself is the fact that you can easily calculate the SPL from an audio file. You would get the RMS and add the AOP (Acoustic Overload Point) of your audio chain and this gives you the SPL. – jojeck Aug 29 '23 at 18:48
  • @Bruno Yes, I understand that. Thank you for pointing that out. – DSP novice Aug 30 '23 at 01:50
  • @jojeck I'm trying to figure out how to calculate SPL from a sound wave in the frequency domain. It maybe refers to the spectral analysis function of some high-end sound level meters. – DSP novice Aug 30 '23 at 01:54