插值在眼影数据中闪烁 - 开始/结束间隔作为时间点

发布于 2025-02-02 17:58:10 字数 877 浏览 3 评论 0原文

因此,对于我为自己解释的不良尝试,我提前道歉。我迷路了。

概括: 我正在使用R中的眼线线包装,以时间序列方式分析学生大小的数据。

我设法创建了一组间隔,闪烁启动和结束(扩展键,它们扩展了每个方向150毫秒(1000Hz)。

# Define set of intervals for blinks
Blk <- cbind(df$blinks$stime, df$blinks$etime)

# Extend blinks (100 milliseconds each way)
extendedBlinks <- Intervals(Blk) %>% expand(150, "absolute")
head(extendedBlinks)
output:

Object of class Intervals
6 intervals over R:
[4485724, 4486141]
[4485984, 4486657]
[4486549, 4486853]
[4486595, 4487040]
[4486800, 4489142]
[4498990, 4499339]

在我的数据框架中,我有PSL(左瞳孔大小),PSR(右瞳孔大小)和时间(时间)(右)和时间( 与上面的间隔相同的值。

想获得

相对于眼球行驶,我 对我有用。

# Interpolation
x1 <- c(extendedBlinks[1,1],extendedBlinks[1,2])
y1 <- c(500, 550)

interp <- approx(x1,y1, n = extendedBlinks[1,2]-extendedBlinks[1,1])
plot(interp)

似乎 问题

So, I apologise in advance for my poor attempt at explaining myself. I am rather lost.

Summary:
I am working with the eyelinker package in R to analyse pupil size data in a time-series fashion.

I have managed to create a set of intervals where blinks start and end (extendedBlinks, they extend 150 milliseconds each direction (1000Hz).

# Define set of intervals for blinks
Blk <- cbind(df$blinks$stime, df$blinks$etime)

# Extend blinks (100 milliseconds each way)
extendedBlinks <- Intervals(Blk) %>% expand(150, "absolute")
head(extendedBlinks)
output:

Object of class Intervals
6 intervals over R:
[4485724, 4486141]
[4485984, 4486657]
[4486549, 4486853]
[4486595, 4487040]
[4486800, 4489142]
[4498990, 4499339]

In my dataframe, I have PSL (Pupil Size Left), PSR (Pupil Size Right), and time (relative to the eyetracker, and has the same values as the intervals shown above.

So, I want to get the PSL/PSR (for the sake of the example, let's just stick to getting the PSL).

I've tried many things, nothing seems to work for me. I want to replace the given values in y1 with extendedBlinks[1,1] and extendedBlinks[1,2] respectively (and then iterate over the intervals to interpolate the blinks.

# Interpolation
x1 <- c(extendedBlinks[1,1],extendedBlinks[1,2])
y1 <- c(500, 550)

interp <- approx(x1,y1, n = extendedBlinks[1,2]-extendedBlinks[1,1])
plot(interp)

Again, sorry for the poorly worded question. I'll edit as I receive feedback to try and make it clearer.

Any ideas?

Cheers!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文