I want to calculate the frequency amplitude asymmetry between two signals, EEG signals in particular. As a result, I expect a value ranging from 0 to 1. I have some references regarding that, but it's not clear in my mind what I have to do in order to write a correct matlab code for it. "EEG amplitude asymmetry differences were computed as a ratio of differences in absolute power between two scalp locations or (A - B/A + B)* 200 where A and B are the absolute power recorded from two different electrode locations". This is an equation I found from a paper, and this is my attempt writing a script on it

N = 2^12; % FFT points
x = EEG.data(2,1:N); %% reading data from 1st channel 
xn = x*10^-6; % multiply with 10^-6 because values are in microvolts
y = EEG.data(3,1:N); % reading data from 2nd channel 
yn = y*10^-6; % multiply with 10^-6 because values are in microvolts
Fs=250; % sampling rate
Ak1 = abs(fft(xn))/length(x); % do FFT for 1st channel(amplitude specturm) 
Ak2 = abs(fft(yn))/length(y); % do FFT for 2nd channel(amplitude specturm)
Ak1(2:N)=2*Ak1(2:N); % convert to one side spectrum
Ak2(2:N)=2*Ak2(2:N); % convert to one side spectrum
Pk1=Ak1.*Ak1; % compute power spectrum  1st channel      
Pk1=Pk1(1:N/2); % use N/2 pts in spectrum 1st channel
Pk2=Ak2.*Ak2; % compute power spectrum  2nd channel           
Pk2=Pk2(1:N/2); % use N/2 pts in spectrum 2nd channel
freqbin = round(15 / (Fs/N)); % random frequency bin
AA=(Pk1-Pk2)/(Pk1+Pk2); % amplitude asymmetry according to the equation above

Note*If I try to multiply the AA with 200 that gives me a value that is not between 0 and 1. enter image description here

Thanks in advance for any help

  • $\begingroup$ Seeing the equation AA=(Pk1-Pk2)/(Pk1+Pk2) and knowing that Pk1 and Pk2 are positive numbers, please explain why you expect the result to ranging from 0 to 1? If Pk2 is bigger than Pk1 the result can be negative. Nevertheless, I am not sure what exactly your question is? Are you asking whether your implementation is correct or why your results are not in the expected range? $\endgroup$ – Irreducible Jan 14 '20 at 7:08
  • $\begingroup$ Why do you use the FFT at all? Power can be calculated from time signal and the quote you supplied says nothing about a spectrum. $\endgroup$ – Max Jan 14 '20 at 10:08
  • $\begingroup$ What I want to do for my thesis is to calculate the features listed on the table above(I edited my question). Irreducible, yes the AA can be either negative or positive, that depends on the values of Pk1 and Pk2. Max, I am using FFT because, according to the table, these features derived from power spectrum. Generally, my question is if anyone knows anything about frequency amplitude asymmetry, because the information i have for this are not so enlightening. $\endgroup$ – Fotis Jan 14 '20 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.