XtractTonal#
- class ansys.sound.core.xtract.XtractTonal(input_signal=None, input_parameters=None)#
Extract tonal components using the Xtract algorithm.
See also
Examples
Extract tonal components from a signal, and display the tonal and non-tonal components.
>>> from ansys.sound.core.xtract import XtractTonal >>> xtract_tonal = XtractTonal(input_signal=my_signal, input_parameters=my_parameters) >>> xtract_tonal.process() >>> tonal_signals, non_tonal_signals = xtract_tonal.get_output() >>> xtract_tonal.plot()
See also
- Extract tonal, transient, and noise components (Xtract)
Example demonstrating how to use Xtract to extract the various components of a signal.
Class instantiation takes the following parameters.
- Parameters:
- input_signal
Field, default:None Input signal from which to extract tonal components, as a DPF field.
- input_parameters
XtractTonalParameters, default:None Structure that contains the parameters of the algorithm:
NFFT (int) is the number of points used for the FFT computation.
Regularity setting (float) between 0 and 1.
Maximum slope (float) in dB/Hz.
Minimum duration (float) in seconds.
Intertonal gap (float) in Hz.
Local emergence (float) in dB.
This structure is of the
XtractTonalParameterstype. For more information, see this class.
- input_signal
Methods
Get the output of the tonal analysis.
Get the output of the tonal analysis as NumPy arrays.
Plot the output of the tonal analysis.
Process the tonal analysis.
Attributes
Input parameters.
Input signal from which to extract tonal components, as a DPF field.
Output non-tonal signal as a DPF field.
Output tonal signal as a DPF field.