# freqanalysis_wltconvol.m question

Jan Mathijs Schoffelen Jan.Schoffelen at FCDONDERS.RU.NL
Thu Nov 9 10:10:53 CET 2006

```Hi Brian,

The multiplication with 2 and the division by the sampling rate achieves a
proper normalization and should be included. The factor 2 is coming from the
fact that the power at a specific frequency is estimated at both the
frequency itself and its negative counterpart. The division by the number of
samples ensures that the total power (summed across all computable
frequencies, so between 0 and Nyquist) will be equal to the total variance
of the time-domain signal.

Yours,

Jan-Mathijs

_____

From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Brian Roach
Sent: Wednesday, November 08, 2006 9:20 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: [FIELDTRIP] freqanalysis_wltconvol.m question

Hi,

In the freqanalysis_wltconvol.m function, the FFT of zero-padded eeg or MEG
data and the FFT of the wavelets at various frequencies of interest are
convolved and the inverse FFT of that result is used to calculate power in
this manner on line 283:
powdum = (2.* abs(autspctrmacttap)  ./ data.fsample) .^ 2;
here, autspctrmacttap corresponds to the complex output from the call to
ifft.
In previous e-mail Jan-Mathijs has mentioned that the abs of the complex
data gets you amplitude, so I am wondering why it gets multiplied by 2 and
divided by the sampling rate before being squared since power = amplitude^2.
I am wondering how important it is to multiply by 2 and divide by the AD
rate because I would like to take this complex output and use it to
calculate phase-locking factor, but I am not sure what parts of the power
transformation need to be removed - just the abs() and the squaring?
Clarification of this line of code would be extremely helpful to me.

Thanks,
Brian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20061109/f4f72e8c/attachment-0002.html>
```