[FieldTrip] correction for tapers

Jack Fogarty jf752 at uowmail.edu.au
Fri May 7 10:08:18 CEST 2021


Hi Jan-Mathijs,

Thanks, by single-sided I meant 0-Nyquist scaled to account for the negative frequencies, so that was the exact information I was looking for. If you don't mind, I was also wondering if/what correction or scaling is applied to compensate for using tapers in 'ft_freqanalysis'. I can see that tapers are normalised in 'ft_specest_mtmfft' but I'm not clear on why that is or if that is related (e.g., see l.219-221 in ft_specest_mtmfft).

To be clear, could you please explain why the tapers are normalised and are any corrections applied to account for potential power lost by using tapers? In case it is relevant, in my current code I am using a Hanning taper (I actually plan to apply 10% hanning taper) with non-overlapping epochs of 2 seconds, as shown below.

    cfg = [];
    cfg.method	= 'mtmfft';
    cfg.output      = 'fourier';
    cfg.taper       	= 'hanning';    
    cfg.channel    	= 'all';
    cfg.keeptaper = 'yes';
    cfg.foi         	= [0.5:0.5:30];    % frequencies of interest, specific to mtfft

    % Run the frequency analysis and retain output for this subject
    ac_data{1,s} = ft_freqanalysis(cfg,data);

Thanks again!
Jack


Date: Tue, 4 May 2021 07:04:17 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] does ft_freqanalysis output single or
	double-sided FFT amplitudes?
Message-ID: <83DC54C9-3566-4608-8781-CED811C5FE20 at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Hi Jack,

I don’t fully understand what you mean with single- or double-sided, but the basic output from Fieldtrip is the spectrum from 0-Nyquist, where the spectral quantities are normalised with sqrt(2/nsmp); the ‘2’ is to account for the negative frequencies. The correction step that you refer to in l.846-854 is to counteract the factor 2, because the DC and Nyquist frequency bins occur only once in the FFT output.

Best wishes,
Jan-Mathijs



On 4 May 2021, at 03:41, Jack Fogarty <jf752 at uowmail.edu.au<mailto:jf752 at uowmail.edu.au>> wrote:

Hi Fieldtrip team,

Could you please clarify, do the ‘ft_freqanalysis’ or ‘ft_specest_mtmfft’ functions output data reflecting the single or double-sided fourier spectrum? The lines 846-854 in ft_freqanalysis suggests to me it should be single-sided – is that correct?

  % correct the 0 Hz or Nyqist bin if present, scaling with a factor of 2 is only appropriate for ~0 Hz
  if ~isempty(hasdc_nyq)
    if keeprpt>1
      fourierspctrm(:,:,hasdc_nyq,:) = fourierspctrm(:,:,hasdc_nyq,:)./sqrt(2);
    else
      fourierspctrm(:,hasdc_nyq,:) = fourierspctrm(:,hasdc_nyq,:)./sqrt(2);
    end
  end
  freq.fourierspctrm = fourierspctrm;


Best,

Jack Fogarty, PhD
Postdoctoral Research Officer

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!qINdjeh1UTIFU2LkaE6z2ycCzrh_BDR7bl7WEt6Hqmbio_8Nz9Gbj0hgUltzns2FdV4m09qC$

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210504/125d4258/attachment-0001.htm>

------------------------------

Subject: Digest Footer

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


------------------------------

End of fieldtrip Digest, Vol 126, Issue 3
*****************************************



More information about the fieldtrip mailing list