# Exponential smoothing of onset detection feauture

# INPUT: 	odf: onset detection feature
#			ctrl: control object

# OUTPUT: 	s.odf: smoothed odf

expSmoothing=function(odf, ctrl){
  alpha=ctrl$smooth.alpha
  l=length(odf)
  s.odf=odf[1]
  for (i in 2:l)
  {
   s.odf[i] = alpha*odf[i] + (1 - alpha) * s.odf[i-1] 
  }
  return(s.odf)
}
