I do some product testing where it’s very convenient to record noise and then choose certain sections for analysis. I was using the Measure RMS plug-in but decided to pare it down and add what I needed to get a direct calibrated SPL answer. I did a web page on this for an intro- https://www.conradhoffman.com//Audacity%20SPL.htm It’s still a work in progress and I need to add the plug-in. Looking for feedback on whether I did everything right in the plug-in as I’m a Nyquist newbie at best.
;nyquist plug-in
;version 4
;type analyze
;name "Measure SPL"
;action "Measuring SPL level..."
;author "C. Hoffman based on Steve Daulton's Measure RMS plug-in"
;; Translations were removed and constants added
;; Plugin adds a constant to the dB measurement to convert it to SPL
;; This constant is about 105 for the iSV-1611 left (high gain) channel and about 145 for the right (low gain) channel
;; You will have to determine the constants for different mics and change them below
;; Note that USB mics will usually have constant gain but analog mics will be dependent on Windows/Audacity gain settings
;; Keep careful setup notes for analog mics so you can repeat the measurements
;; linear-to-db is a nyquist conversion
;; *SELECTION* : A variable with a list of properties relating to the current selection.
(set 'leftoffset 104.93) ; Constant to adjust left mic channel to give dB SPL directly- put your number here
(set 'rightoffset 144.8049) ; Constant to adjust right mic channel to give dB SPL directly- put your number here
(set 'monooffset 0) ; Constant to adjust mono mic channel to give dB SPL directly- put your number here
; Remove 'missing constant' note below if you use this
(setf *float-format* "%.2f") ;2 decimal places, which is one more than you really need
(let ((rms (get '*selection* 'rms)))
(if (arrayp rms)
(format nil "~a: \t~a ~a~%~
~a: \t~a ~a"
(_ "Left") (+ leftoffset (linear-to-db (aref rms 0))) (_ "dB SPL")
(_ "Right") (+ rightoffset (linear-to-db (aref rms 1))) (_ "dB SPL"))
(format nil "~a: \t~a ~a" (_ "Mono") (* monooffset (linear-to-db rms))(_ "dB SPL missing constant"))))