# Logarithming of the spectral magnitude as defined by:

#@inproceedings{Boeck2012Onset,
#   author = {Sebastian B\"{o}ck and Florian Krebs and Markus Schedl},
#   title = {Evaluating the online capabilities of onset detection methods},
#   booktitle = {Proceedings of the 13th International Society for Music Information Retrieval Conference (ISMIR'12)},
#   year = {2012},
#   pages = {49--54}
#} 


# INPUT: 	fa: output of fftArray() function
#			ctrl: control object

# OUTPUT: 	fa like in input but with modificated spectrum

specLog = function(fa, ctrl)
{
 if (ctrl$spec.log == "yes"){
  S = fa$spec
  S_log = log10(ctrl$log.lambda*S+1)
  fa$spec = S_log
  return(fa)
 } else { 
  #no logarithming
  return(fa)
  }
}