A Real-Time Muscle Fatigue Detection System Based on Multifrequency EIM and sEMG for Effective NMES

Neuromuscular electrical stimulation (NMES) is a self-directed home-based therapeutic tool in early rehabilitation for musculoskeletal (MSK) conditions. However, the effectiveness of traditional NMES is fundamentally constrained by muscle fatigue. To address this limitation, this work proposes a detection system, which simultaneously records multifrequency electrical impedance myography (EIM) and surface electromyography (sEMG) in real-time for time-frequency analysis of muscle activation, contraction, and fatigue. To demonstrate the ability to monitor these muscle physiological states, two experiments involving weightless and weighted dynamic contractions of the biceps brachii muscle were performed. Results from these experiments show synchronous changes in sEMG and EIM spectra during contractions and clear trends in sEMG’s mean power frequency (MPF) and EIM spectra with fatigue progression. In addition, the configurable four-channel NMES has been electrically evaluated for clinical use, demonstrating the feasibility of the proposed system for closed-loop stimulation. This work showcases the potential of sEMG and multifrequency EIM to enhance the effectiveness of NMES for MSK conditions by capturing the behavior of distinct mechanisms of muscle fatigue.

patients.Wearable medical devices for treatment and monitoring of health conditions have emerged as a promising solution to address this increasing demand via home healthcare [3].Wearable neuromuscular electrical stimulation (NMES) has the potential to be a safe and easy-to-use tool for selfdirected home-based therapy in early MSK rehabilitation, preventing skeletal muscle weakness and preserving muscle mass [4], [5], [6].
NMES treatment involves the delivery of intermittent electrical pulses through surface electrodes to skeletal muscle, which induces involuntary muscle contractions.Traditional single-channel cyclic NMES operates as an open-loop system that uses a predefined stimulation program with fixed parameters and poor spatial resolution [7].This method recruits motor units in a nonselective and synchronous manner, leading to a rapid onset of muscle fatigue [8].In addition, without reading out the neuromuscular state, NMES tends to decrease voluntary neuromuscular activity [9].Consequently, the effectiveness of traditional NMES is fundamentally constrained.To overcome this limitation, a bidirectional interface, comprising NMES and real-time physiological status monitoring, is desired to enhance treatment through closed-loop stimulation.Researchers have made great efforts in the development of closed-loop NMES by incorporating noninvasive sensors and readouts to monitor physiological processes in real-time [10], [11].There are multiple physiological mechanisms that cause muscle fatigue [12], [13], [14], [15], which are typically divided into two groups: 1) central nervous system (CNS) mechanisms, which reduce the neural drive to activate muscles, and 2) peripheral mechanisms (also known as metabolic mechanisms), which reduce the ability of the muscle itself to generate force, independently of the CNS.Surface electromyography (sEMG) is the most commonly used method in closed-loop NMES systems as it provides information on electrophysiological properties, which are related to muscle force and CNS fatigue [7], [10].However, the major limitation of sEMG-based fatigue detection is its inherent nonstationary characteristics during dynamic contraction [16], which imposes challenging signal analysis for accurate detection.Therefore, to enhance the system's reliability in the assessment of muscle fatigue, it is relevant to monitor both these mechanisms, i.e., peripheral and CNS, via other techniques in bidirectional interfaces.
Several methods have been previously proposed to measure the peripheral mechanisms of muscle fatigue.Physiological indicators, such as saliva pH, urine protein level, and blood metabolites, can indirectly measure these mechanisms [17].However, they require to sample and analyze biological matter, making them unsuitable for real-time monitoring.Other noninvasive methods, such as ultrasound-based sonomyography (SMG) [18], mechanomyography (MMG) [19], and near-infrared spectroscopy (NIRS) [20], have been proposed for real-time monitoring of these mechanisms.However, these come with the downside of requiring dedicated transducers for each technique, which ultimately hinders system integration and flexibility.
Multifrequency electrical impedance myography (EIM), which measures bioimpedance (bio-Z) spectroscopy of muscle through surface electrodes, is an attractive technique to detect multiple peripheral mechanisms of fatigue.These mechanisms are detected by analyzing changes in the α and β dispersions of cells through the bio-Z spectra, which reflect changes in structure and composition of tissue and time-dependent relaxation behavior due to metabolic effects [21].When compared with the aforementioned noninvasive techniques, multifrequency EIM has the advantage that it can be measured through the same electrodes that are used for sEMG and NMES.In addition, multifrequency EIM has been proven to be a complementary technique to sEMG for reliable detection of muscle contractions [22], [23], [24], [25].
Several multimodal sensing approaches have been successful at detecting muscle fatigue and improving clinical performance of therapeutic devices in the presence of muscle fatigue.In [26], a real-time system for muscle activation and fatigue, which combines sEMG, SMG, and joint angle, was proposed.However, the proposed system requires separate bulky hardware for each technique and substantial computational power to process the combined data in real-time.Sheng et al. [27] and Guo et al. [28] present a sensor fusion approach incorporating sEMG, MMG, and NIRS, to improve the classification accuracy of hand-gesture recognition in the presence of muscle fatigue and to accurately assess muscle fatigue.Nonetheless, the performance of this approach is limited by NIRS optical noise in daylight or outdoor application.Moreover, integration and flexibility are limited due to the requirement of different transducers for each technique.In [29], a system which combines sEMG and electroencephalography (EEG) was proposed to overcome the limitations of muscle fatigue in hand-gesture recognition.Nevertheless, this approach does not capture the effects of peripheral mechanisms on the onset of muscle fatigue.
This article proposes a real-time muscle fatigue detection system, which simultaneously records multifrequency EIM and sEMG for time-frequency analysis of muscle activation, potentially enabling closed-loop NMES.This approach enables a higher degree of system integration and flexibility by sensing multifrequency EIM and sEMG and enables detection of muscle fatigue via CNS and peripheral mechanisms.This article is organized as follows: Section II presents an overview of the proposed system, Section III shows the experimental results which verify the proposed system and discusses the limitations and potential of the proposed system.Finally, Section IV concludes the article.

