aus.synthesis

saw(freq: float, max_harmonic: int, len: int, sample_rate: int = 44100)

Generates a sawtooth tone

Parameters:
  • freq (float) – The frequency

  • max_harmonic (int) – The maximum harmonic index

  • len (int) – The length of the signal

  • sample_rate (int) – The audio sample rate

Returns:

The sawtooth signal

Return type:

np.ndarray

sine(freq: float, phase: float, len: int, sample_rate: int = 44100)

Generates a sine tone

Parameters:
  • freq (float) – The frequency

  • phase (float) – The phase

  • len (int) – The length of the signal

  • sample_rate (int) – The audio sample rate

Returns:

The sine signal

Return type:

np.ndarray

square(freq: float, max_harmonic: int, len: int, sample_rate: int = 44100)

Generates a square tone

Parameters:
  • freq (float) – The frequency

  • max_harmonic (int) – The maximum harmonic index

  • len (int) – The length of the signal

  • sample_rate (int) – The audio sample rate

Returns:

The square signal

Return type:

np.ndarray

triangle(freq: float, max_harmonic: int, len: int, sample_rate: int = 44100)

Generates a triangle tone

Parameters:
  • freq (float) – The frequency

  • max_harmonic (int) – The maximum harmonic index

  • len (int) – The length of the signal

  • sample_rate (int) – The audio sample rate

Returns:

The triangle signal

Return type:

np.ndarray