Today, running is one of the most popular physical activities, as of Spring 2014 there were 65.58 million runners in the USA accounting for a 20.53% of the American population. Moreover, during the last decade, the number of runners has grown considerably [1] . The benefits of running are numerous, ranging from increased life expectancy to preventing chronic diseases or conditions (e.g., type-2 diabetes, cardiovascular disease, and obesity) [2] .
However, the practice of running also gives rise to Running Related Injuries (RRI) of the lower extremities (e.g., aquiles tendinopathy, plantar fascitis, and patellar tendinopathy) [3] . The causes of RRIs are heterogeneous, and changes in the biomechanical factors of the runner (e.g., contact time, stride length) have previously been investigated [4] . However, research is still lacking in determining what role running surfaces have of changing these biomechanical factors and hence causing RRIs. Particularly, how running surfaces influence the fatigue levels of the leg muscles as a result of a running activity is not clear.
The most common method for estimating muscle fatigue, by examining the electrical activity of the skeletal muscles (known as electromyography (EMG)) is however, difficult to perform in natural running settings. Examining EMG is often done in a laboratory setting, requiring not only delicate expensive equipment, but specialised anatomical knowledge for sensor placement, and interpretation of results preventing non-specialists from using EMG in other environments.
The objective of this study is to introduce a new wearable muscle sensing device consisting of jogging leggings with embroidered surface EMG (sEMG) electrodes capable of recording muscle activity data of the quadriceps group (i.e., Vastus Medialis, Vastus Lateralis, and Rectus Femoris) in a non-laboratory setting. The wearable sEMG device allows collection of long term EMG data in a great variety of environments due to its compact design. Furthermore, use of the device does not require extensive prior anatomical knowledge, as the sensing electrodes are embroidered into the garment at the correct locations, following standards set by the SENIAM project [5] . Thus, the user need not be concerned about sensor placement, and can simply pull the leggings on just like ordinary clothing.
Potential uses of EMG data collected in outdoor environments by the proposed device, include understanding power demands for bipedal robots in outdoor operation, as well as control of exoskeletons and prostheses outside of the laboratory. In this paper, the device is demonstated as a platform for monitoring muscle fatigue during endurancebased long distance (5 km) running tests on different surfaces (asphalt, sand and an athletics track). Using data from the device, the dependency between running surface and muscle fatigue is identified, whereby running on compliant surfaces with greater damping (e.g., sand) leads to the highest levels of muscle fatigue, followed by very stiff surfaces with little damping features (e.g., asphalt). These results confirm expectations about likelihood of suffering from RRIs on these different surfaces, and highlight the use of the proposed device for long term observation of behaviour. Fig. 1 illustrates a participant wearing the leggings as well as a top and bottom up of the embroidered sEMG electrodes and the route followed during the asphalt trial by one of the participants.
This section provides a brief overview of the functioning of electromyography, and its use in measuring muscle fatigue. It also reviews related literature from laboratory based biomechanical studies on risk factors for RRIs.
Electromyography enables the force generated by the skeletal muscles to be estimated by measuring their electrical stimulation from the central nervous system (CNS) [6] , via either invasive or non-invasive techniques. In regards to the former, intramuscular EMG records activity by inserting a fine wire into the muscle and measuring muscle signals. However, while this results in a high quality signal its invasiveness makes it unsuitable for many applications, especially in wearable sensing devices.
A more suitable method is surface EMG (sEMG) where electrodes are placed on the skin surface above the target muscle. When following a bipolar configuration, pairs of electrodes are placed on top of the belly of the muscle with a 1 cm to 2 cm separation between the electrodes, and a reference electrode is placed on top of electrically neutral tissue. The difference between the signals collected by each of the two electrodes is amplified. Current commercial systems such as BTS Surface EMG (Vandrico, North Vancouver, Canada), and Tringo Wireless EMG (DelSys, massachusetts, USA) offer wireless EMG solutions. However, these present several disadvantages: (i) they are expensive (ranging from e448.00 to e15,675.00), (ii) they are bulky (reducing their portability and affecting natural user motion), and (iii) they rely on gel-based sEMG electrodes requiring anatomical knowledge for their placement and limiting their re-usability.
Due to the inherent issues with collecting sEMG data with standard sensors ( §II-A) the study of estimating and monitoring muscle fatigue has been limited. Muscle fatigue is a consequence of muscle activity [7] , to prevent cellular or organ failure [8] .
Fatiguing of the muscles influences both the amplitude and the frequency properties of EMG signals [9] , and during fatigue, further muscle fibres need to be recruited (activated) in order to sustain the desired performance. This is shown as an increment of the amplitude of the EMG signal. Regarding the spectral features of the EMG signal, changes in the the firing behaviour of the motor units and the shape of the Motor Unit Action Potential (MUAP) result in a left-shifting of the power spectrum of the EMG signal. A decrease of the instantaneous mean or mean frequency of the EMG signal indicates the presence of muscle fatigue [9] .
A number of different approaches have been proposed in the literature in order to elucidate muscle fatigue. These include (i) amplitude based parameters analysis, (ii) spectral analysis, and (iii) time-frequency analysis (i.e., wavelets ratios). In amplitude based analysis, the presence of muscle fatigue increases the instantaneous value of the EMG signal with time [7] . Regarding the spectral analysis, muscle fatigue results in a left-shifting of the power spectrum of the EMG signal and hence a decrement of the instantaneous mean and median frequencies is seen. Finally, for timefrequency analysis, the wavelets ratios increase their value as the muscles get fatigued. Due to the isotonic nature of running, the collected sEMG signals cannot be considered as stationary and hence only amplitude based parameters and time-frequency techniques are suitable [7] .
Among a number of other biomechanical factors, muscle fatigue has been shown to significantly increase the likelihood of injury in dynamic behaviour such as running [10] . To date, several studies have examined a number of factors in relation to this, including (i) training characteristics (e.g., running volume), (ii) anthropometric factors (e.g., foot strike), (iii) biomechanical factors (e.g., contact time), (iv) physiological variables (e.g., lactose level), and (v) running-related medical history [11] . However, largely due to the technological barrier of taking measurement equipment out of the laboratory, few have examined these factors in ordinary environments, as may be used by the general running population [12] . This limits such studies to simulating the running conditions, ignoring possible contributing factors.
One such factor may be the effect of the running surface on fatigue, which is typically difficult to simulate in laboratory studies. Previous research in this area has mainly focused on how these might affect the biomechanical factors of the runner, using short (< 20 m) tracks [13] , [4] , [12] . As can be seen, despite the great amount of work in studying the biomechanics of running, and the causes of musculoskeletal injuries, there is an apparent a technological barrier in taking these studies into real world environments. In the next section, the implementation of a new textile-based EMG system is presented along with the signal processing techniques necessary for its use in estimating muscle fatigue.
To overcome the limitations of collecting EMG data outside the laboratory environment (as discussed in §II), this paper presents a new, textile-based acquisition system. Specifically, the system consists of a pair of jogging leggings with integrated sEMG electrodes, made from conductive yarns directly embroidered into the fabric.
The leggings overcome many of the technical and userspecific limitations of current sEMG monitoring devices.
It includes built-in electrodes at appropriate locations such that anatomical knowledge of optimal sensor locations is not required when using the device. It is also designed in mind of portability for use in multiple environments, with built-in flexible low-weight printed circuit boards (PCBs) to acquire raw sEMG signals in conjunction with an Arduino microcontroller to digitise and store the collected data.
1) Embroidered electrodes: The leggings make use of state-of-the-art textile sEMG sensors, recently developed in a parallel study at the Centre for Robotics Research (CORE) at King's College London, for measuring muscle activity in the legs. As a precursor to this study, experiments were performed to elucidate the best fabrication process and design of these electrodes and characterise their behaviour for sEMG signal acquisition. Results show that similar sEMG measurements can be obtained by using conductive textile electrodes in place of gel-based disposable electrodes [14] . Comparisons between the developed stainless-steal threadbased sEMG electrodes (using conductive thread Sparkfun DEV-11791, 3.28 Ω m −1 ) and standard gel-based electrodes (Covidien Kendall Arbo H124SG) show that, while there is greater noise presence when using textile-based electrodes, muscle activity can still be observed and different levels of muscle engagement distinguished. For this paper, this technology is exploited to enable long term wearable measurement of muscle activity through an integrated textile device recording sEMG of the quadriceps muscles.
2) Circuitry and sensor placement: In the presented system, three pairs of electrodes are embroidered onto a pair of jogging leggings using a Pfaff Creative 3.0 (Pfaff, Kaiserslautern, Germany) sewing machine based on design variables obtained in [14] and according to the indications of the SENIAM project following a bipolar configuration. The placement area is tightened using extra thick felt fabric to enhance the contact with the skin tissue. European medium (M) leggings size is selected and the in leg longitude of the participants' leg measured to assure the location of the sensors to be the one outlined by the SENIAM project. To prevent voltage loss due to the high resistance of the conductive thread, the length of the connection lines is limited to 20 cm for which voltage losses are negligible. A double stitching pattern along with a zig-zag pattern ensured robust and stretchable connection lines. The leggings are powered at ±3.75 V using a single rechargeable battery of 7.5 V. Fig. 2 shows the final stages of the fabrication process. Silicone sealant (102 RTV, Hylomar) is used to isolate the connections of the power unit. Finally, a waterproof bag around the waist is used to carry the batteries whilst running.
3) Data acquisition: Three custom PCBs were created to acquire the sEMG signal through each pair of electrodes. Each PCB includes an instrumentation amplifier with adjustable gain according to G = 1 + (49.4kΩ)/R G , a first order active high pass filter (HPF), a first order active low pass filter (LPF), and a full-wave rectifier connected in cascade. The instrumentation amplifier computes the difference between the two collected signals and amplifies it. The cutoff frequencies of the HPF and the LPF are 20 Hz and 450 Hz respectively. The final PCB is flexible, with a thickness of 1.65 mm and weight of 0.25 g. An Arduino micro-controller is used to sample the signal from each PCB with a sampling frequency of 1 kHz and an SD shield (Adafruit, NY, USA) is used to store the collected data in a text file with a .csv format. Fig. 3 shows the circuit diagram of the PCB. 
To quantify muscle fatigue from the sEMG data collected using the sensor-embedded jogging leggings, the presented system includes a signal analysis script written in MATLAB which implements the fatigue analysis methods outlined in §II-B. The script includes computations of the instantaneous average rectified value (iARV), the instantaneous mean average value (iMAV) and the instantaneous root mean square (iRMS) value for amplitude based analysis. For the spectral analysis approach, the instantaneous mean and median frequencies, as well as the Dimitrov's spectral fatigue index (FInsm5) [15] are implemented. For the time-frequency analysis, the instantaneous WIRM1551, WIRM1M51, and WIRM1522 wavelets are implemented. The wavelet forms to calculate the wavelet indices are chosen to be the Symlet5 (sym5) and the Daubechies5 (db5) as according to Gozalez-Izal et al. [16] . Due to the inherent characteristics of the running activity outlined in §II-B and the fact that it has been extensively used in the literature [7] , the iARV signal was considered for assessing muscle fatigue. Such signal results of computing the average rectified value (ARV) value for a 0.2 s window, where the ARV is computed as shown in (1).
Here, x n are the values of the sEMG signal and n the number of samples.
This section presents experimental evaluations of the proposed device. A case study in which the device is used to detect muscle fatigue in a long distance running experiment outdoors is introduced.
In this section, two evaluations are described. Firstly, an assessment of the wearable sEMG monitoring jogging leggings outlined in §III is made, with an aim to investigate its suitability to natural environment motion experiments. Secondly, the sEMG data collected is analysed using the custom scripts in §III-B to evaluate how the fatigue of the quadriceps group varies depending on the running surface.
The experimental procedure is as follows. sEMG data is collected from N = 2 participants (mean weight 75±2.83 kg, and mean height 177±5.66 cm). For each participant, data is collected from three running trials (each of 5 km in length) on sand, asphalt, and an athletics track, where participants run at their normal training speed. Note, there is a minimum 24 h resting period between trials, to allow for muscles to recover. In accordance with the methodology outlined in §III, placement of the electrodes should not require anatomical knowledge. As such, runners were instructed to wear the leggings, and the electrodes were kept in the pre-built, standard position.
Before beginning the experiments, participant data is collected, including fitness level, age, height, weight, sex and running gear. A pre-screening test is performed to ascertain whether the participants were eligible for the experiments or not (PAR-Q&U questionnaire approved by the Canadian Society for Exercise Physiology). Ethical approval for the study was obtained prior to experiments from the King's College London Research Ethics office 1 . Fig. 4 shows the iARV for participant 1 whilst running on the three different surfaces. As explained in §II, the amplitude of the sEMG signal increases in presence of muscle fatigue as more muscle fibres are recruited. This phenomena is observed for the three surfaces with varying rates of increase, as the iARV value of the sEMG signal increases with time. Table 2 seen that running on the sand surface leads to the maximum amplitude increment of the iARV signal for the three muscles whereas the athletics track led to the minimum increase after the 5 km trials. Similar results are observed for participant 2, indicating that running on sand increases the likelihood of suffering from RRIs when compared to asphalt or athletics track surfaces.
As shown in §IV-A, wearable jogging leggings with in-built embroidered electrodes are a practical and effective method for the collection of sEMG signals in natural environments. However, due to the uncontrolled nature of these environments, there are a number of factors that could confound the results of the proceding section. This section discusses these issues, and their likely effect on the results presented so far. 1) Second wind effect: Looking at the signals in Fig. 4 , it can be observed that the iARV is greater at the beginning of all the trials and then decreases progressively before increasing in presence of muscle fatigue. This can be explained as a result of the second wind effect, which increases the serotonin levels of the participant after the first minutes of running [17] . This results in a decrement of the fatigue levels of the muscles at the beginning of an exercise.
2) Effect of Perspiration: The second issue relates to the effect of perspiration on the data recorded. During the course of experiments involving physical activity, the conductivity the user's skin tissue varies linearly with the number of active sweating glands [18] . In other words, the higher the sweating levels of the participant are, the more conductive their skin will be. In the device created for this study, the conductive thread wiring is not insulated and hence the conductance of the wiring changes, altering the behaviour of the circuit by increasing the inherent offset at the output of the PCBs. This phenomena is observed for all the trials and is particularly noticeable for the Vastus group muscles. Note that, the outdoor temperature for the first two trials (asphalt and sand) on the day of collecting data was 18 • C and 17 • C respectively whereas 27 • C was registered during the athletics track trial suggesting higher sweating levels during the last trial and, therefore, a greater percentage increase of the iARV signal. This suggests that the athletics track might result in lower fatigue levels than the ones measured. In spite of this phenomena, the classification of the surfaces remains the same as the athletics track still led to the lowest levels of muscle fatigue independently of the effect of the sweating.
V. CONCLUSION In this study, the design of a new minimally invasive muscle sensing device capable of recording muscle activity data in natural environments is created. The device offers wearable capabilities that allow long-term collection of data by inexperienced users. As explained in §I, changes in biomechanical factors such as muscle fatigue increase the likelihood of suffering from RRIs. A common way to study those changes is through EMG technology. However, current technology limits studies of muscle EMG to laboratory setting and requires operation by users with anatomical knowledge.
The experiments presented here show that wearable sEMG technology is feasible and that it has practical research applications. The wearable sEMG device is cheap, robust, easy to build and suitable for the every day user. As a proof of concept, N = 2 runners took part in three 5 km running trials on three different surfaces (asphalt, sand and athletics track) and with sEMG data recorded using reusable fabricbased electrodes. This equipment is then used in an outdoors setting to elucidate muscle fatigue. The results showed that different levels of muscle fatigue could be detected when running on different surfaces. They matched the expectations that running on the athletics track leads to the lowest levels of muscle fatigue, followed by the asphalt track and finally by the sand track as a direct consequence of muscle activity as outlined in [4] . This, in turn, suggests that running on sand increases the likelihood of suffering from RRIs when compared to the asphalt and athletics track surfaces.
There are many possible additions to the design which might improve performance. More robust PCBs without full wave rectification would make the overall design more resistant and allow time-frequency fatigue analysis techniques. Statex (PA66) and Loctite Hysol GR 9800 (Loctite, Dsseldorf, Germany) could be used for encapsulation of the PCBs [19] . Isolation of the conductive thread using Aleen's flexible stretch fabric glue (Duncan Enterprises, California, USA) would make the whole design robust against sweating.