<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>Dear all;</div><div><br></div><div><div>I tried this code and it works very well. </div><div><span style="font-size: 12pt;">It's really as I would have. Thank you </span><span style="font-size: 12pt;">Emanuelle</span><span style="font-size: 12pt;"> for your help.</span></div><div>Now, the problem become more and more clear. </div><div><br></div><div>But the aim is to extract unknown information, such as frequency and phase (w and ph).</div><div>So, from an EEG signal of 500 points which I know only the amplitudes at each moment,</div><div> I need to extract the phase and the frequency and written it as: (for example)</div><div>Fp1 (t) = A1 sin (W1T + ph1) + B1 sin (W2T + ph2) + C1 sin (W2T ph3 +) + ..... + An sin (wnt + phn).</div></div><div><br></div><div><br></div><div>I hope that you understand me,</div><div><br></div><div>best regards, Ibti</div><div><br></div><div><br></div><br><br><div>> Date: Thu, 24 Oct 2013 20:53:48 -0400<br>> Subject: Re: [Eeglablist] FFT Transform<br>> From: tognoli@ccs.fau.edu<br>> To: ibtissem.khouaja@live.fr<br>> CC: eeglablist@sccn.ucsd.edu<br>> <br>> Dear Ibtissem,<br>> <br>> Do you mean the term  'C1 sin(w2t)' to be that, or were you trying to do<br>> 'C1 sin(w3t)' (it does not make sense (parsimony) to have both terms B1<br>> and C1 with the same frequency and phase and different amplitudes, unless<br>> you meant (1) the frequency term of C1 to be w3 - or (2) the 'C1'<br>> oscillation to have a different phase than B1. You'd add this phase<br>> information with terms ph1 ph2 ph3 as below (in your original equation,<br>> all three phases were set to zero).<br>> <br>> If your question is to be understood as an attempt to create pseudo-EEG in<br>> Matlab, constructed as a sum of three sinusoids of different amplitudes<br>> (A1, B1, C1), frequencies (w1, w2, w3) and phases (ph1, ph2, ph3), then<br>> please see commented example, for a 10 sec long sample.<br>> <br>> %%%%%%%%%%%%%%%%%%%%%%%make pseudo EEG in matlab<br>> <br>> Fs=1000; %the tentative sampling rate of an EEG amplifier, e.g. 1000Hz;<br>> %when chosing this, mind your Nyquist!<br>> <br>> t=0:0.001:10; %time in sec( from 0 to 10 seconds by step of 1/1000th of a<br>> sec)<br>> <br>> %%%%here your chosen parameters:<br>> A1= 1; %e.g. first oscillation has an amplitude of 1<br>> B1= 0.5; %e.g. second oscillation has an amplitude of 0.5<br>> C1= 0.2; %e.g. third oscillation has an amplitude of 0.2<br>> <br>> w1= 6; % here, for example, your first oscillation would be a theta, 6Hz<br>> w2= 10; % here alpha<br>> w3= 45; % here gamma<br>> <br>> ph1=0; % here the initial phase of your theta is 0<br>> ph2= pi; % for alpha, it is half a cycle<br>> ph3=pi/2; % gamma starts on one fourth of a cycle<br>> <br>> for i=1:length(t);<br>>     f(i)=A1*sin(2*pi*w1*t(i)+ph1) + B1*sin(2*pi*w2*t(i)+ph2) + ...<br>>     C1*sin(2*pi*w3*t(i)+ph3);<br>> end;<br>> <br>> % see the result<br>> hold on;<br>> subplot 211<br>> plot(t,f);<br>> xlim([0 0.5]);% match visualized interval to your visual display<br>> <br>> Re. previous command, remember that your screen width will be ~1000-2000<br>> pixels, your time series is already 10001 points. To prevent visual<br>> aliasing and confusion, start looking at a time interval which is<br>> reasonable for your signal. Your fastest oscillation in the example above<br>> is 45Hz, in an interval of half a second (xlim ([0 0.5])), you'd have 22.5<br>> cycles of your fastest frequency, while still retaining the ability to see<br>> the slowest one (your screen can show you three cycle of the 6Hz in half a<br>> second).<br>> <br>> <br>> % if you want to visualize the component oscillations, run:<br>> subplot 212<br>> plot(t,A1*sin(2*pi*w1*t+ph1),'r');hold on;<br>> plot(t,B1*sin(2*pi*w2*t+ph2),'g');<br>> plot(t,C1*sin(2*pi*w3*t+ph3),'b');<br>> xlim([0 0.5]);<br>> <br>> <br>> I hope that this helps.<br>> With kind regards,<br>> E.<br>> <br>> > Dear list,<br>> > To better explain my request, I want to extract three parameters:<br>> amplitude, frequency and phase in order to replicate the EEG signal and<br>> pred its progress.Then, I have to write the signal as a sum of sine<br>> wave.no matter how little is the number of sinusoids.<br>> > I hope you understand me.Thank's a lot for your help, Ibti<br>> > Subject: Re: [Eeglablist] FFT Transform<br>> > From: divide5@gmail.com<br>> > Date: Thu, 24 Oct 2013 08:25:35 +1100<br>> > To: ibtissem.khouaja@live.fr<br>> > Hi Ibti,<br>> > I'd like to help but I'm not sure if I understand what you want.Do you<br>> want to add together three different sine waves ant then do a FFT on the<br>> result?If you explain why you want to do this it may help. Also, do you<br>> want the code (Matlab, python ?) or do you want the theory?<br>> > Looking forward to finding a solution.<br>> > Alistair Walsh<br>> > On 23 Oct 2013, at 6:42 pm, Ibtissem KHOUAJA BENFRADJ<br>> > <ibtissem.khouaja@live.fr> wrote:<br>> > hello,<br>> > I am currently working on EEG signal processing.I want to write the<br>> signal<br>> > as:<br>> > f(t)= A1 sin(w1t) + B1 sin(w2t) + C1 sin(w2t)  ;<br>> > I'm looking on the net but I can't find a document that can help me.Do<br>> you<br>> > have any idea about this representation?<br>> > Thanks a lot for your help!<br>> > Regards, Ibti<br>> > _______________________________________________<br>> > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html<br>> > To unsubscribe, send an empty email to<br>> > eeglablist-unsubscribe@sccn.ucsd.edu<br>> > For digest mode, send an email with the subject "set digest mime" to<br>> eeglablist-request@sccn.ucsd.edu<br>> > --<br>> > This message has been scanned for viruses and<br>> > dangerous content by MailScanner, and is<br>> > believed to be clean.<br>> > _______________________________________________<br>> > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html<br>> > To unsubscribe, send an empty email to<br>> > eeglablist-unsubscribe@sccn.ucsd.edu<br>> > For digest mode, send an email with the subject "set digest mime" to<br>> eeglablist-request@sccn.ucsd.edu<br>> <br>> <br>> -- <br>> This message has been scanned for viruses and<br>> dangerous content by MailScanner, and is<br>> believed to be clean.<br>> <br></div>                                     </div></body>
</html>