MatLab Code: GAIT
Stick Diagram of Human walk: For code one can contact me at vsemwal@gmail.com and cite the my following publication as agreement ..
stick diagrams for 1 complete gait cycle are plotted aligned on the hip joint:
Agreement: Please cite these paper before using code ( proper citation is essential)
Semwal, Vijay Bhaskar, Kaushik Mondal, and G. C. Nandi. "Robust and accurate feature selection for humanoid push recovery and classification: deep learning approach." Neural Computing and Applications: 1-10.
Semwal, Vijay Bhaskar, and Gora Chand Nandi. "Toward Developing a Computational Model for Bipedal Push Recovery–A Brief." Sensors Journal, IEEE 15.4 (2015): 2021-2022.
Semwal, Vijay Bhaskar, et al. "Biped model based on human Gait pattern parameters for sagittal plane movement." Control, Automation, Robotics and Embedded Systems (CARE), 2013 International Conference on. IEEE, 2013.
Semwal, Vijay Bhaskar, Pavan Chakraborty, and Gora Chand Nandi. "Less computationally intensive fuzzy logic (type-1)-based controller for humanoid push recovery." Robotics and Autonomous Systems 63 (2015): 122-135.
Semwal, Vijay Bhaskar, Aparajita Bhushan, and Gora Chand Nandi. "Study of humanoid Push recovery based on experiments." Control, Automation, Robotics and Embedded Systems (CARE), 2013 International Conference on. IEEE, 2013.
Semwal, Vijay Bhaskar, et al. "Biologically-inspired push recovery capable bipedal locomotion modeling through hybrid automata." Robotics and Autonomous Systems 70 (2015): 181-190.
Semwal, Vijay Bhaskar, Manish Raj, and Gora Chand Nandi. "Biometric gait identification based on a multilayer perceptron." Robotics and Autonomous Systems 65 (2015): 65-75.
https://scholar.google.co.in/citations?user=cPorLCwAAAAJ&hl=en
Differentiation in matlab example
x
f=sin(5*x)
diff(f)
How to solve using jacobian partial differentiation
syms r l f
>> x = r*cos(l)*cos(f); y = r*cos(l)*sin(f); z = r*sin(l);
>> J = jacobian([x; y; z], [r l f])
J =
[ cos(f)*cos(l), -r*cos(f)*sin(l), -r*cos(l)*sin(f)]
[ cos(l)*sin(f), -r*sin(f)*sin(l), r*cos(f)*cos(l)]
[ sin(l), r*cos(l), 0]
now retrieve each column for partial differentiation
1-How to save data in xlsx format from matrix or mat file?
Let us assume the matrix a(2*4)
the code will be:
a=[1 2 3; 3 4 5]
xlswrite('a.xlsx',a);
If want to write on next excel sheet so enter third argument
xlswrite('a.xlsx',a,2);
2-LVQ (Learning vector qunatization) code with basic example:
Suppose we have 2 class with four feature (a,b,c,d)
P = [0.1 0.2 0.3 0.4 0.5;
0.11 0.22 0.33 0.44 0.55;
1 2 3 4 5;
1.1 2.1 3.1 4.1 5.1];
q=p';
% q is the matrix where column are feature and rows are sample
q = 0.1000 0.1100 1.0000 1.1000
0.2000 0.2200 2.0000 2.1000
0.3000 0.3300 3.0000 3.1000
0.4000 0.4400 4.0000 4.1000
0.5000 0.5500 5.0000
Tc=[1 1 2 2] first two column belong to class 1 and rest tow belong to class 2.
so we gave 2 class
convert target vector into target class.
T = ind2vec(Tc);
targets = full(T)
designed LVQ net
net = newlvq(minmax(q),8,[.5 .5]);
8- total neural network and [.5 .5] 50% of each class in T
we are designing the lvqnet with one hidden layer with 8 neural network( count depend on how accurate it has trained ) and epoch=50( which is also variable as per network accuracy)
net.trainParam.epochs = 50;
net = train(net,q,T);
a = sim(net,q);
class_index = vec2ind(a)
Now testing
>> q1= [.12 .23 .35 .42 .55];
>> a = sim(net,q1');
>>
>> class_index = vec2ind(a)
q1= [.12 .23 .35 .42 .55];
a = sim(net,q1');
q1=q1*10
b = sim(net,q1');
class_index = vec2ind(a)
class_index1 = vec2ind(b)
3- PCA code
data=rand(100,10); % artificial data set of 100 variables (genes) and 10 samples
[W, pc] = princomp(data'); pc=pc'; W=W';
plot(pc(1,:),pc(2,:),'.');
title('{\bf PCA} by princomp'); xlabel('PC 1'); ylabel('PC 2')
HMM code
coming soon
ShannonEntropy=zeros(1,20);
LogEnergyEntropy=zeros(1,20);
for i=1:20
%Real all the file one by one (Seg1.mat,.. Seg20.mat);
filename = sprintf('Seg%d.mat',i);
%Import Segment data and store in vector eegData with diemntion 1*125
eegData=importdata(filename);
% Extract The IMF corresponing each segment dimention 5*125, splited into 5
% signal each segment
IMF=emd_n(eegData,5);
%calculate mena of 1*100 vector as one feature
meanFinal(i*5-4 : i*5)=(mean(IMF,2))';
%minimum
minFinal(i*5-4 : i*5)=(min(IMF'));
%maximum
maxFinal(i*5-4 : i*5)=(max(IMF'));
%Root mean square
RMSFinal(i*5-4 : i*5)=(sqrt(mean(IMF'.^2)));
% Energy of signal
% Shannon Entropy of Signal
for j=1:5
ShannonEntropy((i-1)*5+j)=wentropy(IMF(j,:),'shannon');
LogEnergyEntropy((i-1)*5+j) = wentropy(IMF(j,:),'log energy');
end
a[5*i+j]= column;
This is our bipedal model developed by me and my colleague(Mr. Shiv Ashutosh Katiyar).This model can use for study of different kind of GAIT study and disease related to bipedal walk. We implemented the hybrid automata model and going to implement HMM.
Thanks for all wonderful things in this world for providing such a real thought. I will implement push recovery for same model. It is bench mark. See video here
This is the Human gait cycle based model the study of Humanoid Push Recovery. This is developed at IIIT-Allahabad research lab as in house development model under the supervision of Prof.G.C.Nnadi's(http://www.gcnandi.co.nr/) innovation project. Developed by Vijay Bhaskar Semwal(https://sites.google.com/site/wwwvbsemwalcom/) and Shiv Ashutosh katiyar