Vesper - Confidential
9
Here, one audio vector (
AudioRecording
) includes both
Silence Recording
&
Speech Recording.
Start/stop time of each recording marked with:
silenceStart
,
silenceEnd
,
speechStart
,
speechEnd
Code start:
audio_filtered = bandpass(AudioRecording, [120 2000], Fs,
'ImpulseResponse'
,
'iir'
,
'Steepness'
,[0.8 0.8]);
RMSnoise = rms(audio_filtered(silenceStart*Fs:silenceEnd*Fs));
RMStotal = rms(audio_filtered(speechStart*Fs:speechEnd*Fs));
RMSvoice = sqrt(RMStotal^2 - RMSnoise^2);
SNRva1200 = 20*log10(RMSvoice/RMSnoise);
Signal Quality Check:
Part 2/3 – Example MATLAB code
Compute RMS of
Silence Recording
Noise,
RMS
noise
Calculate Voice RMS from previous two results
RMS
voice
= sqrt(
RMS
total
2
–
RMS
noise
2
)
Calculate SNR in dB
SNR
dB
= 20·log
10
(
RMS
voice
/
RMS
noise
)
Compute RMS of
Speech Recording
Total Noise + Speech,
RMS
total
Bandpass both recordings with a bandpass filter
(120Hz - 2kHz, 30dB/octave)