II. SYSTEM OVERVIEW
Fig. 1 presents the proposed muscle fatigue detection system, to enhance the effectiveness of NMES.The multimodal application-specific integrated circuit (ASIC) is capable of acquiring sEMG and multifrequency EIM signals and performing high-voltage (HV) compliant NMES.The microcontroller unit (MCU) is used to configure the ASIC for continuous acquisition and stimulation, while simultaneously processing the digitized multifrequency EIM and sEMG data.The processed data are sent to a personal computer (PC) for visualization purposes.This architecture allows to monitor physiological state and to deliver electrical stimulation, thereby enabling real-time muscle fatigue detection and adaptive NMES.
The developed multimodal ASIC integrates three configurable subsystems: 1) a bio-Z spectroscopy interface for multifrequency EIM; 2) a 16-channel sEMG analog frontend (AFE); and 3) a four-channel NMES.It also features internal clock generation from an external 128-MHz clock reference and a serial peripheral interface (SPI) secondary for receiving configuration parameters.The used STM32-F413 MCU performs its functions through several hardware peripherals and firmware modules, including: 1) an SPI primary, for configuring the ASIC subsystems; 2) a finite state machine (FSM), for controlling the stimulation pattern of NMES by managing the general-purpose input/output (GPIO) ports; 3) a universal asynchronous receiver/transmitter (UART), which receives commands from the PC for manual control of ASIC parameters; 4) an embedded analog-to-digital converter (ADC), which digitizes the 16-channel sEMG signals; 5) a digital signal processing (DSP) module, which processes the digitized sEMG and bio-Z signals; and 6) a universal serial bus (USB), for transmitting the data to the PC.The system also includes a power management unit for supplying the system with regulated dc voltages (1.83.340V) from a 5-V power bank or external power supply.

A. Bio-Z Spectroscopy Interface for Multifrequency EIM
Previous studies have demonstrated the potential of multifrequency EIM to detect exercise-induced muscle fatigue [30], [31], [32], [33], [34], as well as NMES-induced muscle fatigue [21], [35].It has been consistently shown in these studies that the baseline magnitude of muscle bio-Z across all the frequencies decreases with increasing exercised-induced and NMES-induced muscle fatigue.It has been hypothesized that this magnitude reduction is caused by several peripheral mechanisms of fatigue, which result in simultaneous decrease in extracellular resistance and muscle cell membrane capacitance.Although none of these studies has looked at the changes in the phase response, it can be expected that unless resistance and reactance are affected proportionally in the same way due to muscle fatigue, then the phase response would also be affected.Moreover, since conformational changes in muscle cells due to contractions also cause changes in muscle capacitance, there is additional value in monitoring changes in the phase as a reliable mean to detect movement [22], [23], [24].Therefore, it is relevant to monitor the bio-Z magnitude and phase spectra in real-time during muscle contractions caused by physical exercise or NMES, as a reliable mean to detect peripheral muscle fatigue.

