How to get sample rate from a matrix of time?

9 views (last 30 days)
I have an EMG signal and when i load the .mat file it gives me a matrix with the data and another with the time . How can i get the sample rate from the matrix of time?

Accepted Answer

Star Strider
Star Strider on 9 Jun 2015
Assuming the time is regularly sampled, there are two ways:
Ts = t(2) - t(1);
or:
Ts = mean(diff(t));
where ‘t’ is the time vector.
The sampling and Nyquist frequencies are:
Fs = 1/Ts;
Fn = Fs/2;

More Answers (0)

Community Treasure Hunt

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

Start Hunting!