[WIP] Adding functionality for tfr_array_stft and tfr_stft#8892
[WIP] Adding functionality for tfr_array_stft and tfr_stft#8892adam2392 wants to merge 4 commits intomne-tools:mainfrom
Conversation
|
thinking about it we have an STFT from the TF-MxNE solver. This stft implementation uses what do you think @larsoner ? |
|
I think eventually we want to replace the TF-MxNE version anyway, so I don't think there is a big difference. One advantage of our version is that it preserves power properly, whereas the SciPy version doesn't (it does on round trip, just not between time and time-frequency representations), there is an issue about it: So I actually don't mind using our internal version to start and then hopefully eventually just changing its internal calls to use |
|
the round trip is quite import for TF-MxNE solver but not really otherwise.
if the scipy code much faster? if so I would really encourage to use this
one.
… |
I haven't checked but, having looked at your code, I wouldn't expect there to be large differences between the two |
|
Should I leave things as is and add a note to change things once scipy implementation has been fixed? |
|
|
||
| for epochidx in range(n_epochs): | ||
| # compute STFT | ||
| power = _stft(data[epochidx, ...], window_size=window_size, |
There was a problem hiding this comment.
I doubt the stft returns power by default. It should output complex valued data. Can you check?
also I would see if I can preallocate the power_list as a numpy array before the for loop to avoid doubling the RAM usage.
|
|
||
| @fill_doc | ||
| def tfr_stft(inst, window_size, step_size=None, average=True, verbose=None): | ||
| """Compute STFT Short-Term Fourier Transform using a sine window. |
There was a problem hiding this comment.
I think you meant Short-Time Fourier Transform here.
Reference issue
Closes: #8880
Need to implement unit tests.
What does this implement/fix?
Implements
tfr_array_stftandtfr_stftwhich operate on numpy arrays and mne-python objects respectively.Deprecates
stftin favor oftfr_array_stft.Additional information
No parallelizations across channels because felt that could be saved for a later PR.