Module quantum_inferno.styx_stx
" Standardized Stockwell transform (stx) with optimization parameters After Moukadem et al., 2022, A new optimized Stockwell transform applied on synthetic and real non-stationary signals Rederivation in preparation, Garces et al. 2022; last updated 9 May 2022
Functions
def sig_pad_up_to_pow2(sig_wf: numpy.ndarray, n_fft: int, verbosity: bool = False)
-
Zero-pad signal to the higher 2**n points for FFT
:param sig_wf: waveform to add zero padding :param n_fft: length of fft :param verbosity: if True, outputs additional debugging statements :return: waveform with zero padding, length of fft to nearest greater power of 2, number of points added
def stx_complex_any_scale_pow2(band_order_nth: float, sig_wf: numpy.ndarray, frequency_sample_rate_hz: float) ‑> Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
-
With some assumptions and simplifications, and with some vectorization
:param band_order_nth: Fractional octave band - revisit :param sig_wf: input signal with 2^M points :param frequency_sample_rate_hz: sample rate in Hz :return: frequency_stx_hz, time_stx_s, tfr_stx
def tfr_stx_fft(sig_wf: numpy.ndarray, time_sample_interval: float, scale_order_input: float = 8.0, n_fft_in: int = None, frequency_min: float = None, frequency_max: float = None, frequency_step: float = None, factor_q: float = 0.0, power_p: float = 0.0, power_r: float = 1.0, is_geometric: bool = False, is_inferno: bool = False, scale_base_input: float = 1.9952623149688795, scale_ref_input: float = 1.0) ‑> Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]
-
Stockwell transform, fft implementation. Optimized version has more free variables in sigma_scaling; testing in progress
:param sig_wf: input waveform. If not 2**n points, it will zero pad up :param time_sample_interval: sample interval, inverse of sample rate :param scale_order_input: fractional octave band order; 12 is the musical standard :param n_fft_in: requested nfft, should be greater or equal to the signal length. Method zero pads up. :param frequency_min: lowest stx frequency of interest :param frequency_max: highest stx frequency of interest :param frequency_step: stx frequency of interest if linearly sampled :param factor_q: sigma_scaling adjustment, under evaluation :param power_p: sigma_scaling adjustment, under evaluation :param power_r: sigma_scaling adjustment. under evaluation :param is_geometric: are frequencies geometrically spaced? If so, overrides frequency_step :param is_inferno: are frequencies geometrically spaced and standardized as in inferno? :param scale_base_input: scale base; default is base 10, base 2 octaves is scales.Slice.G2 :param scale_ref_input: scale reference time; default is 1 s :return: tfr_stx, psd_stx, frequency_stx_hz, frequency_stx_fft, windows_fft