Skip to content

Refactor TimeSeries.q_transform() to support eventgrams

Created by: alurban

In the current iteration of TimeSeries.q_transform(), time-frequency tiles for several values of Q are computed and then ranged over, with the Q-plane containing the most significant tile interpolated over to produce a spectrogram, all under-the-hood. The intermediate step in this process (finding the Q-plane with the most significant tile) amounts to computing an "eventgram" for the input TimeSeries.

I propose refactoring the q_transform() method so that the eventgram is computed in a separate function (or method) and stored as an EventTable, with an option to pass it to q_transform as an argument. This would allow users to independently calculate eventgrams and Q-transform spectrograms, which is a requirement of the new Omega scan code: see here.

Computing eventgrams is likely a substantial memory leak in the new Omega scan code, since it is effectively done four times per channel as currently written -- once independently and once during a call to TimeSeries.q_transform() for the whitened timeseries, and then both are repeated for the highpassed timeseries. The proposed refactoring would go a long way towards alleviating this.

cc @duncanmmacleod, @areeda, @scottcoughlin2014