1) Measurement Description and Design Requirements:
Multifrequency EIM measures the bio-Z of muscle using four surface electrodes.The outer electrodes deliver a low-amplitude sinusoidal current in the kHz to MHz frequency range, in compliance with the international standard IEC60601-1 [36].The inner electrodes capture the voltage response (V in ) from tissues, which contains the modulated bio-Z.
Since multifrequency EIM is used to detect muscle contraction and fatigue, which cause small bio-Z variations over time on a larger baseline bio-Z of muscles, the bio-Z spectroscopy interface should comply with the required bio-Z input range, precision, and accuracy, as well as the muscle contraction bandwidth.Typical bio-Z readings of multifrequency EIM on large muscle groups show baseline magnitudes ranging from 10 up to 1 k , which depend on anthropometric variations, body composition, and electrode positioning [37].Therefore, the output current amplitude of the signal generator and readout gain should be programmable to ensure that the bio-Z signal is within the maximum input range of the interface.In addition, due to muscle contractions and fatigue, the bio-Z experiences minimum relative magnitude and phase variations of around 1% and 1 • , respectively [21], [22], [24], [25], [30], [31], [32], [33], [34], [35], [37], [38].Consequently, the impedance sensitivity (R n,rms ) of the bio-Z spectroscopy interface should be lower than these relative changes over the baseline bio-Z of muscle.Since conformational changes due to muscle contractions occur in the 0.1 to 2-10-Hz bandwidth [39], [40], the bio-Z measurements at all the frequencies in the spectrum should be acquired faster than the Nyquist rate, i.e., ∼4-20 Hz.Finally, to potentially extend the use of the bio-Z spectroscopy interface to other applications, such as body composition analysis, diagnosis of neuromuscular disorders, and assessment of MSK conditions [41], baseline bio-Z measurement errors below 1% are considered.
2) Circuit Implementation: Fig. 2 shows the architecture of the fully integrated bio-Z spectroscopy interface, as presented in [42].The interface consists of two building blocks: 1) a sinusoidal signal generator (SSG) and 2) a quadrature low-intermediate frequency (IF) readout.The output bitstream of readout is decimated and filtered in the MCU to obtain the demodulated bio-Z data.
The SSG generates a 64-tap sinusoidal current signal with programmable frequency and amplitude.Its frequency ( f SG ) can be selected among 12 logarithmically spaced frequencies, between 1 kHz and 2 MHz, thus covering the bio-Z α and β dispersions.The current amplitude can be set between 1 and 150 µA to account for potentially large bio-Z due to body composition and small interelectrode distances.The SSG output is connected to an external passive RC high-pass filter (HPF) to bias the output stage and avoid injecting any dc current to the patient, as it is required for safety [36].
At its input, the quadrature low-IF readout is connected to an off-chip passive RC HPF, with a cutoff frequency of 10 Hz, to ac couple the incoming bio-Z signal.This signal is demodulated in its I/Q components to an IF, f IF = 15.625 kHz.These components are amplified by low-noise instrumentation amplifiers (IAs), which can be programmed between 6 and 20 dB in seven steps, to account for potentially large bio-Z, as it was mentioned for the current amplitude.These IAs also perform first-order anti-aliasing filtering, with cutoff frequency f c = 2 f IF = 31.25 kHz, and buffering before digitization at IF with a bandpass (BP) modulator with sampling frequency f s = 4 f IF = 62.5 kHz.Due to the chosen f c , the IAs introduce a phase delay of approximately 28 • at IF, which is calibrated in the MCU.The chosen f s enables easy demodulation of the digital output bitstream and sufficient data throughput to acquire the EIM spectrum within the muscle contraction time window.Throughout this process, the readout also rejects outof-band interference, such as biopotentials, motion artifacts, and the power line.

