ICA

class nussl.separation.ica.ICA(observations_list=None, sample_rate=44100, max_iterations=None, random_seed=None, fast_ica_kwargs=None)

Bases: nussl.separation.separation_base.SeparationBase

Separate sources using the Independent Component Analysis, given observations of the audio scene. nussl’s ICA is a wrapper for sci-kit learn’s implementation of FastICA, and provides a way to interop between nussl’s AudioSignal objects and FastICA.

References

sci-kit learn FastICA

Parameters:
  • observations_list – multichannel AudioSignal object containing each observation of the mixture in each channel.
  • prepare this input_audio_signal from multiple AudioSignal objects using (Can) –
  • ICA.numpy_observations_to_audio_signal (observations) –
static numpy_observations_to_audio_signal(observations, sample_rate=44100)
Parameters:
  • observations (np.ndarray) –
  • sample_rate (int) –

Returns:

static audio_signal_observations_to_audio_signal(observations)
Parameters:observations

Returns:

run()
Returns:background (AudioSignal) – An AudioSignal object with repeating background in background.audio_data (to get the corresponding non-repeating foreground run self.make_audio_signals())

Example

make_audio_signals()

Returns the background and foreground audio signals. You must have run ICA.run() prior to calling this function. This function will return None if run() has not been called.

Returns:Audio Signals (list) – list

Example

audio_signal

Copy of the audio_signal.AudioSignal object passed in upon initialization.

Type:(audio_signal.AudioSignal)
classmethod from_json(json_string)

Creates a new SeparationBase object from the parameters stored in this JSON string.

Parameters:json_string (str) – A JSON string containing all the data to create a new SeparationBase object.
Returns:(SeparationBase) A new SeparationBase object from the JSON string.

See also

to_json() to make a JSON string to freeze this object.

plot(output_name, **kwargs)

Plots relevant data for separation algorithm

Raises:NotImplementedError – Cannot call base class
sample_rate

Sample rate of audio_signal. Literally audio_signal.sample_rate.

Type:(int)
stft_params

spectral_utils.StftParams of audio_signal Literally audio_signal.stft_params.

Type:(spectral_utils.StftParams)
to_json()

Outputs JSON from the data stored in this object.

Returns:(str) a JSON string containing all of the information to restore this object exactly as it was when this was called.

See also

from_json() to restore a JSON frozen object.