T O P I C R E V I E W |
Jartul |
Posted - 09/19/2005 : 1:34:44 PM 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 |
4 L A T E S T R E P L I E S (Newest First) |
g4danny |
Posted - 09/23/2005 : 7:24:52 PM 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 |
Hideo Fujii |
Posted - 09/20/2005 : 3:37:43 PM 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 |
Jartul |
Posted - 09/19/2005 : 2:03:41 PM 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 |
Mike |
Posted - 09/19/2005 : 1:54:20 PM 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 |
|
|