B. 16-Channel sEMG Readout
The sEMG technique is a noninvasive method for quantifying muscle activity, offering valuable insights into muscle function, movement patterns, and electrophysiological characteristics.Of particular significance is its ability to detect muscle fatigue, which is important in various clinical applications, such as therapeutic interventions, muscle strength training, prosthetic control, and rehabilitation strategies [43].
Conventional single-channel sEMG acquisition systems are constrained by their capability to record only a single muscle group at any given time.This limitation hinders their applicability in contexts where multiple muscle groups are activated during movement.To overcome this limitation, the proposed system integrates 16 sEMG recording channels, thereby enhancing spatial resolution and providing comprehensive information about complex movements.In addition, with the ability to monitor the physiological conditions of multiple muscle groups, it has the potential to assist closed-loop NMES systems in selecting the muscle group to be stimulated.
Muscle fatigue induces changes in sEMG signals, which manifest in both the time and frequency domains.One widely used time-domain feature associated with the onset of muscle fatigue is the integrated sEMG (IsEMG), which refers to the integral of the absolute value of raw sEMG signals in the time domain.Previous investigations have consistently observed a gradual increase in IsEMG as muscle fatigue progresses [44], [45], [46].However, the IsEMG is rarely used alone as an indicator; instead, it is commonly combined with frequency-domain features to assess muscle fatigue [47].
In the frequency domain, the mean power frequency (MPF) is a paramount indicator for fatigue detection.The MPF denotes the average frequency at which the product of the sEMG power spectrum and frequency is summed and divided by the total power [17].Mathematically, the MPF is expressed as where f n is the frequency variable, N is the number of bins within sEMG bandwidth, and PSD is the power spectral density, computed as PSD( f ) = |F sEMG ( f )| 2 , where F sEMG ( f ) represents the Fourier transform of the sEMG signal.
Previous studies have confirmed that MPF tends to shift toward lower frequencies with the progression of fatigue [48], [49], [50].To facilitate real-time fatigue detection, the proposed system is based on time-frequency analysis, which captures the time-varying behavior of signal energy across both the time and frequency axes.
1) Signal Properties and Design Requirements: The useful information of sEMG signals typically lies within the frequency band from 20 to 500 Hz with a peak amplitude of up to 5 mV [51].Therefore, the AFE must exhibit minimal input-referred noise, making it negligible with respect to the noise of surface electrodes.In addition, the amplifier must provide consistent gain across the sEMG bandwidth while maintaining high linearity to ensure signal quality for further signal processing.Furthermore, it must effectively reject electrode dc-offset (EDO) and low-frequency noise induced by movement artifacts and fluctuations at the electrode-skin interface.Finally, the input impedance of the amplifier must exceed the skin-electrode impedance within the sEMG bandwidth by at least two orders of magnitude to mitigate the loading effect [52].
2) Circuit Implementation: Fig. 3 shows the architecture of the proposed 16-channel AFE for sEMG recording, which offers a programmable gain (23-43 dB), exhibits a high-pass cutoff frequency of 10 Hz, and tolerates an EDO up to ±100 mV.The circuitry consists of several key building blocks: a 16-channel chopper-based biopotential amplifier [53], a programmable gain amplifier (PGA), and an anti-aliasing filter (AAF).This architecture adopts the frequency-division multiplexing (FDM) scheme for multichannel recording, as demonstrated in Fig. 3. Consequently, the

C. Four-Channel 40-V NMES Interface
Conventional single-channel NMES systems use a pair of electrodes with a fixed spatial configuration, allowing the activation of a single muscle group.However, in clinical practice, it is commonly required to stimulate more than one muscle group.On the contrary, multichannel NMES systems offer advantages of the spatial and temporal distribution of the stimulation current, enabling the stimulation of multiple muscle groups without repositioning the electrodes.Moreover, the study in [8] has shown that multichannel asynchronous stimulation prolongs the onset of muscle fatigue in comparison to single-channel synchronous stimulation.Consequently, to leverage these benefits, a four-channel NMES interface was integrated into the ASIC.

