[Eeglablist] Power Spectra - Window Type

Arnaud Delorme arno at ucsd.edu
Sat Feb 2 13:20:00 PST 2013


Dear Marco,

the default window size when using the FFT method is 1 second with 50% overlap. You may play with 'nfft' and 'epochrecur' parameters to change these default values. 'psd' which is a different option from 'fft' which uses the pwelch Matlab function. Both methods are equivalent although the scale of the signal might be different. 'fft' is faster though.
Best,

Arno

On 1 Feb 2013, at 08:03, Makoto Miyakoshi wrote:

> Dear Marco,
> 
> This is from std_spec(). Looks like the entire data are first Hamming
> windowed and then fft with window length of g.nfft.
> 
> Makoto
> 
> else % fft mode
>    if oritrials == 1 || strcmpi(g.continuous, 'on')
>        X = bsxfun(@times, X, hamming(size(X,2))');
>    end;
>    if all([ EEG.trials ] == 1) && ~isempty(boundaries),
> disp('Warning: fft does not take into account boundaries in continuous
> data'); end;
>    tmp   = fft(X, g.nfft, 2);
>    f     = linspace(0, EEG(1).srate/2, floor(size(tmp,2)/2));
>    f     = f(2:end); % remove DC (match the output of PSD)
>    tmp   = tmp(:,2:floor(size(tmp,2)/2),:);
>    X     = tmp.*conj(tmp);
>    if strcmpi(g.logtrials, 'on'),  X = 10*log10(X); end;
>    if strcmpi(g.savetrials, 'off'), X = mean(X,3); end;
>    if strcmpi(g.logtrials, 'off'),  X = 10*log10(X); end;
> end;
> 
> 
> 
> 
> 2013/2/1 Marco Montalto <mmon0006 at um.edu.mt>:
>> Dear Makoto,
>> 
>> Hamming window seems to be used when precomputing power spectra using specmode "psd" as it calls the spectopo function, which in turn calls the pwelch function. So it still remains unclear what type of window is used when specmode is set as "fft". Any suggestions?
>> 
>> Regards,
>> Marco
>> 
>> 
>> On 31 Jan 2013, at 20:12, Makoto Miyakoshi <mmiyakoshi at ucsd.edu> wrote:
>> 
>>> no worries. good luck.
>>> 
>>> Makoto
>>> 
>>> 2013/1/31 Marco Montalto <montaltomarco at onvol.net>:
>>>> Thanks Makoto for your help once again! You've been extremely kind!
>>>> 
>>>> Best regards,
>>>> Marco
>>>> 
>>>> On 31 Jan 2013, at 19:56, Makoto Miyakoshi <mmiyakoshi at ucsd.edu> wrote:
>>>> 
>>>>> Dear Marco,
>>>>> 
>>>>> Looks like this is it.
>>>>> 
>>>>> pwelch: Power Spectral Density estimate via Welch's method.
>>>>>  Pxx = pwelch(X) returns the Power Spectral Density (PSD) estimate,
>>>>>  Pxx, of a discrete-time signal vector X using Welch's averaged,
>>>>>  modified periodogram method.  By default, X is divided into eight
>>>>>  sections with 50% overlap, each section is windowed with a Hamming
>>>>>  window and eight modified periodograms are computed and averaged.
>>>>> 
>>>>> Makoto
>>>>> 
>>>>> 2013/1/30 Marco Montalto <montaltomarco at onvol.net>:
>>>>>> Dear List,
>>>>>> 
>>>>>> What type of window is used to compute power spectra, using fft, in STUDY design?
>>>>>> 
>>>>>> Thanks and regards,
>>>>>> Marco
>>>>>> _______________________________________________
>>>>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>>>>> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
>>>>>> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Makoto Miyakoshi
>>>>> JSPS Postdoctral Fellow for Research Abroad
>>>>> Swartz Center for Computational Neuroscience
>>>>> Institute for Neural Computation, University of California San Diego
>>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Makoto Miyakoshi
>>> JSPS Postdoctral Fellow for Research Abroad
>>> Swartz Center for Computational Neuroscience
>>> Institute for Neural Computation, University of California San Diego
>>> 
>> 
> 
> 
> 
> -- 
> Makoto Miyakoshi
> JSPS Postdoctral Fellow for Research Abroad
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
> 
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu




More information about the eeglablist mailing list