SourceHarmonics#

class ansys.sound.core.sound_composer.SourceHarmonics(file='', source_control=None)#

Sound Composer’s harmonics source class.

This class creates a harmonics source for the Sound Composer. A harmonics source is used to generate a sound signal from a given harmonics source data and its source control. The harmonics source data consists of a series of orders whose levels depend on RPM. The source control contains the RPM values over time.

Class instantiation takes the following parameters.

Parameters:
filestr, default: “”

Path to the harmonics source data file. Supported files are the same XML and text (with the header AnsysSound_Orders) formats as supported by Ansys Sound SAS.

source_controlSourceControlTime, default: None

Source control, consisting of the control parameter values over time, to use when generating the sound from this source.

Methods

SourceHarmonics.convert_fields_container_to_np_array(fc)

Convert a DPF fields container to a NumPy array.

SourceHarmonics.get_output()

Get the generated sound as a DPF field.

SourceHarmonics.get_output_as_nparray()

Get the generated sound as a NumPy array.

SourceHarmonics.is_source_control_valid()

Source control verification function.

SourceHarmonics.load_source_harmonics(file)

Load the harmonics source data from a file.

SourceHarmonics.plot()

Plot the resulting signal in a figure.

SourceHarmonics.plot_control()

Plot the source control(s) in a figure.

SourceHarmonics.process([sampling_frequency])

Generate the sound of the harmonics source.

Attributes

SourceHarmonics.source_control

Harmonics source control.

SourceHarmonics.source_harmonics

Harmonics source data, as a DPF fields container.