display gait cycle in matlab

Hello friends
I have a diagram of the walking gait signal related to the left and right force signal feet of people. This signal is measured by an analog to digital converter 12 bit , so the vertical axis of this diagram is in terms of voltage and the horizontal axis is in terms of the number of samples. Now I want to know how I can change the vertical axis from voltage to force(m/s^2)? (Through what code in MATLAB?)
I use this code for display signal for neurodegenerative disease in physionet site:
fileID1=fopen('control1.let','r');
A= fread(fileID1, [3, 45000], 'uint8')'; % matrix with 3 rows, each 8 bits long, = 2*12bit
fclose(fileID1);
M2H= bitshift(A(:,2), -4);
M1H= bitand(A(:,2), 15);
PRL=bitshift(bitand(A(:,2),8),9); % sign-bit
PRR=bitshift(bitand(A(:,2),128),5); % sign-bit
M( : , 1)= bitshift(M1H,8)+ A(:,1)-PRL;
M( : , 2)= bitshift(M2H,8)+ A(:,3)-PRR;
N1 = reshape(M',[90000,1]);
subplot(2,4,1);plot(N1);title('Healthy control'); ylabel('left force');

Antworten (1)

Mathieu NOE
Mathieu NOE am 30 Sep. 2021

1 Stimme

hello
this is not really a matlab question ...
you have to know the sensivity of the sensor - whatever you measure , you need that info to go from measurement (voltage) to physical units. pay also attention to any device that modify the gain of the acquisition chain (signal amplifiers, ADC gain and so forth)
NB : m/s² is the unit of acceleration, not force (Newtons or pounds or ...)
at the end , it's just a gain factor to apply on your y data

10 Kommentare

NGR MNFD
NGR MNFD am 30 Sep. 2021
hello dear ...
Hi, I did not measure anything and I did not do an experiment. I only used the results of the Physion site. Now I have drawn the signal. Voltage according to the number of samples. Now I want to know with what command can I convert this diagram into a force according to the number of samples? What is the relationship between force and voltage for the foot force signal?
Mathieu NOE
Mathieu NOE am 30 Sep. 2021
again, someone has to tell you what is the sensivity of the sensor used in this experiment
I cannot answer this question, sorry !
NGR MNFD
NGR MNFD am 30 Sep. 2021
thanks dear...
I understand what you mean now. In the experiment performed for each signal, information about the signal gain is given. So you mean that in order to convert the voltage diagram according to the number of samples to the power diagram according to the number of samples, the vertical axis must be divided by its gain? That is, in the MATLAB code written, he divided m by the signal gain ?? Please help. Thank you. What changes should I make to MATLAB code?
hello
your data is stored in M , so M should be multiplied by sensor gain (force unit per volt)
M = M * sensor_gain;
be aware that most of the time the sensor manufacturer will give the sensor sensivity, wich is the inverse of the gain :
S = xxx volts / force unit
=> gain = 1/S;
NGR MNFD
NGR MNFD am 1 Okt. 2021
thanks very much dear .I hope you have a good day.
Mathieu NOE
Mathieu NOE am 1 Okt. 2021
My pleasure !
NGR MNFD
NGR MNFD am 1 Okt. 2021
How can I check the checksum of the force signal binary file? This force signal is measured by a 12-bit adc. I was able to display it through the following method.
fileID1=fopen('control1.let','r');
A= fread(fileID1, [3, 45000], 'uint8')'; % matrix with 3 rows, each 8 bits long, = 2*12bit
fclose(fileID1);
M2H= bitshift(A(:,2), -4);
M1H= bitand(A(:,2), 15);
PRL=bitshift(bitand(A(:,2),8),9); % sign-bit
PRR=bitshift(bitand(A(:,2),128),5); % sign-bit
M( : , 1)= bitshift(M1H,8)+ A(:,1)-PRL;
M( : , 2)= bitshift(M2H,8)+ A(:,3)-PRR;
N1 = reshape(M',[90000,1]); plot(N1);
Can I also check to see if it is correct or not? I do not know what code to use in MATLAB to calculate checksum? Please show me. Thank you.
NGR MNFD
NGR MNFD am 2 Okt. 2021
thanks very much
Mathieu NOE
Mathieu NOE am 4 Okt. 2021
My pleasure !

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2019a

Gefragt:

am 30 Sep. 2021

Kommentiert:

am 4 Okt. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by