getSNR: Get the signal-to-noise ratio of a recording containing a...

View source: R/getSNR.R

getSNRR Documentation

Get the signal-to-noise ratio of a recording containing a single utterance and some leading or trailing noise

Description

Get the signal-to-noise ratio of a recording containing a single utterance and some leading or trailing noise

Usage

getSNR(wave, begin, end)

Arguments

wave

Required. Either a tuneR::Wave object or a valid file path to an existing wav file.

begin

Integer. The first sample in the wave to be considered part of the speech signal. If NULL (the default), will use the automatically detected value output by findSpeech(wave).

end

Integer. The last sample in the wave to be considered part of the speech signal. If NULL (the default), will use the automatically detected value output by findSpeech(wave).

Value

The signal-to-noise ratio of the recording in dB.

Examples

data("samp_wav")
fs <- findSpeech(samp_wav)
snr <- getSNR(samp_wav, fs$begin_s, fs$end_s)
snr

abbey-thomas/speechcollectr documentation built on Nov. 19, 2024, 7:09 p.m.