T O P I C R E V I E W |
konkicam |
Posted - 05/16/2006 : 4:21:44 PM 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 |
3 L A T E S T R E P L I E S (Newest First) |
Mike Buess |
Posted - 05/17/2006 : 1:50:16 PM 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 |
konkicam |
Posted - 05/17/2006 : 09:41:49 AM 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 |
Mike Buess |
Posted - 05/16/2006 : 9:17:11 PM 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 |
|
|