[FieldTrip] does ft_freqanalysis output single or double-sided FFT amplitudes?

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Tue May 4 09:04:17 CEST 2021


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.htm>


More information about the fieldtrip mailing list