aspen.processings.apply_ramp

Apply ramp function

Functions

apply_ramp(x[, duration, wfunction, …])

Apply ramp function to a given signal.

Classes

ApplyRamp([apply_ramp_duration, …])

Apply ramp function to a given signal.

class aspen.processings.apply_ramp.ApplyRamp(apply_ramp_duration=0.0, apply_ramp_wfunction='hann', apply_ramp_position='both', samp_freq=16000)[source]

Bases: aspen.interfaces.abs_common_interface.AbsCommonInterface, aspen.interfaces.abs_processing_interface.AbsProcessingInterface

Apply ramp function to a given signal.

Parameters
  • x – Input signal

  • apply_ramp_duration (float) – Duration of ramp function in millisecond. Defaults to 0.0.

  • apply_ramp_wfunction (str) – Ramp function. wfunction can apply some functions which are listed in Scipy doc or linear function. (https://docs.scipy.org/doc/scipy/reference/signal.windows.html) Defaults to “hann”.

  • apply_ramp_position (str) – Position of application for ramp function. onset, offset and both are able to be applied. Defaults to “both”.

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

__call__(x)[source]

Apply ramp

Parameters

x (ndarray) – Input signal

Return type

ndarray

Returns

Output signal

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__

aspen.processings.apply_ramp.apply_ramp(x, duration=0.0, wfunction='hann', position='both', samp_freq=16000)[source]

Apply ramp function to a given signal.

Parameters
  • x (ndarray) – Input signal

  • duration (float) – Duration of ramp function in millisecond. Defaults to 0.0.

  • wfunction (str) – Ramp function. wfunction can apply some functions which are listed in Scipy doc or linear function. (https://docs.scipy.org/doc/scipy/reference/signal.windows.html) Defaults to “hann”.

  • position (str) – Position of application for ramp function. onset, offset and both are able to be applied. Defaults to “both”.

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

Return type

ndarray

Returns

Output signal