nenupy.io.tf_utils.remove_channels_per_subband
- nenupy.io.tf_utils.remove_channels_per_subband(data, n_channels, channels_to_remove)[source]
Set channel indices of a time-frequency dataset to
NaNvalues. Each subband ofdatais determined thanks ton_channels(and the functionreshape_to_subbands()).- Parameters:
data (
ndarray) – Data to be corrected, must be at least two-dimensional, the first two dimensions being respectively the time and the frequencyn_channels (
int) – Number of channels per subbandchannels_to_remove (Union[
list,ndarray]) – Array of channel indices to set atNaNvalues, ifNonenothing is done anddatais returned
- Returns:
Time-frequency correlations array, shaped as the original input, except that some channels are set to
NaN.- Return type:
- Raises:
TypeError – Raised if
channels_to_removeis not of the correct type or cannot be converted to andarray.IndexError – Raised if any of the indices listed in
channels_to_removedoes not correspond to then_channelsargument.
Examples
>>> from nenupy.io.tf_utils import remove_channels_per_subband >>> import numpy as np >>> result = remove_channels_per_subband( data=np.ones((2, 10)), n_channels=5, channels_to_remove=[1, 3] ) >>> print(result) [[ 1. nan 1. nan 1. 1. nan 1. nan 1.] [ 1. nan 1. nan 1. 1. nan 1. nan 1.]]
See also