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
 Deconvulsion/Separate Treatment of Rows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

verenac

Austria
3 Posts

Posted - 07/05/2011 :  10:37:15 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.5.1G and Service Release (Select Help-->About Origin): SR2
Operating System:Windows XP

Hi,

I want to use OriginLab for imported measurement date, where in every measurement cycle several frequencies are applied and the information is stored row by row. After the last frequency of the 1st cycle, the next row is filled with data from the 1st frequency of cycle 2.

Now I would like to do some frequency dependent analysis, but the data is all "mixed" and I cannot figure out an appropriate way to apply row by row commands.

For now I manually split the file into subsheets for every frequency. e.g.:
wxt test:= Col(A)==10000 ow:=10kHz

This becomes quite annoying and I am strongly looking for a better way to handle the data!

A typical Example of what I would like to achieve is:
*) Smoothing/Filtering of data from each frequency
*) Normalizing each frequency with its background value (recorded in first measurement cycles)
*) Drawing a 3D plot of normalized data with axes time-frequency-impedance

Any help is very much appreciated!
Thanks!!

Sam Fang

293 Posts

Posted - 07/05/2011 :  11:19:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can try 8.5.1's new feature Unstack Columns to separate data into columns by frequency.

Then perform smoothing and normalize for each column (You can use script to loop each column (frequency)).

Then use Stack Columns to stack frequencies into a column. And draw a 3D plot from the analyzed data.

Sam
OriginLab Technical Services
Go to Top of Page

verenac

Austria
3 Posts

Posted - 07/06/2011 :  05:14:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot Sam!
That was really useful

Unfortunately I am totally non-familiar with the OriginLab script syntax. Maybe someone could help me out with the code to loop over colums (a link to a similar example code would also be fine).

Thats what I planned to do (I know its rather pseudo-code than real OriginLab script ):

void FrequencyNormalization(Worksheet& ws, const int& fnum)
{
	new vector(fnum) normBases;	//allocate the space for a new array to store 1 double value for each frequency
	loop(i, 1, fnum)
	{
	   normBases.add(ws.Col(i)[1]); //for each column store the first value in the normBases array
	}
	loop(ii, 1, fnum)
	{
	   ws.Col(ii) /= normBases(ii); //Normalize all colums by dividing each value by the corresponding value of the normBases array
	}	
} 
Go to Top of Page

Sam Fang

293 Posts

Posted - 07/06/2011 :  06:26:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Suppose you want to normalize all columns in the current worksheet. you can run following script int Script Window.

for( int ii=1; ii<=wks.ncols; ii++)
{
    wcol(ii)=wcol(ii)/wcol(ii)[1];
}


Sam
OriginLab Technical Services
Go to Top of Page

verenac

Austria
3 Posts

Posted - 07/06/2011 :  07:16:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks again so much, Sam!
That makes total sense.
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