smst.models.sps module

Functions that implement analysis and synthesis of sounds using the Sinusoidal plus Stochastic Model.

In this model the signal is first modeled using the sinusoidal model. Then the residual is modeled using the stochastic model.

smst.models.sps.from_audio(x, fs, w, N, H, t, minSineDur, maxnSines, freqDevOffset, freqDevSlope, stocf)

Analyzes a sound using the sinusoidal plus stochastic model.

Parameters:
  • x – input sound
  • fs – sampling rate
  • w – analysis window
  • N – FFT size
  • t – threshold in negative dB
  • minSineDur – minimum duration of sinusoidal tracks
  • maxnSines – maximum number of parallel sinusoids
  • freqDevOffset – frequency deviation allowed in the sinusoids from frame to frame at frequency 0
  • freqDevSlope – slope of the frequency deviation, higher frequencies have bigger deviation
  • stocf – decimation factor used for the stochastic approximation
Returns:

  • hfreq, hmag, hphase: harmonic frequencies, magnitude and phases
  • stocEnv: stochastic residual

smst.models.sps.to_audio(tfreq, tmag, tphase, stocEnv, N, H, fs)

Synthesizes a sound using the sinusoidal plus stochastic model.

Parameters:
  • tfreq – sinusoidal frequencies
  • tmag – sinusoidal amplitudes
  • tphase – sinusoidal phases
  • stocEnv – stochastic envelope
  • N – synthesis FFT size
  • H – hop size
  • fs – sampling rate
Returns:

  • y: output sound
  • ys: sinusoidal component
  • yst: stochastic component