Utility functions

A set of utility functions that are used elsewhere in radiotool

radiotool.composer.utils.RMS_energy(frames)

Computes the RMS energy of frames

radiotool.composer.utils.equal_power(arr1, arr2)

Create an equal power blend of arr1 (fading out) and arr2 (fading in)

radiotool.composer.utils.limiter(arr)

Restrict the maximum and minimum values of arr

radiotool.composer.utils.linear(arr1, arr2)

Create a linear blend of arr1 (fading out) and arr2 (fading in)

radiotool.composer.utils.log_magnitude_spectrum(frames)

Compute the log of the magnitude spectrum of frames

radiotool.composer.utils.magnitude_spectrum(frames)

Compute the magnitude spectrum of frames

radiotool.composer.utils.normalize_features(features)

Standardizes features array to fall between 0 and 1

radiotool.composer.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.composer.utils.zero_crossing_first(frames)

Finds the first zero crossing in frames

radiotool.composer.utils.zero_crossing_last(frames)

Finds the last zero crossing in frames

Previous topic

Music novelty

This Page

Fork me on GitHub