BrainMeta'   Connectomics'  

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Calculating phase differences from wavelets, Iterative calculations take a long time!!
Orbz
post May 15, 2008, 12:30 AM
Post #1


Overlord
****

Group: Basic Member
Posts: 301
Joined: Jan 03, 2007
From: Australia
Member No.: 6770



I've written a script in Scilab (http://www.scilab.org/) to process EEG signals with wavelets. My problem is that it's taking so long to convolute the signals and then calculate the phase differences between each signal. With 30 channels (signals) it takes roughly 2 hours to calculate one 500 ms data segment at 1000 Hz sampling rate for just 6 frequencies. I need to do much more than this and at this rate its going to take a very long time to analyse one person's data set. I'm not a programmer so I don't know what I can do to speed it up. I've incorporated a RAM disk to speed up the continual read and writes and I've tried to tidy up the script as much as I can.

Is my problem just not enough processing power or can I try other things?

Briefly...
Wavelet transform (Wx) at time (translation) t and frequency (scale) f for a signal x(u):
QUOTE
Wx(t,f)=integral(-inf,+inf) x(u).Wv*(u) du


Wv is the mother wavelet, where i is sqrt(-1), o is the coefficient to modify the gaussian function inversely proportional to the frequency:
QUOTE
Wv(t,f)= sqrt(f).e^(2.i.pi.f.(u-t)).e^(-(u-t)^2/(o)^2))


The phase difference between two signals at frequency f and time t:
QUOTE
tan(theta)=(imag(z)/real(z))
z= (Wx.Wy*)/|Wx.Wy|
This is a lot of calculations when you have to compare each channel with each other channel over all time points.

I've attached the script file in .txt format change the extension to .sce to open in Scilab


Attached File(s)
Attached File  EEG_wavelet_2.txt ( 6.28k ) Number of downloads: 43
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Enki
post Jun 15, 2008, 01:27 AM
Post #2


Supreme God
*******

Group: Basic Member
Posts: 2794
Joined: Sep 10, 2004
From: Eridug
Member No.: 3458



Dear Orbz,

I think you better to look for commercial packages to propel your program.

The shortest variant is to utilize online available fast computing clusters if you have funds for that or friend who can provide for you window at a cluster.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Orbz
post Jun 16, 2008, 02:04 AM
Post #3


Overlord
****

Group: Basic Member
Posts: 301
Joined: Jan 03, 2007
From: Australia
Member No.: 6770



Several reasons for developing my own:
* I know what its doing
* I know how it works
* I can change it to suit my needs
* I can add to it to suit my needs
* I have full flexibility
* I learn about mathematical programming
* I learn about programming in general
* I understand the method more comprehensively
* Zero monetary costs
* I can say I did it myself

As it is, my programming ability has improved and the program is nothing like it used to be, it has more bells and whistles and is far more efficient and takes far less time.

A big cluster would be nice (I've been thinking of building one although not out of necessity), I currently have several computers at my disposal. This should be enough.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Enki
post Jun 17, 2008, 12:39 AM
Post #4


Supreme God
*******

Group: Basic Member
Posts: 2794
Joined: Sep 10, 2004
From: Eridug
Member No.: 3458



I see. The reasons are solid.

So if you have opportunity to mantle your own cluster then that is the best solution.

Wish you best mathematical simulations, smile.gif
Enki
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 17th November 2017 - 01:32 PM


Home     |     About     |    Research     |    Forum     |    Feedback  


Copyright BrainMeta. All rights reserved.
Terms of Use  |  Last Modified Tue Jan 17 2006 12:39 am

Consciousness Expansion · Brain Mapping · Neural Circuits · Connectomics  ·  Neuroscience Forum  ·  Brain Maps Blog
 · Connectomics · Connectomics  ·  shawn mikula  ·  shawn mikula  ·  articles