Tôi bị cuốn hút bởi dữ liệu cảm biến. Tôi đã sử dụng iPhone của mình và một ứng dụng có tên SensorLog để chụp dữ liệu gia tốc trong khi tôi đứng và đẩy chân tôi để nhảy.Sử dụng dữ liệu gia tốc R và cảm biến để phát hiện một bước nhảy
Mục tiêu của tôi là sử dụng R để tạo mô hình có thể xác định số lần nhảy và thời gian tôi ở trong không khí. Tôi không chắc chắn cách tiến hành thử thách như vậy. Tôi có một bộ đếm thời gian với dữ liệu gia tốc kế.
https://drive.google.com/file/d/0ByWxsCBUWbqRcGlLVTVnTnZIVVk/view?usp=sharing
Một số câu hỏi:
- Làm thế nào có thể một bước nhảy được phát hiện trong dữ liệu chuỗi thời gian?
- Cách xác định phần thời gian phát sóng?
- Làm thế nào để đào tạo một mô hình như vậy?
Dưới đây là mã R sử dụng để tạo ra các đồ thị trên, đó là tôi đứng và làm một bước nhảy đơn giản.
Cảm ơn!
# Training set
sample <- read.csv("sample-data.csv")
# Sum gravity
sample$total_gravity <- sqrt(sample$accelerometerAccelerationX^2+sample$accelerometerAccelerationY^2+sample$accelerometerAccelerationZ^2)
# Smooth our total gravity to remove noise
f <- rep(1/4,4)
sample$total_gravity_smooth <- filter(sample$total_gravity, f, sides=2)
# Removes rows with NA from smoothing
sample<-sample[!is.na(sample$total_gravity_smooth),]
#sample$test<-rollmaxr(sample$total_gravity_smooth, 10, fill = NA, align = "right")
# Plot gravity
plot(sample$total_gravity, type="l", col=grey(.2), xlab="Series", ylab="Gravity", main="Accelerometer Gravitational Force")
lines(sample$total_gravity_smooth, col="red")
stdevs <- mean(sample$total_gravity_smooth)+c(-2,-1,+1,+2)*sd(sample$total_gravity_smooth)
abline(h=stdevs)
Tham khảo các câu trả lời ở đây. Có thể giúp! http://stackoverflow.com/questions/31010553/what-is-the-right-algorithm-to-detect-segmentations-of-a-line-chart/31013066#31013066 – Shiva