1) Stimulation Protocol:
Stimulating with bipolar charge-balanced biphasic current pulses to generate amplitude ramp modulated bursts, as illustrated in Fig. 4, is common practice to prevent excess charge accumulation over time and maximize the produced muscle force while minimizing discomfort during NMES treatment [54], [55].In addition, various simulation parameters, such as current strength (I ST ), phase duration (T PD ), interphase delay (T IPD ), ramp time (T Ramp ), plateau time (T Plateau ), and duty ratio (D ST = T Burst f ST ), significantly influence stimulation efficacy and patient comfort and must comply with international standards IEC 60601-1 and IEC 60601-2-10 [36], [56].It should be noted that there are no universal stimulation parameters.Even for the same patient, the most effective NMES parameters may vary over time depending on physiological conditions.Consequently, to dynamically adapt to the patient's physical state, the NMES systems require configurability of multiple parameters.
2) Circuit Implementation: Fig. 5 depicts the architecture of the proposed four-channel NMES subsystem, comprising the NMES circuitry and the digital controller.The NMES circuitry, previously presented in [57], can be divided into two power domains: 3.3 V for low-voltage (LV) CMOS devices and 40 V for HV DMOS devices.The HV stimulus drivers that connect to the electrode array form four stimulation channels in bipolar configuration.The polarity of the stimulation current is changeable using the H-bridge structure, which offers the flexibility to generate either monophasic or biphasic pulses.The stimulation current, ranging from 1 to 30 mA, is provided by the tail HV current generator, with its current strength determined by the settings of the 5-bit LV current digital-to-analog converter (I-DAC).The binary-to-thermometer decoders select a working electrode pair to deliver the current stimulation, while the pulse parameters, as discussed in Section II-C1, are controlled by the 3-bit digital inputs of the decoders.

D. DSP and NMES Controller
The ASIC presented in Sections II-A-II-C allows sEMG and bio-Z sensing and muscular stimulation.To enable realtime monitoring of the physiological state and closed-loop stimulation, it is essential to have embedded DSP and a digital controller for NMES to configure the stimulation parameters.These functions are implemented using an external MCU.

1) Real-Time Processing of bio-Z Spectroscopy and sEMG:
The bio-Z modulator output at IF is downconverted to dc and processed by a decimation filter, as illustrated in Fig. 6.The single-bit bitstream from the I/Q channels is downconverted through a product operation with a simple trilevel sequence, given that the sampling frequency is f s = 4 f IF .To extract the bio-Z real and imaginary parts (D Re , and D Im , respectively), the downconverted signals undergo a cascade integrator-comb (CIC) filter, decimation by a factor D 2 , and a CIC-compensation FIR filter.The decimation filter parameters have been chosen to extract the bio-Z over a 61-Hz band with The 16-channel FDM sEMG is sampled at f s by the embedded 12-bit ADC within the MCU.The digitized data are s demultiplexed by the DSP module, as illustrated in Fig. 6.Each modulated channel is then processed by an infinite impulse response (IIR) band-selection filter (BSF), aligned with its designated frequency band, isolating it from other channels.Following this, the filtered signal is downconverted into baseband through a product operation involving a cosine carrier set at the center frequency of each channel.These carriers are generated using direct digital synthesis.Subsequently, the sEMG signal of each channel is extracted by applying an IIR low-pass filter (LPF) with a cutoff frequency of 500 Hz.To reduce the computational overhead, the resulting signal is downsampled by a factor D 1 .Finally, real-time N-point FFT is performed on the data to obtain the signal spectrum, of which the frequency resolution is configurable and determined by f s /(D 1 • N ).
To obtain the bio-Z spectrum, the bio-Z spectroscopy interface is sequentially programmed by the MCU to generate a sinusoidal signal at each of the 12 frequencies between 1 kHz and 2 MHz.To change the frequency configuration, the SPI resets all the internal registers of the ASIC and sets a completely new configuration.While the new ASIC configuration is being transferred via SPI, the ASIC does not acquire data.Therefore, the MCU synchronizes the processing of the bio-Z data block at each frequency and the processing of the sEMG data block, before changing the ASIC frequency configuration.Once the 12 frequency points in the bio-Z spectrum have been processed, the MCU calculates the average power spectrum from the root-mean-square value of the acquired sEMG spectra.The bio-Z spectrum and averaged power spectrum of sEMG are then sent via USB to the PC, and the process is repeated iteratively.
2) Digital Controller for NMES: The user-defined stimulation parameters are configured through UART, as shown in Fig. 5.An FSM was developed to control the NMES, generating biphasic current pulses according to these parameters, as illustrated in Fig. 7(a).The FSM is triggered by an internal timer, updating its state every 10 µs.Initially, the FSM is in the OFF state, disabling the NMES.Upon receiving an enable (EN) command, the NMES continuously produces biphasic pulses until EN is reset.Throughout the operation, the FSM cycles through the anodic (ANO), interphase delay (IPD), and cathodic (CAT) states.During the ANO/CAT state, the NMES delivers a constant current with magnitude set by MAG[4:0] and the polarity determined by controlling the H-bridge via ChSel HS [2:0] and ChSel LS [2:0].The FSM remains in each state until the counter (CNT 1 ) reaches the index, calculated based on the defined duration of each phase.
The amplitude ramp modulation, shown in Fig. 4, is achieved using the FSM, depicted in Fig. 7

