smst.models.spr module¶
Functions that implement analysis and synthesis of sounds using the Sinusoidal plus Residual Model.
-
smst.models.spr.
from_audio
(x, fs, w, N, H, t, minSineDur, maxnSines, freqDevOffset, freqDevSlope)¶ Analyzes a sound using the sinusoidal plus residual 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
Returns: hfreq, hmag, hphase: harmonic frequencies, magnitude and phases; xr: residual signal
-
smst.models.spr.
to_audio
(tfreq, tmag, tphase, xr, N, H, fs)¶ Synthesizes a sound using the sinusoidal plus residual 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