[FieldTrip] [EXT] Re: Amplitude of power (ft_freqanalysis) (Hoffman, Steven)

Govindan, Rathinaswamy rgovinda at childrensnational.org
Wed Nov 27 15:03:02 CET 2019


Dear Steven:
Here is my explanation:
Spectral power is a quantification of the variance in a signal. For example, consider a sine wave with amplitude 'a' and frequency 'f' (in your case a = 5 and f = 20 Hz):
x = a sin(2*pi*f * t) ;

Calculate power as follows:
F = fft(x-mean(x))/sqrt(length(x));%note the subtraction of mean of x is NOT needed in this step since the mean of x is zero.

P = abs(F).^2;% power has a unit of amp^2/Hz

The area under the curve of P vs frequency should be equal to the variance of the sine wave. That's mean(P) should be equal to var(x). You can analytically demonstrate that the variance of a sine wave with amplitude 'a' is a*a/2. Hint: 1/(2*pi)  int_0^2pi a^2 sin^2(x) dx = a^2/2. (i.e.) 1/(2*pi) integral of (a sin(x))^2 dx within the limits of 0 to 2pi.
The variance of the sine wave you had simulated is 12.5 and the spectral power correctly reflects this values. Hope this helps.

Best regards,

RB


R. B. Govindan, PhD
Staff Scientist III
Division of Fetal and Transitional Medicine
Children’s National Hospital
111 Michigan Avenue, NW, 3118C
Washington, DC, 20010

Office:
202-476-5309

www.childrensnational.org

Join us on Facebook, Twitter, YouTube, and
Instagram! 

On 11/27/19, 3:52 AM, "fieldtrip on behalf of Antoine Ducorps" <fieldtrip-bounces at science.ru.nl on behalf of antoine.ducorps at orange.fr> wrote:

    ATTENTION: External Email! Do not click attachments/links unless sender is known.
    
    ----------------------------------------------------------------------
    Dear Steven,
    
    The true reason of the formula Amp^2 / 2 is that the power estimation is the one of a continuous signal giving the same power. For example, the power you get from the alternating power line (rated as 220v in Europe) is the one you would get from a DC voltage of that amplitude (220v) when driving it though your device (eg simple resistor as a heater). As such, the amplitude of the 220v alternating  voltage is not 220v but 311v (220 x square root of 2).
    Another way to see it is that the power is the integral of the the signal, i.e. the area « under »  the sinewave, which is clearly not the area you would get under of a DC line of same amplitude (5v in your case).
    Hoping this helps,
    
    	Antoine.
    
    
    >   2. Amplitude of power (ft_freqanalysis) (Hoffman, Steven)
    >   3. Re: Amplitude of power (ft_freqanalysis) (STEPHAN MORATTI)
    >   4. Re: Amplitude of power (ft_freqanalysis) (antonio ivano triggiani)
    >   5. Question about loading in ERP data (Amna Hyder)
    >   6. Re: Question about loading in ERP data (Julian Keil)
    >   7. Re: Question about loading in ERP data (Amna Hyder)
    >   8. Re: Question about loading in ERP data (Amna Hyder)
    > 
    > 
    > Message: 2
    > Date: Tue, 26 Nov 2019 20:34:30 +0000
    > From: "Hoffman, Steven" <steven.hoffman5 at montana.edu>
    > To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
    > Subject: [FieldTrip] Amplitude of power (ft_freqanalysis)
    > Message-ID:
    > 	<BN6PR02MB254842716B1ED5A80DB18FABB7450 at BN6PR02MB2548.namprd02.prod.outlook.com>
    > 	
    > Content-Type: text/plain; charset="iso-8859-1"
    > 
    > 
    > To whom may be able to help me out,
    > 
    > We were trying to recover the actual amplitude units for our power spectra, and I noticed something interesting in the output from FieldTrip. I ran a simulation where I take a 20Hz sine wave of +/- 5 "Volts", and calculate the power on it (Using the mtfft method). What we expected the amplitude to be was 25 (since power is the V^2 /Hz). However FieldTrip gave a value closer to about 12 V for the amplitude.
    > 
    > I then calculated the power spectra of the simulated +/- 5 "Volt" sine wave using the Matlab built in "periodogram.m" function. This too yielded an amplitude not of 25, but of 12.5 .
    > 
    > After some digging I found some documentation in the matlab that said that the units of the power spectra were actually (Amp ^2 / 2) . So in this case that makes sense as (5^2/2 = 12.5).
    > 
    > My question is why the divide by two? I don't think I've ever seen amplitude expressed this way, its always V^2 / Hz ...
    > 
    > Attached are figures of my matlab simulations (One for Field Trip, and for matlab's periodogram.m), and the snippet from the Matlab documentation for periodogram.m where it talks about amplitude being Amp^2 / 2.
    > 
    > 
    
    
    _______________________________________________
    fieldtrip mailing list
    https://urldefense.com/v3/__https://mailman.science.ru.nl/mailman/listinfo/fieldtrip__;!!FMDslA!KSkmyCltEIesjvnhy9X8jV-xYdJP6vGQJ8lOtEfeKyw6pz40X0juTxR77_yhKC3v8sQ0sDM$ 
    https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!FMDslA!KSkmyCltEIesjvnhy9X8jV-xYdJP6vGQJ8lOtEfeKyw6pz40X0juTxR77_yhKC3vM9q0SoI$ 
    


Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.



More information about the fieldtrip mailing list