Learn R Programming

soundgen (version 1.7.0)

parabPeakInterpol: Parabolic peak interpolation

Description

Internal soundgen function

Usage

parabPeakInterpol(threePoints, plot = FALSE)

Arguments

plot

if TRUE, plot the points and the fit parabola

points

the amplitudes of three adjacent points (beta is the peak), ideally spectrum on a dB scale, obtained with a Gaussian window

Value

Returns a list: $p = the correction coefficient in bins (idx_beta + p gives the true peak), $ampl_p = the amplitude of the true peak

Details

Takes a spectral peak and two adjacent points, fits a parabola through them, and thus estimates true peak location relative to the discrete peak. See https://ccrma.stanford.edu/~jos/sasp/Quadratic_Interpolation_Spectral_Peaks.html

Examples

Run this code
# NOT RUN {
soundgen:::parabPeakInterpol(c(-1, 0, -4), plot = TRUE)
# }

Run the code above in your browser using DataLab