Skip to content

Commit

Permalink
Merge pull request #1543 from agramfort/fix_tfr_one_epoch
Browse files Browse the repository at this point in the history
FIX : bug tfr_morlet on single epoch
  • Loading branch information
agramfort committed Aug 30, 2014
2 parents 1145db4 + 0d64bb7 commit 5a57972
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions mne/time_frequency/tests/test_tfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def test_time_frequency():
freqs = np.arange(6, 20, 5) # define frequencies of interest
n_cycles = freqs / 4.

# Test first with a single epoch
power, itc = tfr_morlet(epochs[0], freqs=freqs, n_cycles=n_cycles,
use_fft=True, return_itc=True)

power, itc = tfr_morlet(epochs, freqs=freqs, n_cycles=n_cycles,
use_fft=True, return_itc=True)

Expand Down
2 changes: 1 addition & 1 deletion mne/time_frequency/tfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def _induced_power(data, sfreq, frequencies, use_fft=True, n_cycles=7,
plf = np.empty((n_channels, n_frequencies, n_times), dtype=np.complex)

for c in range(n_channels):
X = np.squeeze(data[:, c, :])
X = data[:, c, :]
this_psd, this_plf = _time_frequency(X, Ws, use_fft)
psd[c], plf[c] = this_psd[:, ::decim], this_plf[:, ::decim]
else:
Expand Down

0 comments on commit 5a57972

Please sign in to comment.