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
 Frequency of event marked by time (x)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zknauss

USA
72 Posts

Posted - 07/10/2022 :  12:10:20 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2022b (64-bit) SR1
9.9.5.171 (Academic)
Windows 10

I have a set of x (time) coordinates in a column that marks the timing of a repeating event. I need to calculate the frequency of these events and the standard deviation of the frequency. I know for this data the frequency would be the inverse of the slope. My issue is I have no idea how to code this into origin in a way that can be scripted to run across a full sheet of data where each column is a separate set of events. Alternatively, there may be an app or x function that can do this that I still haven't located.

An example of the data set with time in seconds:

5.37804
16.83754
24.68402
32.63948
34.77187
44.32896
49.14643
58.80826
72.19756
84.2389
97.72541
123.05279
142.08406
149.47345
158.92527
168.75752
192.58531
212.68803
229.42557
242.29756
257.22341
260.82809
293.56944


ZTK

Edited by - zknauss on 07/10/2022 12:12:38 PM

YimingChen

1651 Posts

Posted - 07/11/2022 :  10:09:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can run a linear fit on the data (x: time values, y: the event indices). The fitting tool is in the menu Analysis->Fitting->Linear Fit. See the attached project file where the slope (frequency) and standard error is highlighted. Thank you.
https://my.originlab.com/ftp/forum_and_kbase/Images/frequency.opju

James
Go to Top of Page

aplotnikov

Germany
169 Posts

Posted - 07/11/2022 :  10:58:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Seems you need to find the mean value of time interval between the events which is reciprocal to frequency. Knowing mean and sd values for time interval you can easily obtain corresponding values for frequency.
Go to Top of Page

zknauss

USA
72 Posts

Posted - 07/11/2022 :  5:01:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is the same line of thought I was going down however as this is an intermediate step and these values will be further processed I need to get the output onto its own sheet, not in a report sheet. In other words, I need the formula below added into col(A) row [1] and then have it copied col(B:end) so that the source of the (x,y) data updates automatically. I then also want to calculate the Standard deviation of the regression in the exact same way on another sheet. I've included a project file as an example where Center Max and Peak Index act as the (x,y) inputs as well as the script I put together for creating the Frequency page (minus the slope formula). We are dealing with thousands of these data sets so scripting this out will save us huge amounts of time and lower the risk of user error. Thanks in advance for any help you can offer with this!

Page formating script:

colcopy irng:=[NCONT1PeakDat]"Center Max" orng:=[NCONT1PeakDat]<new name:=Frequency>!<new> data:=0 format:=0 lname:=0 units:=0 comments:=0 para:=0;

Slope formula to be added:

=Slope([NCONT1PeakDa1]"Center Max"!1,[NCONT1PeakDa1]"Peak Index"!1)

ZTK

Edited by - zknauss on 07/11/2022 5:02:37 PM
Go to Top of Page

YimingChen

1651 Posts

Posted - 07/11/2022 :  5:28:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you attach your project file again? don't see it.

James
Go to Top of Page

zknauss

USA
72 Posts

Posted - 07/11/2022 :  5:46:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please see attached
https://my.originlab.com/ftp/forum_and_kbase/Images/Test%20data.zip

ZTK
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