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
 Reducing Datapoints
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Jartul

Germany
Posts

Posted - 09/19/2005 :  1:34:44 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.0
Operating System: XP


Hello everybody,
i have two columns of each about 5000 entries. Now I want to reduce them in a sensful way (the shape of the curve should be conserved) to roughly 1000. My idea was to average 5-10 rows to make a new entry. How the hell can I do that? Is this possible with origin, or do I have to play around with excel?

thx in advance
aleX

Example:
5,1
5,15
5,2 --> 5,15
5,1
5,2
next five... and so on

Mike

USA
357 Posts

Posted - 09/19/2005 :  1:54:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jartul:

If you want to take the averaging approach, you'll probably want a script. Someone may be able to help you with that. If you simply want to return every fifth data point to a new worksheet, do this:

With your worksheet active, select Analysis:Extract Worksheet Data. In the dialog box that opens, enter this in the text ("if") box:

mod(i-1, 5)==0

Click the Do it button. This should copy every 5th data point to a new worksheet.

Mike
OriginLab
Go to Top of Page

Jartul

Germany
Posts

Posted - 09/19/2005 :  2:03:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thx alot!!!
I dont need to average, so your proposal is the best and shortest way to make a nice picture out of the data points.

I bookmarked this forum, thx again...


aleX
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 09/20/2005 :  3:37:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Just as a reference...
A sample script of averaging (every 5 rows, from an active worksheet including A(X) and B(Y) may be like this...
ss=5;
%M=%h;
nn=wks.maxRows;
worksheet -b;
%N=%h;
kk=0;
for(ii=1; ii<nn; ii=ii+ss) {
kk++;
totx=0; toty=0;
for(jj=ii; jj<ii+ss; jj++) {totx=totx+%M_a[jj];toty=toty+%M_b[jj];};
%N_a[kk]=totx/ss;
%N_b[kk]=toty/ss;
}
type Original Points:$(nn), Output Rows:$(kk);


OriginC code will be also simple.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 09/20/2005 4:39:48 PM
Go to Top of Page

g4danny

USA
Posts

Posted - 09/23/2005 :  7:24:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Interesting problem, for which I used a slightly different approach.

Assume spreadsheet data In[x,y1,y2,...], the data points are not evenly spaced (dx not constant). Instead of averaging a fixed number of data points I fix the dX. The algorithm then is
Out[X,Y1,Y2,...]=Avg[In[x,y1,y2,...]; (X-dX/2)<=x<=(X+dX/2)]
For each X the procedure searches the whole input for rows, where (X-dX/2)<=x<=(X+dX/2), which can be time-costly, but with a decent PC (P4) or Mac (G4) the whole thing takes a second.

I solved this using LabVIEW. Origin script or C should do it faster than that. The strength of my approach is that it significantly reduces noise in my data.

Daniel

Edited by - g4danny on 09/23/2005 7:26:33 PM

Edited by - g4danny on 09/23/2005 7:28:06 PM
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