resistics.window.parameters module¶
-
class
resistics.window.parameters.
WindowParameters
(decParams: resistics.decimate.parameters.DecimationParameters)[source]¶ Bases:
resistics.common.base.ResisticsBase
Calculates window sizes for each decimation level based on minimum allowable window size and overlap. Alternatively, users can directly set windowSizes and overlaps.
- Attributes
- decParamsfloat
Exposure in seconds.
- minSizeint
Minimum allowable window size
- minOlapint
Minimum allowable overlap
- windowFactorfloat
Window size calculated by sampling frequency / windowFactor to ensure good frequency domain resolution
- overlapFractionfloat
Overlap size as a fraction of window size
- windowsList[int], np.ndarray
List or array with window sizes for each decimation level
- overlapsList[int], np.ndarray
List or array with overlap sizes for each decimation level
Methods
__init__(decParams)
Initialise with information about the decimation parameters
getWindowSize(iDec)
Returns window size for decimation level iDec (starts at 0)
getOverlap(iDec)
Returns overlap size for decimation level iDec (starts at 0)
setWindowParameters(windowSizes, windowOverlaps)
Directly set window sizes and overlaps
setMinParams(minSize, minOverlap)
Set minimum allowable window size and overlap which will be honoured when window sizes by decimation level are automatically calculated
calcParameters(windowFactor, overlapFraction)
Calculate window and overlap sizes for each decimation level
printList()
Class status returned as list of strings
-
calcParameters
(self, windowFactor, overlapFraction) → None[source]¶ Calculate window size and overlap for each decimation level based on minimum allowable parameters (minSize, minOlap)
The window and overlap sizes (number of samples) are calculated based on the following:
Window size = frequency at decimation level / windowFactor Overlap size = Window size * overlapFraction
The window size is calculated based on the sampling frequency of the decimation level to ensure good frequency domain resolution
- Parameters
- windowFactorfloat
Window size is calculated as frequency at decimation level / windowFactor
- overlapFractionfloat
Overlap size as a fraction of the window size
-
getOverlap
(self, decLevel: int) → int[source]¶ Get window overlap for decimation level
- Parameters
- decLevelint
Decimation level
- Returns
- windowOverlapint
Window overlap for decimation level
-
getWindowSize
(self, decLevel: int) → int[source]¶ Get window size for decimation level
- Parameters
- decLevelint
Decimation level
- Returns
- windowSizeint
Window size for decimation level
-
printList
(self) → List[str][source]¶ Class information as a list of strings
- Returns
- outlist
List of strings with information
-
setMinParams
(self, minSize: int, minOlap: int) → None[source]¶ Change default minimum window size and overlap parameters
These values will be honoured when automatically calculating window sizes in calcParameters
- Parameters
- minSizeint
List of window sizes for each decimation level
- minOlapint
List of window overlaps for each decimation level
-
setWindowParameters
(self, windowSizes: List[int], windowOverlaps: List[int]) → None[source]¶ Directly set window parameters rather than calculating them out
If a user is not satisfied with the window size calculation, window parameters can be defined explicitly here
- Parameters
- windowSizesList[int]
List of window sizes for each decimation level
- windowOverlapsList[int]
List of window overlaps for each decimation level