python - Improving frequency time normalization/hilbert transfer runtimes -
so bit of nitty gritty question...
i have time-series signal has non-uniform response spectrum need whiten. whitening using frequency time normalization method, incrementally filter signal between 2 frequency endpoints, using constant narrow frequency band (~1/4 lowest frequency end-member). find envelope characterizes each 1 of these narrow bands, , normalize frequency component. rebuild signal using these normalized signals... done in python (sorry, has python solution)...
and here spectrum of whitened data:
the problem is, have maybe ~500,000 signals this, , takes while (~a minute each)... entirety of time being spend doing actual (multiple) hilbert transforms
i have running on small cluster already. don't want parallelize loop hilbert in.
i'm looking alternative envelope routines/functions (non hilbert), or alternative ways calculate entire narrowband response function without doing loop.
the other option make frequency bands adaptive center frequency on filtering, progressively larger march through routines; decrease number of times have go through loop.
any , suggestions welcome!!!
example code/dataset: https://github.com/ashtonflinders/ftn_example
here faster method calculate enveloop local max:
def calc_envelope(x, ind): x_abs = np.abs(x) loc = np.where(np.diff(np.sign(np.diff(x_abs))) < 0)[0] + 1 peak = x_abs[loc] envelope = np.interp(ind, loc, peak) return envelope
here example output:
it's 6x faster hilbert. speedup more, can write cython function find next local max point , normalization local max point iteratively.
Comments
Post a Comment