Digital signal processing
Module contents
DSP
This sub-package provides all dsp algorithms.
Classes
Classes
The main class is
simsalabim.dsp.classes.Signal.
- class simsalabim.dsp.classes.Signal(data, sampling_rate, comment=None, dtype=<class 'numpy.float64'>)[source]
Bases:
objectClass for audio signals. Objects of this class contain data which is directly convertable between time and frequency domain (equally spaced samples and frequency bins).
- property comment
Get comment.
- property data
Get data.
- property dtype
The data type of the audio object. This can be any data type and precision supported by numpy.
- property duration
The duration of the signal in seconds.
- property n_samples
The number of samples.
- property sampling_rate
The sampling rate of the signal.
Utilities
Decibel
- Provides
Basic calculations with levels.
- simsalabim.dsp.decibel.dbadd(a, b)[source]
Energetic addition of levels.
- Parameters
a (float) – Single level or sequence of levels.
b (float) – Single level or sequence of levels.
Notes

Energetically adds b to a.
- simsalabim.dsp.decibel.dbmean(levels, axis=None)[source]
Energetic average of levels.
- Parameters
levels (list, nparray) – Sequence of levels.
Notes

SNR
- Provides
WADA (Waveform Amplitude Distribution Analysis) SNR calculation.
- simsalabim.dsp.snr.wada_snr(wav)[source]
Direct blind estimation of the SNR of a speech signal.
- Parameters
wav (str) – Filename of the wav file.
Notes
The function was adapted from public Matlab code by John Meade and can be found in this gist
References
- 1
Kim, Chanwoo, and Richard M. Stern. “Robust signal-to-noise ratio estimation based on waveform amplitude distribution analysis.” Ninth Annual Conference of the International Speech Communication Association. 2008.

