Data structures¶
structs
¶
Data classes for spectrogram and RSF representations.
Spectrogram
dataclass
¶
Auditory spectrogram with frequency and time axes.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Spectrogram array of shape
TYPE:
|
times
|
Time axis in seconds, length
TYPE:
|
freqs
|
Center frequencies in Hz, length
TYPE:
|
sr
|
Sample rate (Hz) of the original audio.
TYPE:
|
RSF
dataclass
¶
Rate-Scale-Frequency representation produced by the Gabor stage.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
RSF array of shape
TYPE:
|
times
|
Frame center times in seconds, length
TYPE:
|
rates
|
Temporal modulation rates in Hz, length
TYPE:
|
scales
|
Spectral modulation scales in cycles/octave, length
TYPE:
|
freqs
|
Center frequencies in Hz, length
TYPE:
|
to_numpy
¶
Return data as a numpy array, copying from the GPU if needed.
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
Host-side copy of the RSF data. |
mean_over_time
¶
Average across the time/frame axis.
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
Array of shape |
mean_over_freq
¶
Average across the frequency axis.
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
Array of shape |
upward_rates
¶
Negative-rate half of the rates axis (upward-sweeping ripples).
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
First half of |
downward_rates
¶
Positive-rate half of the rates axis (downward-sweeping ripples).
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
Second half of |
rate_scale_matrix
¶
Reduce the RSF to a 2D scale-by-rate matrix.
| PARAMETER | DESCRIPTION |
|---|---|
fold
|
If True, average the upward and downward halves into a single symmetric matrix, then mirror it back to full width so the output shape is preserved.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
Matrix of shape |
rate_scale_matrix_split
¶
Reduce the RSF to two scale-by-rate matrices, by sweep direction.
| RETURNS | DESCRIPTION |
|---|---|
tuple of np.ndarray
|
|