Back to the main page.

Bug 561 - not able to plot (topo/singleTFR nonlinear (time/freq) axis

Status CLOSED WONTFIX
Reported 2011-04-06 11:51:00 +0200
Modified 2011-09-14 14:33:48 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 normal
Assigned to: Stephen Whitmarsh
URL:
Tags:
Depends on:
Blocks:
See also:

Stephen Whitmarsh - 2011-04-06 11:51:18 +0200

> Hi John, > > Well, first of all your axes *are* not linear. You can clearly see it if > you plot e.g. plot(sub03freq_pitch{1}.time) or > plot(sub03freq_pitch{2}.freq). If you replace your time/freq axis with > something linear (e.g. [1:66], or 1:14 respectively - multiply with > samplerate etc. to get a true one) it does work. I will bring it to the > development group later this week since i wonder why it shouldn't work > with nonlinear axis. > > Perhaps the way you use the wavelets is not optimal. Given the timewindow > you have (1.3 seconds) there are only certain frequencies you can estimate > exactly. Now these are not integers. Perhaps some padding will help (to > 1.5 seconds e.g.). There are also plenty of nan's because of the > timewindow you use. see attachement. > > Considering the time axis - i dont think your samplerate permits the small > timesteps and therefor runs into rounding issues making it nonlinear. That > might be your main problem. > > hope this helps, > Stephen > > script used to make figure: > > sub03freq_pitch{1}.time = [1:1:66]; > sub03freq_pitch{1}.freq = [1:1:17]; > ft_singleplotTFR([],sub03freq_pitch{1}); > > > > > >> Hi Stephen, >> >> I apologize for not getting back to you sooner, and I very much appreciate >> the offer to help. Below, are links to data before and after I ran it >> through the code in the .m file that is attached. The ft_mulitplottfr >> works, but gives a warning about axes not being linear. The singleplottfr >> will not plot anything and warns about masknans. >> >> I would appreciate any insight you could provide. >> >> Before ft_freqanalysis: http://dl.dropbox.com/u/10557416/sub03.mat >> After ft_freqanalysis: http://dl.dropbox.com/u/10557416/sub03_freq_col.mat >> >> -John Moses >> >> On Mar 30, 2011, at 3:08 AM, Stephen Whitmarsh wrote: >> >>> Dear John, >>> Good to hear from you! >>> Could you either send me either the preprocessed or frequency data, as >>> well as the script you use to plot? So that I can reproduce the >>> bug/error. >>> >>> Best, >>> Stephen >>> >>> From: John Christopher Moses [mailto:jcmoses83@gmail.com] >>> Sent: Wednesday, March 30, 2011 8:07 AM >>> To: Stephen Whitmarsh >>> Cc: Raquel Bibi >>> Subject: Re: [FieldTrip Toolkit] Thanks and documentation >>> >>> Hi Stephen, >>> >>> I hope all is going well. I was wondering if you could help me out a >>> little bit. Raquel and I are working on the frequency analysis and we >>> are getting an error when we try to plot it. The error reads "Warning: >>> (one of the) axis are not evenly spaced -> nans cannot be masked out -> >>> cfg.masknans is set to 'no';" The code I used to do the wavelets is >>> below. If you could be of any help I would greatly appreciate it. >>> >>> -John Moses >>> >>> current = what('MANUAL_REJ/'); >>> current = current.mat; >>> for i = 1:length(current) >>> currentv(i, 1) = strrep(current(i), '.mat', ''); >>> end >>> >>> for s=1:length(current) >>> clearvars -except current s currentv >>> >>> load(['MANUAL_REJ/', current{s}]); >>> >>> % compute averages for pitch and timbre >>> for istim = 1:3 >>> cfg=[]; >>> cfg.lpfilter = 'yes'; >>> cfg.lpfreq = 40; >>> [data] = ft_preprocessing(cfg,data); >>> >>> cfg=[]; >>> cfg.keeptrials = 'yes'; >>> cfg.output = 'pow'; >>> cfg.foi = 8:2:40; >>> cfg.toi = -0.3:0.02:1.0; >>> cfg.method = 'wavelet'; >>> >>> cfg.trials = find((data.trialinfo(:,3) == 1 | >>> data.trialinfo(:,3) == 2 ) & data.trialinfo(:,4) == istim); >>> eval([currentv{s} 'freq_pitch{istim} = ft_freqanalysis(cfg, >>> data)']); >>> >>> cfg.trials = find((data.trialinfo(:,3) == 3 | >>> data.trialinfo(:,3) == 4 ) & data.trialinfo(:,4) == istim); >>> eval([currentv{s} 'freq_timbre{istim} = ft_freqanalysis(cfg, >>> data)']); >>> >>> end >>> >>> save(['FREQ/', currentv{s} '_freq_col'],[currentv{s} 'freq_*']); >>> >>> end >>>


Stephen Whitmarsh - 2011-04-08 18:24:51 +0200

You knew something more about that right?


Jan-Mathijs Schoffelen - 2011-06-22 16:03:31 +0200

I don't know anymore what this is about. @ Stephen, is this still a 'bug' to be dealt with?


Robert Oostenveld - 2011-09-14 14:33:48 +0200

I closed all the bugs that were in the status RESOLVED. This includes the ones that we just discussed in the weekly fieldtrip meeting, but also the bugs that we did not discuss.