III. EXPERIMENTAL RESULTS AND DISCUSSION
To validate the proposed system, functional verification of the NMES interface and two in vivo experiments of simultaneous recording of multifrequency EIM and sEMG on the biceps brachii muscle were performed.Fig. 8 shows the experimental setup, the ASIC die micrograph with an overlayed transparent image of the layout, and the evaluation board for electrical characterization and experimental purposes.
KTH Royal Institute of Technology's ethical advisor reviewed the details of the in vivo experiments and concluded that they did not require ethical permission from the Swedish Ethical Review Board.

A. Functional Verification of NMES Interface
The NMES interface has been demonstrated experimentally, since in vivo tests of NMES should be performed by trained Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.medical doctors and would require ethical approval.Accordingly, the performance of the four-channel NMES was instead evaluated by following the guidelines provided by the Food and Drug Administration (FDA) for reporting technological characteristics of powered muscle stimulation [58], in which the functionality of NMES systems is electrically evaluated through the measurement of output waveforms under a 500resistor.
Fig. 9 showcases a stimulation burst featuring amplitude ramp modulation.The burst represents the voltage difference across a 500-loading resistor.In this demonstration, the stimulation current gradually increases with increments of 2 mA until reaching the target level of 30mA, followed by a gradual decrease to the OFF-state after the plateau phase.This measurement showcases the programmability of parameters, such as step size, target level, and timing as required for the application.
Fig. 10 presents biphasic stimulation pulses at various current strength settings: 5 , 10 , 15 , 20 , 25 , and 30 mA.In addition to the configurable current strength, Fig. 10 demonstrates the independent control of the duration of the ANO/CAT phase.The measurement results verify that the proposed NMES system offers configurability of several parameters and achieves successful delivery of current up to 30 mA from a 40-V supply without encountering any device reliability issue.

