iracema.spectral

Extraction of spectral information.

class iracema.spectral.STFT(time_series, window_size, hop_size, fft_len=None)[source]

Bases: iracema.core.timeseries.TimeSeries

Compute the Short-Time Fourier Transform for the time_series.

Parameters
  • time_series (TimeSeries) – Time series for applying the STFT.

  • window_size (int) –

  • hop_size (int) –

  • fft_len (int) – Length of the FFT. The signal will be zero-padded if fft_len > window_size. The default value is equal to window_size.

magnitude(power=2.0, db=False)[source]
phase()[source]
class iracema.spectral.Spectrogram(time_series, window_size, hop_size, fft_len=None, power=2.0, db=False)[source]

Bases: iracema.core.timeseries.TimeSeries

Generate spectrogram for the given time_series.

Parameters
  • time_series (TimeSeries) – Time series for applying the STFT.

  • window_size (int) –

  • hop_size (int) –

  • fft_len (int) – Length of the FFT. The signal will be zero-padded if fft_len > window_size. The default value is equal to window_size.

  • power (float) – Exponent for the spectrogram.

  • db (bool) – Whether or not to convert the output values to dB.

class iracema.spectral.MelSpectrogram(time_series, window_size, hop_size, n_mels=256, fft_len=None, power=2.0, db=False, fmin=0.0, fmax=None, htk=False)[source]

Bases: iracema.core.timeseries.TimeSeries

Compute a mel spectrogram for time_series.

Parameters
  • time_series (TimeSeries) – Time series for applying the STFT.

  • window_size (int) –

  • hop_size (int) –

  • n_mels (int) – Number of mel-scaled filters/channels.

  • fft_len (int) – Length of the FFT. The signal will be zero-padded if fft_len > window_size. The default value is equal to window_size.

  • power (float) – Exponent for the spectrogram.

  • db (bool) – Whether or not to convert the output values to dB.

  • fmin (float) – Frequency of the lowest filter.

  • fmax (float) – Frequency of the highest filter.

  • htk (bool) –

class iracema.spectral.CQT(time_series, hop_size, n_bins=84, bins_per_octave=12, hybrid=True, power=2.0, fmin=None, db=False, **kwargs)[source]

Bases: iracema.core.timeseries.TimeSeries

Compute the Constant Q Transform for time_series.

Parameters
  • time_series (TimeSeries) – Time series for applying the STFT.

  • window_size (int) –

  • hop_size (int) –

  • fft_len (int) – Length of the FFT. The signal will be zero-padded if fft_len > window_size. The default value is equal to window_size.

  • power (float) – Exponent for the spectrogram.

  • db (bool) – Whether or not to convert the output values to dB.

  • n_mels (int) – Number of mel-scaled filters/channels.

  • fmin (float) – Frequency of the lowest filter.

  • fmax (float) – Frequency of the highest filter.

  • htk (bool) –

iracema.spectral.fft(*args, **kwargs)[source]

Deprecated FFT method.

Deprecated since version 0.2.0: Deprecated method. Use STFT instead.