Bug 1791

Summary: pop_spectopo jagged spectrum
Product: EEGLAB Reporter: Maximilien Chaumon <maximilien.chaumon>
Component: GeneralAssignee: Bugzilla Manager <bugzilla-owner>
Severity: normal CC: nucleuscub
Priority: P3    
Version: _13.x   
Hardware: All   
OS: All   
Attachments: messed up
nicer looking (not use signal toolbox pwelch)

Comment 4 Ramon Martinez-Cancino 2015-08-28 10:39:37 PDT
Hi Max, 
 Good to hear that. Arno also pointed to the fact that you are using only the 5% of the data, so it makes sense that it would be quite noisy. You can go a bit high with the %.
Comment 3 Maximilien Chaumon 2015-08-28 01:21:10 PDT
Hi Ramon,
Andreas Widmann pointed me to the fact that my dataset wasn't high pass filtered. Filtering resolves the problem. But for sure, the option to use pwelch or not would be nice to have.
Comment 2 Ramon Martinez-Cancino 2015-08-27 14:41:22 PDT
Hi Maximilien, 
Thanks for your report. This spectrum looks familiar .... I think from some report in the list. I've been making some test with the default sample data we distribute with EEGLAB and there is no important difference (at least with this dataset) in the spectrum when we use pwelch or spec. Maybe the issue its just related with the parameters we are providing to pwelch and the properties of the signal. Can you share the dataset you used to generate the figure so we can try to find some cue for this issue.
 I'm thinking to  include an option in spectopo.m to use or not pwelch. This does not fix the issue.. but maybe can help.
Comment 1 Maximilien Chaumon 2015-08-27 03:17:51 PDT
Created attachment 937 [details]
nicer looking (not use signal toolbox pwelch)
Description Maximilien Chaumon 2015-08-27 03:16:42 PDT
Created attachment 936 [details]
messed up

Hi all,

Running a spectopo command on a continuous dataset as follows:
spec = pop_spectopo(EEG,1,[],'EEG','noplot','on','percent',5);
I get a terrible jagged spectrum, which looks like the image attached after zoom in.
I tried to get to the bottom of the problem and ended up looking at the point where this pwelch function from signal toolbox is called, line 918 of spectopo.m. The spectrum that comes out of it is messed up (similar to above).
So I set usepwelch to 0 on line 875 and now it works.