Module audioio.audiotools
Tools for fixing audio data.
Functions
def jit(*args, **kwargs)
def despike(data, thresh=1.0, n=1)
-
Remove spikes.
If
n
data points stick out by more than a threshold, they are replaced by the mean of the two directly preceeding and succeeding data points.Parameters
data
:1D
or2D ndarray
- Data to be fixed in place.
thresh
:float
- Threshold defining a spike.
n
:int
- Maximum width of spike.
def unwrap(data, thresh=1.5, ampl_max=1.0)
-
Unwrap clipped data that are folded into the available data range.
In some amplifiers/ADCs clipped data appear on the opposite side of the input range. This function tries to undo this wrapping.
Parameters
data
:1D
or2D ndarray
offloats
- Data to be fixed in place.
thresh
:float
- Minimum difference between succeeding data points required for initiating unwrapping relative to ampl_max.
ampl_max
:float
- Maximum amplitude of the input range.