The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 organizing data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

konkicam

Canada
Posts

Posted - 05/16/2006 :  4:21:44 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 5
Operating System: Microsoft 2003

Hi,

I have compiled data into a matrix with approximately 16 000 values of time and amplitude. I want my program to read the first 4096 values, perform an fft, and then take the next 4096 values, perform an fft, etc. until it runs out of space to fill 4096 values and then I want my program to end. How should I go about this? The reason for this is to end up averaging the signal and thereby reducing the noise from the signal. Of course, the 4096 fft can be reduced.

Thanks,

Cameron

Mike Buess

USA
3037 Posts

Posted - 05/16/2006 :  9:17:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Cameron,

First you'll need to convert the matrix to a worksheet with Edit > Convert to Worksheet > Direct such that the datasets you want to FFT are columns. (If you want to do it programmatically use mat.m2w().) Use the fft object to perform the actual FFT. I can't offer more concrete advice without more information...

> Are your data real or complex?
> What will the worksheet look like? (XYXY... or XYYY...)
> If XYXY are the X (time) columns identical?
> Are you willing to signal average in the time domain? That's equivalent to averaging in freq domain and easier because you only need to FFT once.

Mike Buess
Origin WebRing Member
Go to Top of Page

konkicam

Canada
Posts

Posted - 05/17/2006 :  09:41:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for your help and here is some more information:

We are looking at electrical response of a nerve cell. We have data ranging from 0-8 seconds distributed over approx. 16 000 data points. For example at t=0 we might have an amplitude of 4 and at t= 0.002 we may have an amplitude of 4.1 etc until we reach 8 seconds. (this is not my actual data of course) The data is not complex and it is distributed in an XYXY manner. We also need to apply a window function to the data in order to reduce the noise. Is this enough data you need to answer the original question? Nevertheless, your comment about averaging in the time domain first makes perfect sense - thanks a lot,

Cameron

Cameron
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 05/17/2006 :  1:50:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
So you excite the cell and record its response for the next 8 seconds. This gives you one time(X) column and one amplitude(Y) column, each with 16000 rows. You repeat the experiment several times to get additional X,Y column pairs. All X columns are identical. If that is the case then you can average the resulting worksheet by entering the following script in the script window...

wo -d; // duplicate the active worksheet
ncols=wks.ncols; // total number of columns
for(i=4;i<=ncols;i+=2) {col(2)+=%(%H,i)}; // add all Y columns to the first Y column
ncols/=2; // number of Y columns
col(2)/=ncols; // normalize
loop(i,3,2*ncols) {del col(3)}; // delete all but first 2 columns

That will give you a worksheet with two columns, where the Y column is the average of all original Y columns and X contains their common time values. To do the fft just select the Y column and run Analysis > FFT. Origin's FFT tool has five windowing methods (see Help > Origin > Data Analysis > Fast Fourier Transform (FFT) for details.) If additional smoothing is required then plot the Y column and select Analysis > Smoothing > (pick a method) before doing the fft. Details about the smoothing methods are also available in the Origin reference.

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000