nenupy.io.tf_utils.reshape_to_subbands
- nenupy.io.tf_utils.reshape_to_subbands(data, n_channels)[source]
Reshape a time-frequency data array by the sub-band dimension. Given a
dataarray with one frequency axis of sizen_frequencies, this functions split this axis in two axes of sizen_subbandsandn_channels.- Parameters:
- Returns:
Data array, reshaped so that its frequency axis is split in subbands.
- Return type:
- Raises:
ValueError – Raised if
n_channelsdoes not notch the frequency dimension ofdata.
Examples
>>> from nenupy.io.tf_utils import reshape_to_subbands >>> import numpy as np >>> data = np.arange(3*10).reshape((3, 10)) >>> result = reshape_to_subbands(data, 5) >>> result.shape (3, 2, 5)