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
 All Forums
 Origin Forum
 Origin Forum
 Frequency of event marked by time (x)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
zknauss Posted - 07/10/2022 : 12:10:20 PM
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
5   L A T E S T    R E P L I E S    (Newest First)
zknauss Posted - 07/11/2022 : 5:46:30 PM
Please see attached
https://my.originlab.com/ftp/forum_and_kbase/Images/Test%20data.zip

ZTK
YimingChen Posted - 07/11/2022 : 5:28:31 PM
Can you attach your project file again? don't see it.

James
zknauss Posted - 07/11/2022 : 5:01:38 PM
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
aplotnikov Posted - 07/11/2022 : 10:58:04 AM
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.
YimingChen Posted - 07/11/2022 : 10:09:09 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000