an R version of the SoundPoints algorithm