Gait Analysis Internship Report
Gait Analysis Internship Report
Submitted by
JAIMANI R S-2021116011
BACHELOR OF ENGINEERING IN
BIOMEDICAL ENGINEERING
JULY 2023
i
CERTIFICATE COPY
ii
ACKNOWLEDGEMENT
This training wouldn‟t have been successful without the continuous effort and
guidance of Dr. S. POONGUZHALI, Professor Incharge, Gait Analysis
Laboratory and Mrs. Chitra M Das who considered me as a member of their team
and oriented me as well as guided me in practically realizing the work of a Biomedical
Engineer.
Finally, I would like to thank all the other people in the department and my
colleagues who helped me and made it a worthwhile experience in my career.
Jaimani R S
2021116011
iii
TABLE OF CONTENTS
2.1 XSENS 11
2.1.1 Working 11
2.1.2 Features 12
2.1.3 Applications 13
2.2.3 Applications 20
iv
CHAPTER TITLE PAGE
NO NO
2.3 Exoskeleton 21
2.3.2 Applications 24
2.4 DELSYS 26
2.4.1 Features 37
2.4.2 Applications 29
2.5 MPU9250 32
2.5.2 Application 33
2.6 ESP32 35
2.6.2 Applications 36
3 Field visit 40
3.1 CSIR 40
3.1.2 P - walk 41
3.1.2.1 Applications 41
3.1.3 Zebris 42
4 4.1 Assignment 1 46
4.2 Assignment 2 50
v
4.3 Assignment 3 75
4.3.2 Soldering 76
4.3.3 RF Transmission 78
4.3.3.2 Applications 78
5 Conclusion 84
vi
LIST OF FIGURES
1 1.1 Gait 1
2 2.1 XSENS 11
2.7 Exoskeleton 21
2.12 MPU9250 32
2.13 ESP32 35
2.14 MPU9250 41
2.13 ESP32 42
3 3.1 P-Walk 44
3.2 Zebris 45
vii
FIGURE TITLE PAGE
NO NO
4.1 EMG signal of Tibialis Anterior 51
viii
LIST OF TABLES
ix
CHAPTER 1
INTRODUCTION
1
person's gait, which can be used to inform treatment plans for conditions such as
arthritis, neurological disorders, sports injuries, and orthopedic issues.
The gait cycle is the sequence of events that occur from the initial contact of
one foot with the ground to the subsequent contact of the same foot as shown in
the Figure 1.2. It is typically divided into two main phases: the stance phase and
the swing phase. Each of these phases can be further subdivided for more
detailed analysis:
i. Initial Contact (IC): This is the moment when the foot makes initial
contact with the ground. It marks the beginning of the stance phase.
ii. Loading Response (LR): After initial contact, the foot absorbs the
2
weight of the body, and the limb progresses into mid-stance.
iii. Midstance (MS): This phase occurs when the body is directly over
the supporting foot. It's characterized by the leg acting as a rigid lever
and supporting the body's weight.
iv. Terminal Stance (TS): This is the phase just before the heel leaves
the ground, marking the transition to the swing phase.
v. Pre-Swing (PS): In this phase, the heel rises, and the foot prepares to
swing forward.
i. Initial Swing (IS): This begins with the lift-off of the toe and
continues until the knee reaches its maximum flexion angle.
ii. Mid-Swing (MSw): The knee continues to flex, and the limb
advances in preparation for the upcoming heel strike.
iii. Terminal Swing (TSw): The limb is rapidly advancing toward the
ground in preparation for the next initial contact.
The combined stance and swing phases make up one complete gait cycle. It's
important to note that while one limb is in the stance phase, the other limb is in
the swing phase, creating a continuous and coordinated motion during walking.
These phases are critical for understanding and analyzing gait patterns.
Changes or abnormalities in any of these phases can provide valuable
information about the underlying biomechanical or neurological issues that may
be affecting an individual's walking pattern.
3
1.3 GAIT PARAMETERS
1. Kinematic parameters
2. Kinetic parameters
3. Spatio-temporal parameters
1. Joint Angles:
i. Hip Angle: The angle between the thigh and the torso.
ii. Knee Angle: The angle between the thigh and the shin.
iii. Ankle Angle: The angle between the shin and the foot.
2. Angular Velocities:
4
1.3.2 Kinetic gait parameters:
Kinetic gait parameters refer to the measurements and analyses of the forces
acting on the body during walking. These parameters provide important
information about the interaction between the body and the ground, which is
crucial for understanding normal and abnormal walking patterns. Here are some
key kinetic gait parameters:
ii. Power: This refers to the rate at which work is done. In the context of
gait analysis, it indicates the mechanical power generated or absorbed
by the muscles and joints during walking.
iii. Center of Pressure (COP): This is the point where the resultant force
vector of the GRF intersects the ground. It gives information about the
distribution of pressure on the foot and can be used to analyze
stability.
iv. Joint Moments: These represent the rotational forces acting at the
joints during walking. They indicate how much torque is required at a
5
joint to overcome the resistance of the limb segments.
vi. Joint Impulse: It's the integral of the joint moment over time, which
represents the net amount of angular momentum imparted to a
segment.
vii. Stance Phase and Swing Phase Forces: These refer to the forces
acting on the body during specific phases of the gait cycle.
ii. Step Length: This is the distance between the heel strike of one foot
and the heel strike of the opposite foot. It's half of the stride length.
iii. Step Width (Base of Support): This is the lateral distance between
the two feet at a given point in the gait cycle. It's measured as the
perpendicular distance between the midpoint of the heels.
iv. Cadence (Step Rate): This refers to the number of steps taken per
unit of time, usually measured in steps per minute.
6
typically measured in meters per second or kilometers per hour.
vi. Stance Phase: This is the portion of the gait cycle when the foot is in
contact with the ground. It includes initial contact, loading response,
midstance, terminal stance, and pre-swing.
vii. Swing Phase: This is the portion of the gait cycle when the foot is off
the ground. It includes initial swing, mid-swing, and terminal swing.
viii. Single Support Phase: This is the period when only one foot is in
contact with the ground.
ix. Double Support Phase: This is the period when both feet are in
contact with the ground.
x. Stride Time: The duration of one complete gait cycle (from one heel
strike to the next heel strike of the same foot).
xi. Step Time: The time between successive heel strikes of opposite feet.
xii. Percentage of Gait Cycle: It refers to the percentage of the gait cycle
at which specific events occur, such as initial contact, toe-off, and
maximum knee flexion.
xiii. Joint Angles: These include measurements of angles at the hip, knee,
and ankle joints during different phases of the gait cycle.
xiv. Ground Reaction Forces: These are forces exerted by the ground on
the foot during walking and provide information about weight
distribution and balance.
7
These parameters, when analyzed collectively, provide a comprehensive
understanding of a person's walking pattern. They are crucial for
diagnosing and treating various musculoskeletal, neurological, and
orthopedic conditions, as well as for designing interventions like orthotics
or prosthetics, optimizing sports performance, and planning rehabilitation
programs.
Examples in Gait:
8
1.4.2 Frontal Plane:
This plane divides the body into front and back halves. Movements in
the frontal plane occur around the mediolateral axis. In gait analysis,
frontal plane movements are important for understanding abduction and
adduction.
Examples in Gait:
Examples in Gait:
9
These anatomical planes and their associated movements are assessed to
gain insights into the biomechanics of walking. Understanding how the
body moves in these planes helps in diagnosing and addressing gait
abnormalities, as well as designing interventions or treatments to improve
gait function.
10
CHAPTER 2
2.1 XSENS
2.1.1 WORKING
It‟s motion capture technology relies on inertial sensors attached to the
body, which can track movements in real-time. This allows for the creation of
highly accurate 3D motion data that can be used for a variety of purposes, such
11
as creating realistic character animations for movies or analyzing the
movements of athletes for training and performance improvement. Xsens IMU
(Inertial Measurement Unit) sensors have found significant application in gait
analysis.
It plays a crucial role in capturing and analyzing the motion of different
body segments during gait by using the mt manager software as shown in the
Figure 2.2.
2.1.2 FEATURES
12
sports fields, and even outdoors. This flexibility makes them suitable
for a wide range of gait analysis applications.
iv. Full-body Kinematics: Xsens‟ IMU systems can capture motion data
from multiple body segments simultaneously, providing a
comprehensive view of the entire body's movement during gait. This is
crucial for understanding how different segments interact and
contribute to overall locomotion.
2.1.3 APPLICATIONS
Xsens IMU (Inertial Measurement Unit) gait analysis devices are used
in various fields to capture and analyze human movement. They provide
precise measurements of accelerations, angular rates, and magnetic fields,
13
allowing for detailed motion analysis. Here are some applications of Xsens
IMU gait analysis devices:
i. Clinical Gait Analysis: Rehabilitation and Physical Therapy:
Assessing and monitoring patients' gait patterns to design personalized
rehabilitation programs.
v. Neurological Studies:
15
Xsens IMU sensors have revolutionized gait analysis by offering a reliable,
accurate, and convenient method for capturing and analyzing human motion.
Their application extends beyond gait analysis to various fields including
animation, biomechanics, virtual reality, and more.
16
2.2.1 EMG ACQUIRING PROCESS
17
Figure 2.5 – EMG Electrodes and Data logger placement
18
2.2.2 VISUAL ANALYSIS OF ACQUIRED EMG SIGNAL
Chitra Ma‟am explained about the EMG signals which are acquired from
the skeletal muscles and the applications such as human-computer interface,
rehabilitation, muscle activation and contraction intensity. She demonstrated
the method of acquiring EMG signals in the biceps with myself as the test
subject.
Later I was asked to acquire EMG signals from the Tibialis anterior
muscle. EMG Signals during the actions such as slow walking, normal
walking, fast walking, dorsiflexion and plantarflexion were recorded and are
plotted in a grap as shown in the Figure.
19
From the graph, the following parameters are obtained as shown in the below
Table 2.1.
The number of steps taken during fast walk is less than the number of steps
taken during the slow walk. The amplitude of the signal during dorsiflexion is
higher than the amplitude of the signal during plantarflexion i.e., the Tibialis
anterior muscle attains maximum contraction during dorsiflexion.
2.2.3 APPLICATIONS
III. Sports Science: They are used to analyze muscle activation patterns in
athletes to optimize training and prevent injuries.
20
IV. Biomechanical Research: EMG is a valuable tool in studying human
movement and understanding the mechanics of activities like walking,
running, and lifting.
2.3 EXOSKELETON
Depending on the type and function of the exoskeleton, they can work
21
very differently. The two broad categories of exoskeletons are mechanical and
powered exoskeletons.
Passive Exoskeletons: Passive exoskeletons are unpowered and
function primarily mechanically by redistributing weight from one part of the
body to another. One common way they work is by taking the weight from the
arms and shoulders and distributing it to the core or leg muscles. This way, the
arms fatigue less, and the weight is spread out more, reducing the chances of
strain and injury.
Powered Exoskeletons: Electric exoskeletons, on the other hand, can
add strength and function to the wearer. However, because such exoskeletons
require power, they‟re typically heavier and bulkier to allow for the hardware
and batteries. They also need recharging and may have short battery lives,
which can be a downside in fast-paced industries.
22
3. Kinematic and Kinetic Analysis: The exoskeleton analyzes
both kinematic (motion-related) and kinetic (force-related)
aspects of movement. This includes parameters like joint angles,
angular velocities, accelerations, ground reaction forces, and
more.
23
In the gait analysis laboratory, knee exoskeleton is available as shown
in the Figure 2.8.
2.3.2 APPLICATIONS
The following are the applications of exoskeleton:
i. Support and Assistance: Exoskeletons can provide physical support
and assistance to individuals with mobility impairments. They can help
patients with neurological or musculoskeletal conditions, such as spinal
cord injuries, stroke survivors, or those with muscular dystrophy, to
walk more effectively.
ii. Data Collection: Exoskeletons are equipped with sensors that record
various parameters related to the user's gait. These sensors can include
accelerometers, gyroscopes, force sensors, and joint angle sensors.
This data is crucial for understanding the user's walking pattern.
iv. Gait Analysis Software: Data collected from the exoskeleton sensors
24
is typically processed using specialized gait analysis software. This
software helps in visualizing and interpreting the data to extract
meaningful insights about the individual's gait.
25
2.4 DELSYS
DELSYS EMG systems are often used to study the muscle activity
patterns of individuals during walking and other locomotion activities.
DELSYS is ideal for recording the muscle tissue contractions and electrical
muscle activity in your subjects, especially when range of movement and
comfort are important.
It is the combination of EMG and IMU sensor. The DELSYS system is
shown in the Figure 2.9.
Applications for wireless electrodes include track & field and gymnastics; but
our wireless EMG solutions are also ideal for „on the spot‟ applications, or
when small, difficult to isolate muscles are being assessed.
Whether you are studying motor control for patient rehabilitation or muscle
performance, activity, and fatigue in elite athletes, this system offers
26
streamlined wireless systems that let you record and measure electrical muscle
activity simply and easily through the trigno discover software as shown in the
Figure 2.10.
2.4.1 FEATURES
27
signals are very weak and need to be amplified to improve their strength
and clarity. This is achieved through analog amplifiers within the
DELSYS device. Additionally, any noise or interference in the signal is
filtered out to ensure accurate measurements.
28
9. Data Processing and Interpretation: Post-processing of the EMG data
may involve filtering, rectification, and normalization. This helps in
quantifying muscle activity and comparing it across different conditions
or individuals.
2.4.2 APPLICATIONS
iii. Spatial Analysis: Along with motion capture systems, DELSYS EMG
can help in understanding how muscle activation patterns change in
different planes (sagittal, frontal, transverse) during walking.
29
during gait. This is particularly important in clinical settings for
assessing individuals with balance disorders or rehabilitation needs.
30
Tibialis anterior (Rt) Gastrocnemius medialis (Rt)
1441
1081
1171
1261
1351
1531
-1
-2
-3
-4
-5
From the above graphs, we can see that no peaks are seen in the
Gastrocnemius muscle when there is a peak in the Tibialis anterior muscle
during walking and vice versa. Hence the muscle Gastrocnemius medialis is
antagonist to Tibialis anterior.
31
2.5 MPU9250
32
relation to the Earth's magnetic field. This is particularly valuable for
applications requiring precise heading information.
Integration of these three sensors into a single module provides a
comprehensive and synchronized view of an object's motion and orientation,
making the MPU9250 an ideal choice for various applications, including but
not limited to gaming, robotics, virtual reality, and, most notably, biomedical
applications.
2.5.2 Application:
33
Fall Detection and Prevention: Falls are a significant concern,
particularly among the elderly population, as they can result in severe injuries
and reduced quality of life. The MPU9250's accelerometer and gyroscope
sensors can be integrated into wearable devices or smart home systems to
detect falls in real time. When a fall is detected, these systems can trigger
alerts or automatic responses, such as notifying caregivers or emergency
services.
Moreover, the MPU9250's orientation tracking capabilities allow for the
assessment of body posture before, during, and after a fall, enabling a better
understanding of fall dynamics. This information can be used to develop fall
prevention strategies and improve the design of assistive devices like
prosthetics and orthotics.
Rehabilitation and Physical Therapy: Rehabilitation and physical
therapy often require precise monitoring of a patient's movements to assess
progress and tailor treatment plans. The MPU9250's motion tracking
capabilities make it an ideal choice for developing wearable devices that
provide real-time feedback to patients and therapists.
For example, stroke survivors may use wearable devices equipped with
the MPU9250 to track arm movements during rehabilitation exercises.
Therapists can analyze this data to adjust exercise intensity and evaluate the
patient's recovery progress. Similarly, individuals recovering from orthopedic
surgeries can benefit from wearable sensors that monitor joint movements
and weight distribution during activities like walking and stair climbing.
Posture Correction: Poor posture is a common problem that can lead
to various health issues, including musculoskeletal pain and reduced lung
capacity. The MPU9250's gyroscope and accelerometer can be integrated into
wearable devices designed to encourage good posture habits. These devices
can provide real-time feedback to users, alerting them when they slouch or
adopt unhealthy positions.
34
In addition to real-time feedback, the MPU9250 can record posture data
over time, allowing users and healthcare professionals to track improvements
and identify trends in posture-related issues. This data-driven approach to
posture correction can be particularly beneficial for individuals with chronic
back pain or those looking to prevent posture-related problems.
2.6 ESP32
iv. Extensive I/O Options: The ESP32 boasts a multitude of GPIO pins,
analog inputs, and communication interfaces, including SPI, I2C, and
UART. This versatility allows for the integration of various sensors,
displays, and other peripherals in biomedical applications.
2.6.2 Applications
36
ii. Remote Patient Monitoring: The ESP32's ability to connect to the
internet via Wi-Fi or Bluetooth makes it an excellent choice for remote
patient monitoring systems. These systems enable healthcare providers
to monitor patients' vital signs, medication adherence, and overall
health remotely, enhancing patient care and reducing hospital
readmissions.
37
enhancing the efficiency of laboratory operations.
ii. Pre-processing:
vi. Segmentation: EMG signals are often divided into segments or epochs
corresponding to different muscle activities or tasks.
39
CHAPTER 3
FIELD VISIT
3.1 CSIR:
The role of CSIR-CLRI in scientific industrial research space of India is
very focused. Objective of the institute is to meet the needs of the leather and
allied sectors through research, technology development and transfer, training
and industrial support and formulation of policies and plan of action that
ensures a technology based competitive advantage for Indian leather.
Leather technology, which deals with tanning raw hides and skins and
finishing the tanned leather to impart to it the specific properties which it
should have to be suitable for making particular types of leather articles
either for military or civilian use, although very old, is still making progress.
Its progress has been due to the application of various branches of science to
it and research which is being carried out to explain the principles underlying
the old craft of tanning, to throw light on the mechanism whereby the
profound change viz., the conversion of putrescible raw hides and skins into
imputrescible and permanent leather is brought about to improve the old
techniques of leather manufacture and to work out new techniques with the
help of modern science and machinery.
40
3.1.2 P - WALK:
3.1.2.1 Applications
I. To study distribution of plantar pressure at foot ground interface
and to identify the size of peak plantar pressure to protect it from
further complications by providing corrective/ theraupeutic
footwear/orthotics.
II. To find the posture stability of the subject.
III. The result is useful for orthopaedist, physiotherapist and
podiatrist to analyze the foot topology and how the subject
walks.
41
3.1.3 ZEBRIS
42
creates detailed foot pressure maps, allowing experts to understand how
the foot contacts the ground and the timing of pressure changes
throughout the walking or running cycle.
Customized Solutions:
Zebris gait analysis can be tailored to specific needs. For example, it is
often used in the design and fitting of custom orthotics or prosthetics to
43
ensure a precise fit and optimal gait correction.
4.1 ASSIGNMENT 1
To find the gait analysis devices that are available in the various
laboratories, companies and universities in Europe
UNIVERSITY OF SYDNEY RUNNING INJURY CLINIC
• Located in Sydney
• SERVICE OFFERED
Gait Analysis
Injury prevention
Injury rehabilitation
Research and Studies
INSTRUMENTS:
1. EMG
2. Motion capture systems
3. TMG (Muscle contractile properties)
4. Portable metabolic analyzers(measure Vo2 and Vco2)
5. Pressure mapping system
SOFTWARES:
1. VICON NEXUX (Motion capture)
2. Dartfish (video analysis)
PROJECTS:
1. Running Biomechanics
2. Injury Prevention and Rehabilitation
3. Running Performance Optimization
4. Technology and Running Analysis
BIOMECHANICS RESEARCH LABORATORY AT GRIFFITH
UNIVERSITY:
46
• Located at Gold Coast, Australia
SERVICES OFFERED:
Gait Analysis
Sports Performance
Injury Prevention and Rehabilitation
INSTRUMENTS:
1. Motion capture systems
2. EMG
3. 3D Imaging systems
4. Pressure mapping system
SOFTWARES:
1. VICON NEXUS
2. Visual 3D (Processing, Modelling and Visualisation of motion capture
data)
3. Spike2 (Data acquisition and analysis
PROJECTS:
1. Sports Biomechanics
2. Musculoskeletal Injury Mechanisms
3. Ergonomics and Occupational Biomechanics
4. Clinical Biomechanics and Rehabilitation
STELLENBOSCH UNIVERSITY GAIT LABORATARY:
Located in Tygerburg northern suburbs of Cape Town in South Africa
SERVICE OFFERED:
Research and clinical assessments of gait patterns in individuals with
various musculoskeletal and neurological conditions.
INSTRUMENTS:
1. 3D Scanners (Detailed anatomical models of the feet, lower limbs, or
other body segments. These models can be used for precise measurements and
analysis of body segment angles and lengths)
47
2. Motion capture systems
3. EMG
4. Pressure mapping system
SOFTWARES:
1. Force plate analysis software
2. VICON NEXUS
3. Visual 3D
PROJECTS:
Gait Analysis in Neurological Disorders
Gait Rehabilitation and Assistive Devices
Biomechanical Analysis of Gait
Gait Variability and Falls
UNIVERSITY OF CAPE TOWN LABORATORY:
Located at Capetown, South Africa
Gait analysis for various conditions, including neurological disorders,
orthopedic conditions, and sports-related injuries.
INSTRUMENTS:
1. 3D Scanners
2. Motion capture systems
3. EMG
4. Pressure mapping system
SOFTWARES:
1. Force plate analysis software
2. VICON NEXUS
3. Visual 3D
PROJECTS:
1. Clinical Gait Analysis
2. Biomechanics of Gait
3. Gait Analysis in Sports
48
4. Aging and Gait
GAIT ANS MOTION ANALYSIS LAB AT KENYATTA CENTRAL
HOSPITAL:
Located at Kenya
INSTRUMENTS:
1. Motion Capture Systems
2. Force Plates
3. Electromyography (EMG) Systems
4. Instrumented Treadmills
5. Wearable Sensors
SOFTWARES:
1. Motion Analysis Software
2. Biomechanical Analysis Software
3. Statistical Analysis Software
PROJECTS
1. Clinical Gait Analysis
2. Biomechanics of Running
3. Rehabilitation and Movement Disorders
4. Sports Biomechanics
5. Wearable Technology and Monitoring
PHYSIOTHERAPHY GAIT ANALYSIS LAB, UNIVERSITY OF IBANDAN:
INSTRUMENTS:
1. Motion Capture Systems
2. Force Plates
3. Electromyography (EMG) Systems
4. Goniometers
5. Treadmills
SOFTWARES:
1. Motion Analysis Software
49
2. Biomechanical Analysis Software
3. Statistical Analysis Software
PROJECTS:
1. Clinical Gait Analysis
2. Rehabilitation Interventions
3. Biomechanics of Gait
4. Falls Prevention
5. Movement Analysis in Specific Populations
4.2 ASSIGNMENT 2:
To process the of data acquired from DELSYS during forward and
backward walking.
50
plt.title(“EMG SIGNAL OF TIBIALIS ANTERIOR “, **font)
plt.xlabel(“Time”, **font)
plt.ylabel(“Amplitude”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
51
# Get the filter coefficients so we can check its frequency response.
B, a = butter_bandpass(lowcut, highcut, fs, order)
# In[15]:
# First make some data to be filtered.
T = 1/1259.2593 # seconds
n = int(T * fs) # total number of samples
t = np.linspace(0, T, n, endpoint=False)
# In[16]:
# Filter the data, and plot both the original and filtered signals.
Filtered_emg_TA = butter_bandpass_filter(emg_TA, lowcut, highcut, fs,
order)
filtered_emg_TA
# In[17]:
plt.figure(figsize=(16,5))
plt.plot(time,filtered_emg_TA)
font = {„weight‟ : „bold‟, „size‟ : 13}
plt.title(“FILTERED EMG OF TIBIALIS ANTERIOR”, **font)
plt.xlabel(“TIME”, **font)
plt.ylabel(“Amplitude”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
53
y = lfilter(b, a, emg_GM)
return y
# Filter requirements.
Order = 6
fs =2000.0 # sample rate, Hz
lowcut = 10 # desired cutoff frequency of the filter, Hz
highcut= 500
# Get the filter coefficients so we can check its frequency response.
B, a = butter_bandpass(lowcut, highcut, fs, order)
# In[15]:
# First make some data to be filtered.
T = 1/148.148 # seconds
n = int(T * fs) # total number of samples
t = np.linspace(0, T, n, endpoint=False)
# In[16]:
# Filter the data, and plot both the original and filtered signals.
Filtered_emg_GM = butter_bandpass_filter(emg_GM, lowcut, highcut, fs,
order)
filtered_emg_GM
# In[17]:
plt.figure(figsize=(16,5))
plt.plot(time,filtered_emg_GM)
font = {„weight‟ : „bold‟,‟size‟ : 13}
plt.title(“FILTERED EMG SIGNAL OF GASTROCNEMIUS
MEDIALIS”, **font)
plt.xlabel(“TIME”, **font)
plt.ylabel(“Amplitude”, **font)
plt.xticks(fontsize=13,)
54
plt.yticks(fontsize=13,)
plt.show()
55
fft_filtered_emg_GM = np.fft.fft(filtered_emg_GM)
plt.figure(figsize=(16,5))
plt.plot(fft_filtered_emg_GM, label=‟X-axis‟)
font = {„weight‟ : „bold‟,‟size‟ : 13}
plt.title(“ FFT FILTERED EMG OF GASTROCNEMIUS MEDIALIS”,
**font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“Amplitude”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
# # get the axes object.
# ax=plt.gca()
# # adjust the y axis scale.
# ax.locator_params(„y‟, nbins=5)
# # adjust the x axis scale.
# plt.locator_params(„x‟, nbins=10)
# # show the final figure.
# only show on x-axis.
Plt.xlim(xmin=0,xmax=4112)
# only show 100 – 1600 on y-axis.
Plt.ylim(ymin=-7,ymax=7)
Plt.show()
57
# In[12]:
def butter_bandpass(lowcut, highcut, fs, order=4):
return butter(order, [lowcut, highcut], fs=fs, btype=‟band‟,
analog=False)
def butter_bandpass_filter(emg_TA,lowcut, highcut, fs, order=4):
b, a = butter_bandpass(lowcut,highcut, fs, order=order)
y = lfilter(b, a, emg_TA)
return y
# Filter requirements.
Order = 4
fs = 1250 # sample rate, Hz
lowcut = 10 # desired cutoff frequency of the filter, Hz
highcut= 500
# Get the filter coefficients so we can check its frequency response.
B, a = butter_bandpass(lowcut, highcut, fs, order)
# In[15]:
# First make some data to be filtered.
T = 1/148.148 # seconds
n = int(T * fs) # total number of samples
t = np.linspace(0, T, n, endpoint=False)
# In[16]:
# Filter the data, and plot both the original and filtered signals.
Filtered_emg_TA = butter_bandpass_filter(emg_TA, lowcut, highcut, fs,
order)
filtered_emg_TA
# In[17]:
plt.figure(figsize=(16,5))
plt.plot(filtered_emg_TA, label=‟X-axis‟)
58
font = {„weight‟ : „bold‟,‟size‟ : 13}
plt.title(“FILTERED EMG OF TIBIALIS ANTERIOR”, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“Amplitude”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
#EMG DATA
emg_GM=data.iloc[:,1]
#ploting right biceps EMG signal
plt.figure(figsize=(16,5))
plt.plot(emg_GM,label=‟x-axis‟)
font = {„weight‟ : „bold‟,‟size‟ : 13}
plt.title(“EMG SIGNAL OF GASTROCNEMIUS MEDIALIS “, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“Amplitude”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
59
plt.show()
60
T = 1/148.148 # seconds
n = int(T * fs) # total number of samples
t = np.linspace(0, T, n, endpoint=False)
# In[16]:
# Filter the data, and plot both the original and filtered signals.
Filtered_emg_GM = butter_bandpass_filter(emg_GM, lowcut, highcut, fs,
order)
filtered_emg_GM
# In[17]:
plt.figure(figsize=(16,5))
plt.plot(filtered_emg_GM, label=‟X-axis‟)
font = {„weight‟ : „bold‟,‟size‟ : 13}
plt.title(“FILTERED EMG SIGNAL OF GASTROCNEMIUS
MEDIALIS”, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“Amplitude”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
61
fft_filtered_emg_TA = np.fft.fft(filtered_emg_TA)
plt.figure(figsize=(16,5))
plt.plot(fft_filtered_emg_TA, label=‟X-axis‟)
font = {„weight‟ : „bold‟,
„size‟ : 13}
plt.title(“ FFT FILTERED EMG OF TIBIALIS ANTERIOR”, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“Amplitude”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.xlim(xmin=0,xmax=3859)
plt.ylim(ymin=-30,ymax=30)
plt.show()
fft_filtered_emg_GM = np.fft.fft(filtered_emg_GM)
plt.figure(figsize=(16,5))
plt.plot(fft_filtered_emg_GM, label=‟X-axis‟)
font = {„weight‟ : „bold‟,‟size‟ : 13}
plt.title(“ FFT FILTERED EMG OF GASTROCNEMIUS MEDIALIS”,
**font)
62
plt.xlabel(“No of samples”, **font)
plt.ylabel(“Amplitude”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
# # get the axes object.
# ax=plt.gca()
# # adjust the y axis scale.
# ax.locator_params(„y‟, nbins=5)
# # adjust the x axis scale.
# plt.locator_params(„x‟, nbins=10)
# # show the final figure.
# only show on x-axis.
Plt.xlim(xmin=0,xmax=3859)
# only show 100 – 1600 on y-axis.
Plt.ylim(ymin=-20,ymax=20)
# show the plot.
Plt.show()
63
4.2.3 FORWARD WALK IMU DATA
#load and read dataset
data=pd.read_excel(“C:\\Users\\Sri balaji P\\Documents\\TA Acc.xlsx”)
#Acelerometer data
accX_TA = data.iloc[:,0]
accY_TA = data.iloc[:,1]
accZ_TA = data.iloc[:,2]
accX_GM = data.iloc[:,3]
accY_GM = data.iloc[:,4]
accZ_GM = data.iloc[:,5]
accX_TA
accY_TA
accZ_TA
accX_GM
accY_GM
accZ_GM
#pitch
pitch_TA =
np.arctan(accX_TA/(np.square(accY_TA)+np.square(accZ_TA)))
pitch_GM =
np.arctan(accX_GM/(np.square(accY_GM)+np.square(accZ_GM)))
#plotting pitch of Right Flexor Carpi Radialis
plt.figure(figsize=(16,5))
plt.plot(pitch_TA, label=‟X-axis‟)
font = {„weight‟ : „bold‟, „size‟ : 13}
plt.title(“PITCH OF RIGHT TIBIALIS ANTERIOR “, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“degree”, **font)
plt.xticks(fontsize=13,)
64
plt.yticks(fontsize=13,)
plt.show()
#plotting pitch of Right Biceps
plt.figure(figsize=(16,5))
plt.plot(pitch_GM , label=‟X-axis‟)
font = {„weight‟ : „bold‟, „size‟ : 13}
plt.title(“PITCH OF RIGHT GASTROCNEMIUS MEDIALIS “, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“degree”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
66
#Low pass filtering
from scipy.signal import butter, lfilter, freqz
def butter_lowpass(cutoff, fs, order=10):
return butter(order, cutoff, fs=fs, btype=‟low‟, analog=False)
def butter_lowpass_filter(pitch_GM, cutoff, fs, order=5):
b, a = butter_lowpass(cutoff, fs, order=order)
y = lfilter(b, a, pitch_GM)
return y
# Filter requirements.
Order = 3
fs = 4000# sample rate, Hz
cutoff = 12 # desired cutoff frequency of the filter, Hz
# Get the filter coefficients so we can check its frequency response.
B, a = butter_lowpass(cutoff, fs, order)
# First make some data to be filtered.
T = 1/148.148 # seconds
n = int(T * fs) # total number of samples
t = np.linspace(0, T, n, endpoint=False)
# Filter the data, and plot both the original and filtered signals.
Filtered_pitch_GM = butter_lowpass_filter(pitch_GM, cutoff, fs, order)
filtered_pitch_GM
plt.figure(figsize=(16,5))
plt.plot(filtered_pitch_GM, label=‟X-axis‟)
font = {„weight‟ : „bold‟,
„size‟ : 13}
plt.title(“FILTERED PITCH OF RIGHT GASTROCNEMIUS
MEDIALIS”, **font)
67
plt.xlabel(“No of samples”, **font)
plt.ylabel(“degrees”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
#knee angle
knee_angle=filtered_pitch_GM-filtered_pitch_TA
knee_angle
plt.figure(figsize=(16,5))
plt.plot(knee_angle, label=‟X-axis‟)
font = {„weight‟ : „bold‟, „size‟ : 13}
plt.title(“knee angle”, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“degrees”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
68
Figure 4.16 – Knee Angle
69
accY_GM
accZ_GM
#pitch
pitch_TA =
np.arctan(accX_TA/(np.square(accY_TA)+np.square(accZ_TA)))
pitch_GM =
np.arctan(accX_GM/(np.square(accY_GM)+np.square(accZ_GM)))
#plotting pitch of Right Flexor Carpi Radialis
plt.figure(figsize=(16,5))
plt.plot(pitch_TA, label=‟X-axis‟)
font = {„weight‟ : „bold‟,‟size‟ : 13}
plt.title(“PITCH OF RIGHT TIBIALIS ANTERIOR “, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“degree”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
70
plt.title(“PITCH OF RIGHT GASTROCNEMIUS MEDIALIS “, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“degree”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
71
# First make some data to be filtered.
T = 1/148.148 # seconds
n = int(T * fs) # total number of samples
t = np.linspace(0, T, n, endpoint=False)
# Filter the data, and plot both the original and filtered signals.
Filtered_pitch_TA = butter_lowpass_filter(pitch_TA, cutoff, fs, order)
filtered_pitch_TA
plt.figure(figsize=(16,5))
plt.plot(filtered_pitch_TA, label=‟X-axis‟)
font = {„weight‟ : „bold‟,‟size‟ : 13}
plt.title(“FILTERED PITCH OF RIGHT TIBIALIS ANTERIOR”,
**font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“degrees”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
plt.show()
72
def butter_lowpass(cutoff, fs, order=10):
return butter(order, cutoff, fs=fs, btype=‟low‟, analog=False)
def butter_lowpass_filter(pitch_GM, cutoff, fs, order=5):
b, a = butter_lowpass(cutoff, fs, order=order)
y = lfilter(b, a, pitch_GM)
return y
# Filter requirements.
Order = 3
fs = 4000# sample rate, Hz
cutoff = 12 # desired cutoff frequency of the filter, Hz
# Get the filter coefficients so we can check its frequency response.
B, a = butter_lowpass(cutoff, fs, order)
# First make some data to be filtered.
T = 1/148.148 # seconds
n = int(T * fs) # total number of samples
t = np.linspace(0, T, n, endpoint=False)
# Filter the data, and plot both the original and filtered signals.
Filtered_pitch_GM = butter_lowpass_filter(pitch_GM, cutoff, fs, order)
filtered_pitch_GM
plt.figure(figsize=(16,5))
plt.plot(filtered_pitch_GM, label=‟X-axis‟)
font = {„weight‟ : „bold‟,
„size‟ : 13}
plt.title(“FILTERED PITCH OF RIGHT GASTROCNEMIUS
MEDIALIS”, **font)
plt.xlabel(“No of samples”, **font)
plt.ylabel(“degrees”, **font)
plt.xticks(fontsize=13,)
plt.yticks(fontsize=13,)
73
plt.show()
74
4.3 ASSIGNMENT 3:
To transmit the signal acquired from flexiforce sensor through wireless
RF transmission.
Materials Required:
1. ESP32 development board (e.g., ESP-WROOM-32)
2. Flexiforce sensor
3. Analog-to-Digital Converter (ADC) pin (ESP32 has multiple)
4. Breadboard and jumper wires
Steps:
Connect the Flexiforce Sensor:
Connect one end of the Flexiforce sensor to the 3.3V power supply
on the ESP32.
Connect the other end of the sensor to a known resistor (e.g., 10k
ohms) forming a voltage divider.
Connect the junction between the sensor and resistor to one of the
ADC pins on the ESP32 (e.g., GPIO 36).
75
int sensorValue = analogRead(A0); // Read the analog value from the
sensor
Serial.println(sensorValue); // Print the sensor value to the serial
monitor
delay(1000); // Add a delay to control the data sampling rate
}
Upload and Monitor:
Upload the code to your ESP32 board.
Open the Arduino Serial Monitor to view the sensor values.
Data Processing:
Process the data as needed for your specific application. You can use
this data to trigger events, send notifications, or control other devices.
Remember that the actual code and wiring might need to be adjusted
depending on the specifics of your Flexiforce sensor and ESP32 board.
Additionally, you can use libraries and advanced signal processing
techniques to filter and interpret the sensor data more effectively.
4.3.2 SOLDERING:
76
4.3.2.1 Materials and Equipment:
Soldering Iron: A tool with a heated metal tip used to melt the
solder.
Solder: A low-melting-point metal alloy that flows into the joint
and solidifies when it cools. Common solder types include lead-
based and lead-free solder.
Flux: A chemical substance applied to the joint to clean the metal
surface, promote solder flow, and prevent oxidation.
Soldering Stand: To hold the soldering iron when not in use,
preventing accidental burns.
Safety Gear: Safety glasses and heat-resistant gloves to protect
against solder splatters and hot components.
77
solder to the joint, not the soldering iron itself. The solder will melt
and flow into the joint, forming a solid connection when it cools.
Ensure that the solder flows evenly and covers the entire joint.
Cooling: Allow the joint to cool naturally without moving it until
the solder has solidified. This ensures a stable connection.
Inspection: After soldering, inspect the joint for any visual defects
like cold solder joints, which can be reworked if necessary.
4.3.3 RF TRANSMISSION:
4.3.3.2 Applications:
79
Figure 4.22 – Receiver and Transmitter
2x ESP32
RF 433MHz Receiver/Transmitter
Breadboard
Jumper wires
#include <RadioHead.h>
#include <RH_ASK.h>
#ifdef RH_HAVE_HARDWARE_SPI
#include <SPI.h> // Not actually used but needed to compile
#endif
RH_ASK driver(2000, 4, 2, 5); // ESP8266 or ESP32: do not use pin 11 or
2
void setup()
80
{
#ifdef RH_HAVE_SERIAL
#include <RadioHead.h>
#include <RadioHead.h>
#include <dummy.h>
#include <RH_ASK.h>
#ifdef RH_HAVE_HARDWARE_SPI
#include <SPI.h> // Not actually used but needed to compile
#endif
RH_ASK driver(2000, 2, 4, 5); // ESP8266 or ESP32: do not use pin 11 or
2
81
void setup()
{
#ifdef RH_HAVE_SERIAL
Serial.begin(115200); // Debugging only
#endif
if (!driver.init())
#ifdef RH_HAVE_SERIAL
Serial.println(“init failed”);
#else;
#endif
}
void loop()
{
uint8_t buf[RH_ASK_MAX_MESSAGE_LEN];
uint8_t buflen = sizeof(buf);
if (driver.recv(buf, &buflen)) // Non-blocking
{
int I;
// Message with a good checksum received, dump it.
Driver.printBuffer(“Message received:”, buf, buflen);
}
}
82
Codes are dumped into both the ESPs and the signal is allowed to be
transmitted as shown in Figure 4.32.
But due to some problem in the receiver and transmitter the signal was not
transmitted.
83
CHAPTER 5
CONCLUSION
84