I want to calculate event frequency with a moving average, i have event times

조회 수: 3 (최근 30일)
Hi all,
I have a list of the time points of events over 30 seconds, and I want to graph the frequency of events with a moving average (1 second window). If the density of events is high early on and low later, the y axis of the graph should have a negative slope.
In MATLAB, I've imported two lists: the time points, and 0-30 second time points at 20kHz.
What would be the best way of going about this?
Thanks, Stefan
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2012년 1월 6일
What does your data look like? It sounds like you may want to use conv() to implement the moving average.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2012년 1월 7일
Use interp1() to get elements that have a uniform time spacing. Then use conv(data, ones(1, windowSize)/windowSize) to do the moving average.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by