Smoothing discrete data with hanning window

조회 수: 11 (최근 30일)
Gizem Yilmaz
Gizem Yilmaz 2018년 8월 29일
댓글: Adam Danz 2025년 2월 11일
I am new to matlab analysis and I need to smooth dicharge times of a motor unit (discrete data points representing firing times). All previous literature uses "400 ms Hanning window" to smooth the firing rate (calculated from the discharge times). My question is, I have ,for example, an array containing 800 numbers (consecutive discharge times in sec) . How can I apply 400 ms Hanning window on this data? My sampling rate is 20K Hz.
  댓글 수: 2
Adam
Adam 2018년 8월 29일
You have nowhere near enough data to do this. 800 samples is only 4ms worth of data unless my on the spot maths is wrong.
Star Strider
Star Strider 2018년 8월 29일
See the fir1 documentation section on Multiband FIR Filter (link) for an example on how to design a FIR filter with a Hanning window.

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

답변 (2개)

innavoig23
innavoig23 2025년 2월 11일
I just created a repo on GitHub since I needed to do that too for my MSc thesis. Here's the link.

Adam Danz
Adam Danz 2018년 8월 29일
Here's a full description and examples.
  댓글 수: 5
Adam
Adam 2018년 8월 29일
If that is the case how can you have a single sample rate? A scalar sample rate implies all data is the same distance apart on a uniform grid.
Adam Danz
Adam Danz 2018년 8월 29일
@Gizem, If I'm interpreting your description correctly, you've sampled a motor unit at 20kHz and recorded the timestamps of each action potential. For simplicity, let's say the sampling rate was at 1ms intervals (1kHz), if my timestamps were
[2 5 7 10]
then I could replace that with a vector sampled a 1ms resolution where a 1 indicates a spike.
[0 1 0 0 1 0 1 0 0 1]
There is a 1 (a spike) at 2ms, 5ms, 7ms, and 10ms.
Is that an accurate description of your data?

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

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by