vispy.visuals.spectrogram module#

class vispy.visuals.spectrogram.SpectrogramVisual(x=None, n_fft=256, step=None, fs=1.0, window='hann', normalize=False, color_scale='log', cmap='cubehelix', clim='auto')#

Bases: ImageVisual

Calculate and show a spectrogram

Parameters:
xarray-like

1D signal to operate on. If len(x) < n_fft, x will be zero-padded to length n_fft.

n_fftint

Number of FFT points. Much faster for powers of two.

stepint | None

Step size between calculations. If None, n_fft // 2 will be used.

fsfloat

The sample rate of the data.

windowstr | None

Window function to use. Can be 'hann' for Hann window, or None for no windowing.

normalizebool

Normalization of spectrogram values across frequencies.

color_scale{‘linear’, ‘log’}

Scale to apply to the result of the STFT. 'log' will use 10 * log10(power).

cmapstr

Colormap name.

climstr | tuple

Colormap limits. Should be 'auto' or a two-element tuple of min and max values.

property color_scale#

The color scale

property freqs#

The spectrogram frequencies

property fs#

The sampling frequency

property n_fft#

The length of fft window

property normalize#

The normalization setting

property step#

The step of fft window

property window#

The used window function

property x#

The original signal