mt_metadata.processing.aurora.frequency_bands
Module containing FrequencyBands class representing a collection of Frequency Band objects.
Classes
Collection of Band objects, typically used at a single decimation level. |
Module Contents
- class mt_metadata.processing.aurora.frequency_bands.FrequencyBands(band_edges=None)
Collection of Band objects, typically used at a single decimation level.
- _band_edges
DataFrame with columns [‘lower_bound’, ‘upper_bound’] containing frequency band boundaries
- Type:
pd.DataFrame
- property band_edges: pandas.DataFrame
Get band edges as a DataFrame
- property number_of_bands: int
Number of frequency bands
- property array: numpy.ndarray
Get band edges as numpy array
- sort(by='center_frequency', ascending=True)
Sort bands by specified criterion.
- Parameters:
by (str) – Criterion to sort by: - “lower_bound”: Sort by lower frequency bound - “upper_bound”: Sort by upper frequency bound - “center_frequency”: Sort by geometric center frequency (default)
ascending (bool) – If True, sort in ascending order, else descending
- bands(direction='increasing_frequency', sortby=None, rtype='list')
Generate Band objects in specified order.
- Parameters:
direction (str) – Order of iteration: “increasing_frequency” or “increasing_period”
sortby (str, optional) – Sort bands before iteration: - “lower_bound”: Sort by lower frequency bound - “upper_bound”: Sort by upper frequency bound - “center_frequency”: Sort by geometric center frequency If None, uses existing order
rtype (str) – Return type: “list” or “generator”. Default is “list” for easier reuse. Use “generator” for memory efficiency when bands are only iterated once.
- Returns:
Band objects for each frequency band, either as a list or generator depending on rtype parameter.
- Return type:
- band(i_band)
Get specific frequency band.
- Parameters:
i_band (int) – Index of band to return (zero-based)
- Returns:
Frequency band object
- Return type:
- band_centers(frequency_or_period='frequency')
Calculate center frequencies/periods for all bands.
- Parameters:
frequency_or_period (str) – Return values in “frequency” (Hz) or “period” (s)
- Returns:
Center frequencies/periods for each band
- Return type:
np.ndarray
- validate()
Validate and potentially reorder bands based on center frequencies.