ApplyGain#

class ansys.sound.core.signal_utilities.ApplyGain(signal=None, gain=0.0, gain_in_db=True)#

Applies a gain to a signal.

Class instantiation takes the following parameters.

Parameters:
signalField | FieldsContainer, default: None

Signals to apply gain on as a DPF field or fields container.

gainfloat, default: 0.0

Gain value in decibels (dB) or linear unit. By default, gain is specified in decibels. However, you can use the next parameter to change to a linear unit.

gain_in_dbbool, default: True

Whether gain is in dB. When False, gain is in a linear unit.

Methods

ApplyGain.convert_fields_container_to_np_array(fc)

Convert a DPF fields container to a NumPy array.

ApplyGain.get_output()

Get the signal with a gain as a DPF fields container.

ApplyGain.get_output_as_nparray()

Get the signal with a gain as a NumPy array.

ApplyGain.plot()

Plot the resulting signals in a single figure.

ApplyGain.process()

Apply a gain to the signal.

Attributes

ApplyGain.gain

Gain value in dB or in linear unit (depending on gain_in_db value).

ApplyGain.gain_in_db

True if input gain is in dB, or False if it is in linear unit.

ApplyGain.signal

Input signal as a DPF field or fields container.