B. In Vivo Experimental Protocol
The sEMG and bio-Z signals are simultaneously recorded during the experiments from the biceps brachii muscles using the proposed system via commercial 3 M Red Dot 2500-series disposable surface electrodes, with an interelectrode distance of approximately 4 cm.A reference electrode is placed at the proximal end of the elbow to reduce power line interference.It is worth noting that only one sEMG channel was enabled, as a single muscle group was under study.
To demonstrate the system ability to detect muscle contractions in real-time, the subject performed bicep curls without weight.To demonstrate the system ability to detect muscle fatigue, the subject performed concentration bicep curls with the right arm using a 10-kg dumbbell (corresponding to ∼50% of the subject's one-repetition maximum weight).The dynamic contractions were repeated with a controlled eccentric phase and an explosive concentric phase.The acquisition of sEMG and bio-Z signals continued until concentric muscular failure, i.e., until the subject is unable to continue exercise.

C. Real-Time Multimodal Recording During Muscle Contractions
Fig. 11 shows the real-time sEMG and EIM spectra during weightless contractions of the biceps brachii muscle.The sEMG spectra data have been normalized to the maximum recorded magnitude during the experimental procedure for visualization and interpretation purposes.Clear magnitude peaks at ∼100 Hz can be seen in the sEMG spectra, shown in Fig. 11(a), when a contraction occurs.This is consistent with previous studies [59], which have demonstrated that the dominant components lie in the 50-150-Hz range within the sEMG spectra during dynamic contractions.This verifies that the achieved sensitivity and frequency resolution are sufficient for the application.It can also be seen that the bio-Z magnitude and phase spectra, shown in Fig. 11(b) and (c), change synchronously with the sEMG spectra during muscle contractions, which demonstrates that the bio-Z spectroscopy interface latency and data throughput are adequate for realtime detection.Moreover, due to the high precision of the bio-Z spectroscopy interface [42], the system can detect the small bio-Z spectra changes during contractions over the baseline muscle bio-Z.The observed changes in the bio-Z magnitude and phase are consistent with previous demonstrations [22], [24], in which the magnitude decreases across all the frequencies, while the phase experiences an X-crossing effect at 15.625 kHz, i.e., an increase above this frequency, and a decrease at most frequencies below it.Nonetheless, it is worth noting that there are some inconsistencies in the X-crossing effect below 15.625 kHz.This might be related to change in arm position, which changes fluid distribution in the arm, and electrode contact artifacts, which are more prominent at the lower end of the frequency range [23], [60].
Fig. 12 shows the real-time bio-Z spectra during weighted contractions of the biceps brachii muscle.To clearly visualize the overall trend of the data, a moving average of 40 samples over time has been applied to the spectra, thus disregarding the small bio-Z changes due to contractions.It can be seen in the bio-Z magnitude that there is an overall decrease across all the frequencies as fatigue builds up, from Fig. 12(a) to (d).Another observation is that there is a drastic change in the bio-Z magnitude at the mid-range frequencies, around 31.25-125 kHz, from the unexercised muscles in Fig. 12(a), to the first set of dynamic contractions in Fig. 12(b).This could be due to the change in arm position and the isometric contraction of muscles at the start of the set, when compared with the reference measurement before exercise.It can also be noted in Fig. 12(b) and (c) that even though during the course of the set the magnitude decreases, there is a slight increase toward the end, when the subject reaches muscular concentric failure.This indicates a potential decrease in muscle cell capacitance due to muscle cell membrane damage or intracellular-to-total water ratio [15], [61], [62].In fact, the evolution of the bio-Z phase spectra suggests that the muscle capacitance is lower, since there is a left peak-phase shift with fatigue progression.
Fig. 13 presents the real-time MPF of the acquired sEMG PSD during the weighted contractions of the biceps brachii muscle.The recorded MPF exhibits large fluctuations owing to the dynamic muscle contractions during the exercise.To visualize the overall frequency shift, a moving average of 40 samples over time has been applied to the raw data.Notably, across two sets of dynamic contractions, it is evident that the MPF gradually decreases as the exercise progresses, indicating a slowdown in the conduction velocity (CV) of muscle fibers with the onset of muscle fatigue [43].

D. Discussion
The results presented in the previous subsections demonstrate that the proposed system has the ability to simultaneously record real-time sEMG and multifrequency EIM for detection of muscle fatigue and reliably generate biphasic pulse patterns as required for efficient NMES.Nonetheless, further clinical studies on human subjects are required to demonstrate the potential of extracting and combining features from multifrequency EIM and sEMG, to control NMES parameters, as enabled by the proposed system.
With the ability to characterize the movement intention and muscle state, we can envision a closed-loop NMES system that provides adaptive stimulation, thereby enhancing the effectiveness of the electrical treatment for MSK conditions.However, it is worth noting that HV NMES induces large stimulation artifacts, which might saturate and potentially damage the LV bio-Z spectroscopy interface and the 16-channel sEMG AFE [63].Therefore, it is unfeasible to record EIM and sEMG during stimulation pulses.Despite this, it is still possible to achieve closed-loop stimulation.HV-protection switches for analog multiplexing would be required to time-interleave the HV NMES and the LV subsystems, for fatigue detection throughout the stimulation burst duration.Such techniques have been successfully reported for similar applications [64], [65], [66] and could be adapted in the context of this work.
Although we have demonstrated promising outcomes from our approach for fatigue detection, the limitations of each technique are worth discussing.The presented sEMG-based  approach has several limitations in practice.First, the conventional indicator of MPF exhibits significant fluctuations during dynamic contractions, as demonstrated in Fig. 13, hindering the accuracy of fatigue detection.This originates from several factors that cause the nonstationarity of the sEMG signals [67], [68].In addition, the sEMG signals are sensitive to factors unrelated to the exercise under investigation, such as biomechanical factors and contraction speed, leading to changes in muscle activation that are not fully correlated to the EMG signal features [69].Nevertheless, sEMG serves as a direct method to obtain information on muscle activation, which is important in studying the physiological states of muscles.Moreover, the limitations of sEMG-based fatigue detection can be compensated by multifrequency EIM using data fusion, since EIM is not sensitive to the external factors that affect sEMG.Still, it should be considered that multifrequency EIM-based fatigue detection has its own limitations.Even though the presented results demonstrate that the overall progression of muscle fatigue, during and between sets, can be clearly identified from the bio-Z spectra, the data must be interpreted carefully.The actual electrical characteristics of the measured bio-Z depend on several electrophysiological and anthropometric factors [37], [70], [71], [72].In addition, peripheral mechanisms of muscle fatigue are complex processes which might affect the bio-Z spectra in several ways.Despite this, our results reinforce the idea that real-time observation of the bio-Z magnitude and phase response of muscles have value in fatigue assessments.Our multifrequency EIM-based fatigue detection could be improved by also measuring transverse multifrequency EIM (across the muscle fibers), which would show the impact of muscle anisotropy [73], [74], [75].Yet, further studies are required to ensure an accurate interpretation of multifrequency EIM and understand the specific role of peripheral mechanisms in the bio-Z spectra.
Despite the individual limitations of multifrequency EIM and sEMG for fatigue detection, the complementary nature of both the techniques motivates their simultaneous recording.Moreover, each technique has its own value, as the monitored signals capture the behavior of distinct mechanisms, which are related to different aspects of muscle physiology.To the best of the authors' knowledge, this is the first multimodal system for real-time recording of multifrequency EIM and sEMG, which potentially enables reliable fatigue detection and accurate assessment of the degree of fatigue by applying more advanced signal processing, feature extraction, data fusion, and classification.For instance, wavelet and Stockwell transforms can be applied to sEMG data to distinguish nonfatigue and fatigue conditions during dynamic muscle contractions [76], [77].Similarly, functional principal component analysis or state-space approaches can be applied to multifrequency EIM data to account for variability across subjects and measurement conditions [78], [79].Multiple data fusion and classification approaches could be applied to the extracted features via the aforementioned methods to accurately estimate the onset and degree of fatigue.
By integrating multimodal recording and stimulation into a single ASIC, the proposed system allows on-chip communication and synchronization between subsystems, mitigating the issue of combining separate bulky systems for each technique.As such, this work is a step forward toward wearable devices for MSK healthcare.

IV. CONCLUSION
This article presents a proof-of-concept system, consisting of a bidirectional interface that integrates multimodal monitoring of muscular physiological state, and electrical stimulation, for muscular healthcare applications.The proposed system allows real-time detection of muscle contraction and fatigue, based on simultaneous recording of multifrequency EIM and sEMG, which has been experimentally demonstrated.In addition, the configurable NMES has been electrically evaluated for clinical use.The measurement results have proven the system's potential to perform closed-loop stimulation, which enables adaptive NMES to enhance the effectiveness of electrical treatment for MSK conditions.

Fig. 2 .
Fig. 2. Block diagram of the proposed bio-Z spectroscopy interface subsystem.
(b), consisting of initial (INIT), ramp-up (UP), plateau (PT), and rampdown (DN) states.Initially, the FSM is in the INIT state, configuring MAG[4:0] to 5'b00000.Once an NMES program starts, it transits to the UP state, in which the digital controller incrementally increases the MAG[4:0] by the user-defined step size, and executes one cycle of ANO, IPD, and CAT states to deliver a biphasic pulse with the magnitude defined by MAG[4:0].The FSM remains in the UP state until MAG[4:0] reaches the user-defined amplitude (AMP), and then transits to the PT state.The current magnitude remains constant for the user-specified number of cycles (CY#) within the PT state.Subsequently, in the DN state, the FSM decrements MAG[4:0] by the step size until it reaches zero, representing the end of the burst duration and returning to the INIT state.

Fig. 10 .
Fig. 10.Measurement result of biphasic stimulation pulses at various current strength settings.

Fig. 12 .
Fig. 12. Averaged real-time EIM spectra during weighted dynamic contractions of biceps brachii muscle: (a) reference spectra before exercise, (b) first set of dynamic contractions, (c) last set of dynamic contractions, and (d) reference spectra after exercise.