Accelerometer data to obtain tremor frequency

52 views (last 30 days)
Hashvi Sai
Hashvi Sai on 18 Apr 2021
Edited: Walter Roberson on 13 Sep 2022 at 21:16
Hi all,
I have tri-axial accelerometer data which has 6 channels. the first 3 are XYZ of right and next 3 are XYZ of left. I want to know the tremor frequency from this. this has been sample at Fs=333. what steps should i do to get my output in frequency domain. kindly help me out as im very new to MATLAB.
Thanks in advance!
Attached is the tremor file obtained
  1 Comment
Paras Shaikh
Paras Shaikh on 13 Sep 2022 at 16:43
If anyone of u know about this error? As i cant find my algorithm name in this model.h Continuosly finding this error

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 18 Apr 2021
triax = readmatrix('');
Fs = 333;
nsamp = size(triax,1);
time = (0:nsamp-1) / Fs;
first_half = 1:ceil(nsamp/2);
nhalf = length(first_half)
nhalf = 2509
freqs = linspace(0, Fs/2, nhalf);
XL = triax(:,1);
XL_fft = fft(XL - mean(XL));
plot(time, XL); xlabel('s'); ylabel('mag')
plot(freqs, abs(XL_fft(first_half))); xlabel('Hz'); ylabel('mag');
I do not promise that the frequencies are correct. Read the first example of the documentation for fft() to see how to create the frequencies.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by