[Eeglablist] FFT Transform

Ibtissem KHOUAJA BENFRADJ ibtissem.khouaja at live.fr
Fri Oct 25 09:53:28 PDT 2013


Dear all;
I tried this code and it works very well. It's really as I would have. Thank you Emanuelle for your help.Now, the problem become more and more clear. 
But the aim is to extract unknown information, such as frequency and phase (w and ph).So, from an EEG signal of 500 points which I know only the amplitudes at each moment, I need to extract the phase and the frequency and written it as: (for example)Fp1 (t) = A1 sin (W1T + ph1) + B1 sin (W2T + ph2) + C1 sin (W2T ph3 +) + ..... + An sin (wnt + phn).

I hope that you understand me,
best regards, Ibti



> Date: Thu, 24 Oct 2013 20:53:48 -0400
> Subject: Re: [Eeglablist] FFT Transform
> From: tognoli at ccs.fau.edu
> To: ibtissem.khouaja at live.fr
> CC: eeglablist at sccn.ucsd.edu
> 
> 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.
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20131025/5d0c1b1d/attachment.html>


More information about the eeglablist mailing list