How to compute SPL from sound inputed from a microphone.

See here: How to compute SPL from sound inputed from a microphone. - #9 by mr.ogren

You are unlikely to receive a reply from mr.ogren as he only posted 2 messages to the forum about 3 years ago.

We should probably remember that the peak value of any wave is zero RMS. RMS is the area under the curve and single point peak values have no curve. 0.707 times one half the hoo-haa, do-si-do is not valid – or it is valid if the peak value is the highest point of a well-formed sine wave. If you have a complex wave then you have to get down on your hands and knees and calculate the area. You can’t depend on math tricks.

Of you could do it simply in analog land and then convert the result to digital.

Koz

Hi Koz
Have I missed something? What are you refering to?
Taking the rms of a single point does never make any sense, neither analog nor digital. However, the Rms for a complex (i.e. complicated) waveform is straightforward and really easy implemented.
There are 4 types of RMS which are facetiously
interchanged among physicians, statisticians and others.
One is defined with mean correction (=standard deviation) the other without. And both can be biased or estimated when the signal is only a portion of a longer or continuous one. Examples for a single value:

Peak-value: -0.8
Mean (DC): -0.8 (x/1)
General RMS: 0.8 [sqrt (x^2/n) ;n=1]
RMS (std-dev): 0 [sqrt((x-mu)^2/n) ;n=1)
RMS (biased/estimated std-dev): divide by 0 error [same as above but divided by n-1]

Nyquist uses the first implementation (the general, unbiased one)

(setf peak (snd-from-array 0 1 #(-0.8)))
(print (snd-fetch (rms peak 1)))

Excel has the second one, both biased and unbiased.
Math world defines the RMS as the second one (special case of power mean)
Analog devices make use of the definitions for continuous signals and apply also some “math tricks” via the built-in circuits.
Besides, the area under a curve is its integral.