You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sounds.rst
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -215,10 +215,12 @@ existing matplotlib.pyplot axis supplied with the :attr:`axis` argument.
215
215
.. _spectral_features:
216
216
217
217
You can also extract common features from sounds, such as the :meth:`.crest_factor` (a measure of how 'peaky'
218
-
the waveform is), or the average :meth:`.onset_slope` (a measure of how fast the on-ramps in the sound are---important
219
-
for sound localization). Features of the spectral content are bundled in the :meth:`.spectral_feature` method.
220
-
It can compute spectral centroid, flux, flatness, and rolloff, either for an entire sound (suitable for stationary
221
-
sounds), or for successive time windows (frames, suitable for time-varying sounds).
218
+
the waveform is), the average :meth:`.onset_slope` (a measure of how fast the on-ramps in the sound are---important
219
+
for sound localization), or the :meth:`.spectral_coverage` (the fraction of the spectrogram containing energy as a measure of the masking ability of a sound).
220
+
221
+
Features of the spectral content are bundled in the :meth:`.spectral_feature` method. It can compute spectral
222
+
centroid, flux, flatness, and rolloff, either for an entire sound (suitable for stationary sounds), or for
223
+
successive time windows (frames, suitable for time-varying sounds).
222
224
* The centroid is a measure of the center of mass of a spectrum (i.e. the 'center' frequency).
223
225
* The flux measures how quickly the power spectrum is changing by comparing the power spectrum for one frame against the
224
226
power spectrum from the previous frame; flatness measures how tone-like a sound is, as opposed to being noise-like, and
Generate a set of Fourier filters. Each filter's transfer function is given by the positive phase of a
303
302
cosine wave. The amplitude of the cosine is that filters central frequency. Following the organization of the
@@ -314,8 +313,9 @@ def cos_filterbank(length=5000, bandwidth=1/3, low_cutoff=0, high_cutoff=None, p
314
313
pass_bands (bool): Whether to include a half cosine at the filter bank's lower and upper edge frequency.
315
314
If True, allows reconstruction of original bandwidth when collapsing subbands.
316
315
n_filters (int | None): Number of filters. When this is not None, the `bandwidth` argument is ignored.
316
+
filter_width_factor (float): Multiplier for the width of the filters. Default is 1; use smaller values to make the filter coverage sparser (undersampled) and larger values to make it denser (oversampled).
317
317
samplerate (int | None): the samplerate of the sound that the filter shall be applied to.
318
-
If None, use the default samplerate.s
318
+
If None, use the default samplerate.
319
319
Examples::
320
320
321
321
sig = slab.Sound.pinknoise(samplerate=44100)
@@ -335,14 +335,15 @@ def cos_filterbank(length=5000, bandwidth=1/3, low_cutoff=0, high_cutoff=None, p
0 commit comments