aspen.stimuli.modulation_filtered_speech

Modulation-filtered speech

Classes

ModulationFilteredSpeech([samp_freq, …])

Generate modulation-filtered speech.

class aspen.stimuli.modulation_filtered_speech.ModulationFilteredSpeech(samp_freq=16000, temporal_stopbands='100_200', spectral_stopbands='100_200', spec_samp_freq=1000, gauss_window_alpha=3, spacing_freq=50, spec_standardize=False, spec_db_range=- 1, griffinlim_iter=20)[source]

Bases: aspen.interfaces.abs_common_interface.AbsCommonInterface, aspen.interfaces.abs_stimulus_interface.AbsStimulusInterface

Generate modulation-filtered speech.

Parameters
  • samp_freq (int) – Sampling frequency. Defaults to 16000.

  • temporal_stopbands (str) – Lower & upper temporal modulation frequency of bandstop. Defaults to “100_200”.

  • spectral_stopbands (str) – Lower & upper spectral modulation frequency of bandstop. Defaults to “100_200”.

  • spec_samp_freq (int) – Sampling frequency in spectrogram space in Hz. The value determines the width of Gaussian window shift to calculate the spectrogram. Defaults to 1000.

  • gauss_window_alpha (float) – Width factor of Gaussian window. The value is inversely proportional to the width of the window. (ref: https://www.mathworks.com/help/signal/ref/gausswin.html) Defaults to 3.

  • spacing_freq (int) – The time-frequency scale for the spectrogram in Hz. This value determines the width of the Gaussian window to calculate spectrogram. Defaults to 50.

  • spec_standardize (bool) – Spectrogram normalize. Defaults to False.

  • spec_db_range (float) – The range of narrowing down the spectrogram amplitude. Defaults to -1 (without narrowing).

  • griffinlim_iter (int) – Number of iteration for Griffin-Lim algorithm Defaults to 20.

__call__(x)[source]

Generate modulation-filtered speech.

Parameters

x (Sequence[ndarray]) – Speech signal. x must be sequence-like object such as list, tuple and so on.

Return type

ndarray

Returns

Stimulus of modulation filtered speech.

static add_arguments(parser)[source]

add arguments

classmethod load_class_kwargs(args)

Return the kwargs dict for class __init__ from parsed arguments

Parameters

args (Namespace) – (config)argparse arguments

Return type

dict

Returns

kwargs for class __init__