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:
- signal
Field
|FieldsContainer
, default:None
Signals to apply gain on as a DPF field or fields container.
- gain
float
, 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.
- signal
Methods
Convert a DPF fields container to a NumPy array.
Get the signal with a gain as a DPF fields container.
Get the signal with a gain as a NumPy array.
Plot the resulting signals in a single figure.
Apply a gain to the signal.
Attributes
Gain value in dB or in linear unit (depending on
gain_in_db
value).True
if input gain is in dB, orFalse
if it is in linear unit.Input signal as a DPF field or fields container.