aus.plot

plot_audio(audio: np.ndarray)

Visualizes audio using matplotlib. :param np.ndarray audio: A numpy array of audio samples

plot_spectrogram(audio: np.ndarray, sample_rate: int, window_size: int = 1024)

Plots FFT data.

Parameters:
  • audio (np.ndarray) – A 1D array of audio samples

  • sample_rate (int) – The sample rate of the audio

  • window_size (int) – The window size that will be analyzed

plot_spectrum(spectrum, sample_rate, frequency_range=None)

Plots FFT data. The FFT data should be in original imaginary form. It will be converted to a normalized power spectrum in decibels.

Parameters:
  • spectrum (np.ndarray) – An imaginary spectrum to plot

  • sample_rate (int) – The sample rate (for determining frequencies)

  • frequency_range – If not None, only the frequencies within this range will be plotted.