Utility functions¶
A set of utility functions that are used elsewhere in radiotool
- radiotool.utils.RMS_energy(frames)¶
Computes the RMS energy of frames
- radiotool.utils.equal_power(arr1, arr2)¶
Create an equal power blend of arr1 (fading out) and arr2 (fading in)
- radiotool.utils.limiter(arr)¶
Restrict the maximum and minimum values of arr
- radiotool.utils.linear(arr1, arr2)¶
Create a linear blend of arr1 (fading out) and arr2 (fading in)
- radiotool.utils.log_magnitude_spectrum(frames)¶
Compute the log of the magnitude spectrum of frames
- radiotool.utils.magnitude_spectrum(frames)¶
Compute the magnitude spectrum of frames
- radiotool.utils.normalize_features(features)¶
Standardizes features array to fall between 0 and 1
- radiotool.utils.segment_array(arr, length, overlap=0.5)¶
Segment array into chunks of a specified length, with a specified proportion overlap.
Operates on axis 0.
Parameters: - length (integer) – Length of each segment
- overlap (float) – Proportion overlap of each frame
- radiotool.utils.zero_crossing_first(frames)¶
Finds the first zero crossing in frames
- radiotool.utils.zero_crossing_last(frames)¶
Finds the last zero crossing in frames