MATLAB: How to get sample rate from a matrix of time

sample rate

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?

Best Answer

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;
Related Question