MCPcopy Create free account
hub / github.com/vispy/vispy / __init__

Method __init__

vispy/visuals/spectrogram.py:43–64  ·  view source on GitHub ↗
(self, x=None, n_fft=256, step=None, fs=1., window='hann',
                 normalize=False, color_scale='log', cmap='cubehelix',
                 clim='auto')

Source from the content-addressed store, hash-verified

41 """
42
43 def __init__(self, x=None, n_fft=256, step=None, fs=1., window='hann',
44 normalize=False, color_scale='log', cmap='cubehelix',
45 clim='auto'):
46 self._x = np.asarray(x)
47 self._n_fft = int(n_fft)
48 self._step = step
49 self._fs = float(fs)
50 self._window = window
51 self._normalize = normalize
52 self._color_scale = color_scale
53
54 if clim == 'auto':
55 self._clim_auto = True
56 else:
57 self._clim_auto = False
58
59 if not isinstance(self._color_scale, str) or \
60 self._color_scale not in ('log', 'linear'):
61 raise ValueError('color_scale must be "linear" or "log"')
62
63 data = self._calculate_spectrogram()
64 super(SpectrogramVisual, self).__init__(data, clim=clim, cmap=cmap)
65
66 @property
67 def freqs(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected