# AFNI Message Board

Dear AFNI users-

### https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ History of AFNI updates

|
 May 27, 2022 03:58PM Registered: 2 years ago Posts: 137
Hi Paul,

the first question would be: what do 3dPeriodogram and 1dFFT really compute – magnitude or power, as you say?
Do they compute magnitude on the y-axis, so that I have to square their results (^2) or (**2 in Python) to get power?

The description of 3dPeriodogram says:
```The result is the squared magnitude of the FFT of w(k)*data(k),
divided by P.  This division makes the result be the 'power',
which is to say the data's sum-of-squares ('energy') per unit
time (in units of 1/TR, not 1/sec) ascribed to each FFT bin.```

But I lack the understanding and knowledge to understand if that is the same as what I would compute in scipy Periodogram. It seems not to be the case, since the 3dPeriodogram PLE (slope of the linear regression) – that is to say the PLE computed based on the frequency-domain created by 3dPeriodogram – is roughly half the size of the one that I compute in scipy Periodogram or scipy Welch.

In other words: the 3dPeriodogram power spectra seem to result in a different power distribution in the frequency-domain, even though the description of 3dPeriodogram states that the result is "power".

Edit: I think I got it. [docs.scipy.org]

Scipy states that:
```Selects between computing the power spectral density (‘density’) where Pxx has
units of V**2/Hz and computing the power spectrum (‘spectrum’) where Pxx has units of V**2,
if x is measured in V and fs is measured in Hz. Defaults to ‘density’```
That would mean that I have to take the square root of the scipy results in order to obtain compareable results with the output of 3dPeriodogram, correct?

Philipp

Edited 4 time(s). Last edit at 05/27/2022 04:09PM by Philipp.
Subject Author Posted

#### 3dPeriodogram and 1dFFT - How exactly is the power computed? Philipp May 27, 2022 10:36AM

#### Re: 3dPeriodogram and 1dFFT - How exactly is the power computed?

ptaylor May 27, 2022 03:28PM

#### Re: 3dPeriodogram and 1dFFT - How exactly is the power computed?

Philipp May 27, 2022 03:58PM

#### Re: 3dPeriodogram and 1dFFT - How exactly is the power computed?

ptaylor May 27, 2022 08:52PM

#### Re: 3dPeriodogram and 1dFFT - How exactly is the power computed?

Philipp May 28, 2022 03:36AM

#### Re: 3dPeriodogram and 1dFFT - How exactly is the power computed?

ptaylor May 28, 2022 07:11AM

#### Re: 3dPeriodogram and 1dFFT - How exactly is the power computed? Philipp May 28, 2022 11:03AM

#### Re: 3dPeriodogram and 1dFFT - How exactly is the power computed?

ptaylor May 31, 2022 05:41PM

#### Re: 3dPeriodogram and 1dFFT - How exactly is the power computed?

Philipp June 01, 2022 12:24AM