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 for Programming
 LabTalk Forum
 Looping over columns using X-function fft1
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Nilsdalby

Denmark
23 Posts

Posted - 03/16/2010 :  3:11:59 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi

Im using originpro 8.0 SR6 on a windows xp platform.

A seemingly minor problem: How can i loop over all columns in a sheet and perform a fft on each column, using the x-function fft1 ? Note, the X-function fftonmultiplecolumns is named in the help but not yet defined.

Ive tried variations over A-C:

A) loop(j,2,ncols){fft1 ix=(j);};
B) for(ii=2;ii<ncols; ii++){fft1 ix=col(ii);};
C) for(ii=2;ii<4;ii++){fft1 ix=($(ii));};

I further want the result (power) to go to one sheet and to write specifications as to how the fft is performed (graphs, phase, unwrap etc.) which should count for all columns.

Suggestions are welcome, thanks

greg

USA
1378 Posts

Posted - 03/16/2010 :  4:05:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There are syntax errors in each of your looping examples which are corrected here:
// ncols is a property of wks
// don't forget to use ':=' and not just '='
// col( ) function cannot be used with variables
loop(j,2,wks.ncols) {fft1 ix:=$(j);};
for(ii=2;ii<wks.ncols; ii++){fft1 ix:=wcol(ii);};
for(ii=2;ii<4;ii++){fft1 ix:=($(ii));};

For examples of what to do within the loop, see
http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Signal_Processing#Compute_Basic_Statistics_on_FFT_Result
Go to Top of Page

schneide

Germany
45 Posts

Posted - 12/11/2014 :  04:32:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I have a very similar problem, however with an x-function requiring 2 input arguments. What's the right syntax here:

loop(ii,2,15){
differentiate iy:=(1,ii) oy:=(17,ii+16);
}
is obviously wrong, but how to do it right?

Giselher

Giselher

Edited by - schneide on 12/11/2014 04:35:46 AM
Go to Top of Page

schneide

Germany
45 Posts

Posted - 12/11/2014 :  04:45:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Seems like I found out myself, thanks to the solution to above posting

Here it is:

loop(ii,2,15){
differentiate iy:=(1,$(ii)) oy:=(17,$(ii+16)) ;
}

I thought I had tried this before and it didn't work. Obviously I had made a different error at the time

Giselher
Go to Top of Page

nguyenphucuong280193

Vietnam
1 Posts

Posted - 12/26/2014 :  10:07:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Nilsdalby,

I have a very similar problem, however with an x-function requiring 2 input arguments. What's the right syntax here:

loop(ii,2,15){
differentiate iy:=(1,ii) oy:=(17,ii+16);
}
is obviously wrong, but how to do it right?

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