epyr.signalprocessing.apowin

epyr.signalprocessing.apowin(window_type, n_points, alpha=None, half_window=None)[source]

Generate apodization windows for signal processing.

Apodization windows are used to reduce spectral leakage and improve signal-to-noise ratio in Fourier transform spectroscopy.

Parameters:

window_typestr

Window type: - ‘hamming’ or ‘ham’: Hamming window - ‘hann’ or ‘han’: Hann (Hanning) window - ‘blackman’ or ‘bla’: Blackman window - ‘bartlett’ or ‘bar’: Bartlett (triangular) window - ‘connes’ or ‘con’: Connes window - ‘cosine’ or ‘cos’: Cosine window - ‘welch’ or ‘wel’: Welch window - ‘kaiser’ or ‘kai’: Kaiser window (needs alpha) - ‘gaussian’ or ‘gau’: Gaussian window (needs alpha) - ‘exponential’ or ‘exp’: Exponential window (needs alpha)

n_pointsint

Number of points in the window

alphafloat, optional

Shape parameter for Kaiser, Gaussian, and Exponential windows

half_windowstr, optional

Generate half window: ‘left’ (-1 to 0) or ‘right’ (0 to 1)

Returns:

array

Normalized window values (peak = 1)

Examples:

>>> # Hamming window
>>> w = apowin('hamming', 256)
>>> # Kaiser window with beta=6
>>> w_kaiser = apowin('kaiser', 256, alpha=6)
>>> # Half Hann window (right side)
>>> w_half = apowin('hann', 128, half_window='right')