I'm trying to play signals from a speaker at varying absolute levels, however my current solution does not offer reproducible results.
First I use a B&K calibrator at 94 dB to obtain a calibration transfer factor from a microphone (assume X below is the recorded signal from an audiorecorder object):
Then I generate and play a 1s long, 1kHz tone from a given speaker and record with the now-calibrated microphone.
load([cd '\Calibration Files\1kHz_44100Hz_bpass.mat'],'Hd')
The TF or sensitivity in this case is essentially the A value for the given calLevel. My getA function is copied below.
Again, this feels round-about, but seems to MOSTLY work, however it can fluctuate a dB or more when repeated. This is a part of a very large set of GUIs that I've been developing, but this has been stumping me. There's plenty of other info to go with this, but I've tried to boil it down to the basic parts. Let me know if there's any other info that might help in solving this issue. Thanks!