[Eeglablist] FFT Transform

Emmanuelle Tognoli tognoli at ccs.fau.edu
Thu Oct 24 17:53:48 PDT 2013


Dear Ibtissem,

Do you mean the term  'C1 sin(w2t)' to be that, or were you trying to do
'C1 sin(w3t)' (it does not make sense (parsimony) to have both terms B1
and C1 with the same frequency and phase and different amplitudes, unless
you meant (1) the frequency term of C1 to be w3 - or (2) the 'C1'
oscillation to have a different phase than B1. You'd add this phase
information with terms ph1 ph2 ph3 as below (in your original equation,
all three phases were set to zero).

If your question is to be understood as an attempt to create pseudo-EEG in
Matlab, constructed as a sum of three sinusoids of different amplitudes
(A1, B1, C1), frequencies (w1, w2, w3) and phases (ph1, ph2, ph3), then
please see commented example, for a 10 sec long sample.

%%%%%%%%%%%%%%%%%%%%%%%make pseudo EEG in matlab

Fs=1000; %the tentative sampling rate of an EEG amplifier, e.g. 1000Hz;
%when chosing this, mind your Nyquist!

t=0:0.001:10; %time in sec( from 0 to 10 seconds by step of 1/1000th of a
sec)

%%%%here your chosen parameters:
A1= 1; %e.g. first oscillation has an amplitude of 1
B1= 0.5; %e.g. second oscillation has an amplitude of 0.5
C1= 0.2; %e.g. third oscillation has an amplitude of 0.2

w1= 6; % here, for example, your first oscillation would be a theta, 6Hz
w2= 10; % here alpha
w3= 45; % here gamma

ph1=0; % here the initial phase of your theta is 0
ph2= pi; % for alpha, it is half a cycle
ph3=pi/2; % gamma starts on one fourth of a cycle

for i=1:length(t);
    f(i)=A1*sin(2*pi*w1*t(i)+ph1) + B1*sin(2*pi*w2*t(i)+ph2) + ...
    C1*sin(2*pi*w3*t(i)+ph3);
end;

% see the result
hold on;
subplot 211
plot(t,f);
xlim([0 0.5]);% match visualized interval to your visual display

Re. previous command, remember that your screen width will be ~1000-2000
pixels, your time series is already 10001 points. To prevent visual
aliasing and confusion, start looking at a time interval which is
reasonable for your signal. Your fastest oscillation in the example above
is 45Hz, in an interval of half a second (xlim ([0 0.5])), you'd have 22.5
cycles of your fastest frequency, while still retaining the ability to see
the slowest one (your screen can show you three cycle of the 6Hz in half a
second).


% if you want to visualize the component oscillations, run:
subplot 212
plot(t,A1*sin(2*pi*w1*t+ph1),'r');hold on;
plot(t,B1*sin(2*pi*w2*t+ph2),'g');
plot(t,C1*sin(2*pi*w3*t+ph3),'b');
xlim([0 0.5]);


I hope that this helps.
With kind regards,
E.

> Dear list,
> To better explain my request, I want to extract three parameters:
amplitude, frequency and phase in order to replicate the EEG signal and
pred its progress.Then, I have to write the signal as a sum of sine
wave.no matter how little is the number of sinusoids.
> I hope you understand me.Thank's a lot for your help, Ibti
> Subject: Re: [Eeglablist] FFT Transform
> From: divide5 at gmail.com
> Date: Thu, 24 Oct 2013 08:25:35 +1100
> To: ibtissem.khouaja at live.fr
> Hi Ibti,
> I'd like to help but I'm not sure if I understand what you want.Do you
want to add together three different sine waves ant then do a FFT on the
result?If you explain why you want to do this it may help. Also, do you
want the code (Matlab, python ?) or do you want the theory?
> Looking forward to finding a solution.
> Alistair Walsh
> On 23 Oct 2013, at 6:42 pm, Ibtissem KHOUAJA BENFRADJ
> <ibtissem.khouaja at live.fr> wrote:
> hello,
> I am currently working on EEG signal processing.I want to write the
signal
> as:
> f(t)= A1 sin(w1t) + B1 sin(w2t) + C1 sin(w2t)  ;
> I'm looking on the net but I can't find a document that can help me.Do
you
> have any idea about this representation?
> Thanks a lot for your help!
> Regards, Ibti
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
eeglablist-request at sccn.ucsd.edu
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
eeglablist-request at sccn.ucsd.edu


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the eeglablist mailing list