<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pc5271.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Baoqi</id>
	<title>pc5271AY2526wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://pc5271.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Baoqi"/>
	<link rel="alternate" type="text/html" href="https://pc5271.org/index.php/Special:Contributions/Baoqi"/>
	<updated>2026-04-15T18:57:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=809</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=809"/>
		<updated>2026-04-15T03:21:40Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* System Architecture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|thumb|center|800px|Figure 2.1. Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．]]&lt;br /&gt;
&lt;br /&gt;
=== sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|thumb|center|800px|Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|thumb|center|800px|Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|thumb|center|800px|Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|thumb|center|800px|Figure 2.5. Physical picture of the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=808</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=808"/>
		<updated>2026-04-15T03:19:51Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2．1 Total Structure Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== 2．1 Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|thumb|center|800px|Figure 2.1. Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．]]&lt;br /&gt;
&lt;br /&gt;
=== 2.2 sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．1 First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．2 Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|thumb|center|800px|Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.3  Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|thumb|center|800px|Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|thumb|center|800px|Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.5 Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|thumb|center|800px|Figure 2.5. Physical picture of the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3 ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.1 ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.2 Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.4 Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.6 Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=807</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=807"/>
		<updated>2026-04-15T03:19:01Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2．2．2 Bandpass Filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== 2．1 Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2．1．Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．&lt;br /&gt;
&lt;br /&gt;
=== 2.2 sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．1 First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．2 Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|thumb|center|800px|Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.3  Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|thumb|center|800px|Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|thumb|center|800px|Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.5 Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|thumb|center|800px|Figure 2.5. Physical picture of the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3 ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.1 ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.2 Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.4 Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.6 Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=806</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=806"/>
		<updated>2026-04-15T03:18:18Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2.2.3  Notch Filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== 2．1 Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2．1．Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．&lt;br /&gt;
&lt;br /&gt;
=== 2.2 sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．1 First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．2 Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.3  Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|thumb|center|800px|Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|thumb|center|800px|Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.5 Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|thumb|center|800px|Figure 2.5. Physical picture of the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3 ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.1 ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.2 Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.4 Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.6 Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=805</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=805"/>
		<updated>2026-04-15T03:17:18Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2.2.4 Second-order Amplifier &amp;amp; Level Shifter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== 2．1 Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2．1．Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．&lt;br /&gt;
&lt;br /&gt;
=== 2.2 sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．1 First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．2 Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.3  Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|thumb|center|800px|Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.5 Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|thumb|center|800px|Figure 2.5. Physical picture of the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3 ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.1 ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.2 Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.4 Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.6 Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=804</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=804"/>
		<updated>2026-04-15T03:16:23Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2.2.5 Power Module and Drive-electrode Circuit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== 2．1 Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2．1．Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．&lt;br /&gt;
&lt;br /&gt;
=== 2.2 sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．1 First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．2 Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.3  Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.5 Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|thumb|center|800px|Figure 2.5. Physical picture of the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3 ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.1 ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.2 Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.4 Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.6 Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=803</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=803"/>
		<updated>2026-04-15T03:15:02Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2.3.1 ADC Core Architecture and Design Rationale */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== 2．1 Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2．1．Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．&lt;br /&gt;
&lt;br /&gt;
=== 2.2 sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．1 First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．2 Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.3  Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.5 Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.5. Physical picture of the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3 ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.1 ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.2 Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.4 Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.6 Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=802</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=802"/>
		<updated>2026-04-15T03:13:42Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2.3.6 Hardware-level Working Principle of the ADC Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== 2．1 Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2．1．Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．&lt;br /&gt;
&lt;br /&gt;
=== 2.2 sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．1 First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．2 Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.3  Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.5 Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.5. Physical picture of the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3 ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.1 ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.2 Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.4 Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.6 Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=801</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=801"/>
		<updated>2026-04-15T02:55:22Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* System Architecture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== 2．1 Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2．1．Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．&lt;br /&gt;
&lt;br /&gt;
=== 2.2 sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．1 First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== 2．2．2 Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.3  Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== 2.2.5 Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.5. Physical picture of the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3 ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.1 ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.2 Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.4 Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== 2.3.6 Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=File:Figure_2_7.jpg&amp;diff=800</id>
		<title>File:Figure 2 7.jpg</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=File:Figure_2_7.jpg&amp;diff=800"/>
		<updated>2026-04-15T02:50:29Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=File:Figure_2_6.jpg&amp;diff=799</id>
		<title>File:Figure 2 6.jpg</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=File:Figure_2_6.jpg&amp;diff=799"/>
		<updated>2026-04-15T02:50:16Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=File:Figure_2_5.jpg&amp;diff=798</id>
		<title>File:Figure 2 5.jpg</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=File:Figure_2_5.jpg&amp;diff=798"/>
		<updated>2026-04-15T02:50:02Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=File:Figure_2_4.jpg&amp;diff=797</id>
		<title>File:Figure 2 4.jpg</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=File:Figure_2_4.jpg&amp;diff=797"/>
		<updated>2026-04-15T02:49:50Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=File:Figure_2_3.jpg&amp;diff=796</id>
		<title>File:Figure 2 3.jpg</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=File:Figure_2_3.jpg&amp;diff=796"/>
		<updated>2026-04-15T02:49:36Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=File:Figure_2_2.jpg&amp;diff=795</id>
		<title>File:Figure 2 2.jpg</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=File:Figure_2_2.jpg&amp;diff=795"/>
		<updated>2026-04-15T02:49:24Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=File:Figure_2_1.jpg&amp;diff=794</id>
		<title>File:Figure 2 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=File:Figure_2_1.jpg&amp;diff=794"/>
		<updated>2026-04-15T02:49:03Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=793</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=793"/>
		<updated>2026-04-15T02:42:19Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2.3 ADS1256-based ADC Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=792</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=792"/>
		<updated>2026-04-15T02:42:01Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2.2 sEMG AFE Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
== 2.3 ADS1256-based ADC Board ==&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.1 ADC Core Architecture and Design Rationale ===&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.2 Analog Front-End Interface, Reference, and Clocking ===&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ===&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.4 Power Supply and On-board Regulation ===&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ===&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.6 Hardware-level Working Principle of the ADC Board ===&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=791</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=791"/>
		<updated>2026-04-15T02:41:43Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2．1 Total Structure Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
== 2.2 sEMG AFE Design ==&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
=== 2．2．1 First－order Amplifier ===&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
=== 2．2．2 Bandpass Filter ===&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
=== 2.2.3  Notch Filter ===&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
=== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ===&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
=== 2.2.5 Power Module and Drive-electrode Circuit ===&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.5. Physical picture of the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
== 2.3 ADS1256-based ADC Board ==&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.1 ADC Core Architecture and Design Rationale ===&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.2 Analog Front-End Interface, Reference, and Clocking ===&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ===&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.4 Power Supply and On-board Regulation ===&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ===&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.6 Hardware-level Working Principle of the ADC Board ===&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=790</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=790"/>
		<updated>2026-04-15T02:40:59Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* 2．1 Total Structure Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== 2．1 Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2．1．Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．&lt;br /&gt;
&lt;br /&gt;
== 2.2 sEMG AFE Design ==&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
=== 2．2．1 First－order Amplifier ===&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
=== 2．2．2 Bandpass Filter ===&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
=== 2.2.3  Notch Filter ===&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
=== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ===&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
=== 2.2.5 Power Module and Drive-electrode Circuit ===&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.5. Physical picture of the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
== 2.3 ADS1256-based ADC Board ==&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.1 ADC Core Architecture and Design Rationale ===&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.2 Analog Front-End Interface, Reference, and Clocking ===&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ===&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.4 Power Supply and On-board Regulation ===&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ===&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.6 Hardware-level Working Principle of the ADC Board ===&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=789</id>
		<title>Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=789"/>
		<updated>2026-04-15T02:39:01Z</updated>

		<summary type="html">&lt;p&gt;Baoqi: /* System Architecture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
== 2．1 Total Structure Design ==&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2．1．Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．&lt;br /&gt;
&lt;br /&gt;
== 2.2 sEMG AFE Design ==&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
=== 2．2．1 First－order Amplifier ===&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
=== 2．2．2 Bandpass Filter ===&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
=== 2.2.3  Notch Filter ===&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
=== 2.2.4 Second-order Amplifier &amp;amp; Level Shifter ===&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
=== 2.2.5 Power Module and Drive-electrode Circuit ===&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.5. Physical picture of the sEMG AFE.&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
== 2.3 ADS1256-based ADC Board ==&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.1 ADC Core Architecture and Design Rationale ===&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.2 Analog Front-End Interface, Reference, and Clocking ===&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.3 SPI Interface between ADS1256 and STM32F103C8T6 ===&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.4 Power Supply and On-board Regulation ===&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.5 Basic Peripheral Circuits of the STM32F103C8T6 ===&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
=== 2.3.6 Hardware-level Working Principle of the ADC Board ===&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|center|600px]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to several sources of contamination during acquisition. In practical measurements, the dominant disturbances usually include low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation, narrow-band power-line interference centered at 50 Hz, and broadband high-frequency electronic noise introduced by the acquisition hardware. These unwanted components degrade the quality of the recorded signal and may significantly affect the reliability of subsequent feature extraction, parameter estimation, and muscle activity interpretation. For this reason, an effective signal-conditioning procedure is necessary before any higher-level analysis is performed.&lt;br /&gt;
&lt;br /&gt;
In the present implementation, the filtering strategy follows the principle of restricting the signal bandwidth first and then removing the remaining narrow-band interference in a targeted manner. Accordingly, the raw sEMG signal is first processed by a fourth-order Butterworth IIR band-pass filter and then by a 50 Hz notch filter. This processing sequence is illustrated in the flowchart below, where the signal passes through band-pass filtering, notch filtering, full-wave rectification, and envelope extraction before producing the final processed output.&lt;br /&gt;
&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|Flowchart of the real-time sEMG signal conditioning pipeline.]]&lt;br /&gt;
&lt;br /&gt;
The rationale of this order is that the &#039;&#039;&#039;band-pass stage&#039;&#039;&#039; first confines the signal to the main spectral region of interest for sEMG, thereby attenuating motion artifacts at very low frequencies and suppressing high-frequency noise components outside the physiological band. After this spectral preconditioning, the notch stage can more effectively suppress the residual 50 Hz power-line interference that lies inside the useful sEMG band. In transfer-function form, the band-pass filter may be written as &amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;, where the effective passband is selected as &amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;. This frequency interval is consistent with the dominant spectral content of surface EMG: the lower cutoff near 20 Hz reduces motion artifacts and unstable low-frequency fluctuations, whereas the upper cutoff near 160 Hz removes high-frequency electronic noise while preserving the main energy-bearing components of the muscle signal. The use of a Butterworth structure is appropriate here because it provides a smooth monotonic passband response without ripple, which helps preserve signal morphology in real-time applications.&lt;br /&gt;
&lt;br /&gt;
After band limitation, a &#039;&#039;&#039;notch filter&#039;&#039;&#039; centered at the power-line frequency is applied to suppress interference that cannot be removed by the band-pass stage alone. The notch filter is designed around &amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;, and its bandwidth is controlled by the quality factor &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, which is expressed as &amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;. In transfer-function form, the notch stage is written as &amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;. In the implemented program, a large quality factor is chosen so that the notch remains narrow, allowing effective rejection of the 50 Hz interference while minimizing distortion of neighboring useful spectral components. This is particularly important for sEMG because the interference frequency lies directly inside the physiological band of interest.&lt;br /&gt;
&lt;br /&gt;
Following the filtering stages, further signal conditioning is performed to obtain a representation that is more directly related to muscle activation intensity. The filtered sEMG waveform is first &#039;&#039;&#039;full-wave rectified&#039;&#039;&#039;, which converts the bipolar oscillatory signal into a unipolar signal by taking its absolute value.  Rectification does not remove noise by itself; instead, it transforms the signal into a form that is more suitable for amplitude-based analysis because both positive and negative deflections contribute positively to the activation measure.&lt;br /&gt;
&lt;br /&gt;
After rectification, the signal envelope is extracted to provide a smooth estimate of muscle activation level over time. In a general formulation, the envelope can be described as the &#039;&#039;&#039;low-pass filtered&#039;&#039;&#039; version of the rectified signal, namely &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;. In the present code implementation, this operation is realized by short-time averaging over a finite window, which is equivalent to a moving-average low-pass smoothing of the rectified waveform. The corresponding expression is &amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \frac{1}{N}\sum_{k=0}^{N-1} |x[n-k]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length in samples. With a window duration of approximately 200 ms, this envelope extraction method provides a stable and physiologically meaningful representation of muscle activation intensity, making it suitable for tasks such as force estimation, fatigue analysis, and motor-control studies.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present &#039;&#039;&#039;implementation&#039;&#039;&#039; is that the entire filtering process is performed &#039;&#039;&#039;in real time&#039;&#039;&#039;, sample by sample, rather than by offline block processing. For this reason, IIR filters are preferred over FIR filters, since they can achieve comparable filtering performance with lower order, lower computational cost, and shorter delay. These properties are especially valuable in embedded systems, serial data streaming, and other low-latency experimental applications. However, unlike memoryless operations, an IIR filter depends not only on the current input but also on previous inputs and previous outputs. Its discrete-time behavior can therefore be represented by the recursive difference equation &amp;lt;math&amp;gt;y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&amp;lt;/math&amp;gt;. This equation makes clear that internal filter states must be preserved continuously during streaming operation. If the state variables were reinitialized for every incoming sample or data segment, artificial transients would appear and the output would no longer remain continuous.&lt;br /&gt;
&lt;br /&gt;
In the Python implementation, this state continuity is maintained using the internal initial-condition mechanism provided by SciPy, such as &amp;lt;code&amp;gt;lfilter_zi&amp;lt;/code&amp;gt;, together with recursive state updates during each filtering call. As a result, each newly acquired sample is passed first through the band-pass filter and then through the notch filter, while the internal states of both filters are updated after every step. This state-preserving sample-by-sample design ensures that the processing chain remains causal, continuous, and suitable for real-time display or downstream analysis without requiring storage of the entire signal segment.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides an experimentally practical solution for real-time sEMG processing. The fourth-order Butterworth band-pass filter confines the signal to the main physiological band of interest, the 50 Hz notch filter removes narrow-band power-line contamination, and the subsequent rectification and envelope extraction generate a smooth amplitude descriptor of muscle activity. Combined with state-preserved streaming IIR implementation, this approach achieves a good balance between signal fidelity, computational efficiency, and real-time applicability in biomedical and physical experiment settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data processing and analysis==&lt;br /&gt;
&lt;br /&gt;
===Data Processing===&lt;br /&gt;
&lt;br /&gt;
===Experimental Results===&lt;br /&gt;
&lt;br /&gt;
== Multi-subject Analysis ==&lt;br /&gt;
=== System Evaluation ===&lt;br /&gt;
&lt;br /&gt;
This section evaluates the performance of the EMG acquisition system in terms of noise level, signal quality, activity discrimination, and repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Noise Floor Analysis ====&lt;br /&gt;
&lt;br /&gt;
The noise floor was evaluated using rest-state recordings, characterized by RMS noise, standard deviation, and peak-to-peak amplitude.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; shows the lowest noise level (RMS ≈ 0.0046), indicating stable electrode contact and minimal interference.  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; exhibits moderate noise (RMS ≈ 0.0080), likely influenced by motion artifacts or electrode–skin impedance variation.  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; shows relatively higher noise (RMS ≈ 0.0126), suggesting increased baseline fluctuation.  &lt;br /&gt;
&lt;br /&gt;
Overall, the system maintains a low noise floor across subjects, although the quality depends on experimental conditions such as electrode contact and environmental interference.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Signal-to-Noise Ratio (SNR) ====&lt;br /&gt;
&lt;br /&gt;
The signal-to-noise ratio (SNR) is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{SNR (dB)} = 20 \log_{10} \left( \frac{\mathrm{RMS}_{\mathrm{contraction}}}{\mathrm{RMS}_{\mathrm{rest}}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The measured SNR values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 21.26 dB → good signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 13.52 dB → moderate and usable  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 6.66 dB → low signal clarity  &lt;br /&gt;
&lt;br /&gt;
General interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;20 dB → good  &lt;br /&gt;
* 10–20 dB → usable  &lt;br /&gt;
* &amp;lt;10 dB → poor  &lt;br /&gt;
&lt;br /&gt;
These results show that the system can achieve reliable signal acquisition, although performance varies across subjects.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====  Rest vs Contraction Discrimination ====&lt;br /&gt;
&lt;br /&gt;
A clear distinction between rest and contraction states is observed based on RMS values.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: 0.0053 → 0.1064 (≈20× increase)  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: 0.0079 → 0.0283 (≈3.6× increase)  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: 0.0141 → 0.0646 (≈4.6× increase)  &lt;br /&gt;
&lt;br /&gt;
This demonstrates that the system is capable of separating muscle activity from baseline noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Conclusion:&#039;&#039;  &lt;br /&gt;
The system can be used for basic muscle activity detection and simple classification tasks based on RMS features.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Repeatability of Repeated Contractions ====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV) of peak RMS values across repetitions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! CV Range !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 10% || Excellent&lt;br /&gt;
|-&lt;br /&gt;
| 10–20% || Acceptable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; 20% || Poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Results:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039;: CV = 12.77% → Acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039;: CV = 24.77% → Poor  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039;: CV = 10.60% → Acceptable  &lt;br /&gt;
&lt;br /&gt;
Although WANG&#039;s signal is detectable, its contraction amplitude varies significantly across repetitions, resulting in poor repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Overall System Performance ===&lt;br /&gt;
&lt;br /&gt;
The system demonstrates the following performance characteristics:&lt;br /&gt;
&lt;br /&gt;
* Reliable detection of muscle activity across all subjects  &lt;br /&gt;
* Clear separation between rest and contraction states  &lt;br /&gt;
* Moderate to high signal quality depending on subject conditions  &lt;br /&gt;
* Repeatability ranging from acceptable to poor due to user-dependent factors  &lt;br /&gt;
&lt;br /&gt;
Overall, the designed EMG acquisition system is capable of stable signal acquisition and feature extraction, with performance primarily influenced by electrode contact quality, skin impedance, and motion consistency.&lt;br /&gt;
&lt;br /&gt;
===== Summary of Quantitative Metrics =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Subject !! RMS (Rest) !! RMS (Contraction) !! Separation Ratio !! iEMG (max) !! Noise RMS !! SNR (dB) !! CV (%) !! Evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LIU&#039;&#039;&#039; || 0.0053 || 0.1064 || &#039;&#039;&#039;20.1×&#039;&#039;&#039; || 12.72 || 0.0046 || &#039;&#039;&#039;21.26&#039;&#039;&#039; || 12.77 || Strong signal, good quality&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WANG&#039;&#039;&#039; || 0.0079 || 0.0283 || 3.57× || 11.10 || 0.0080 || 13.52 || &#039;&#039;&#039;24.77&#039;&#039;&#039; || Usable signal, poor repeatability&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ZHONG&#039;&#039;&#039; || 0.0141 || 0.0646 || 4.58× || 6.70 || 0.0126 || 6.66 || 10.60 || Acceptable performance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Summary:&#039;&#039; Subject LIU shows the best overall performance, WANG provides usable but less stable signals, and ZHONG demonstrates moderate signal quality with good repeatability.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Activation Intensity =====&lt;br /&gt;
&lt;br /&gt;
Among the three subjects, &#039;&#039;&#039;LIU exhibits the strongest muscle activation&#039;&#039;&#039;, as indicated by the highest contraction RMS and iEMG values. ZHONG shows moderate activation, while WANG demonstrates comparable iEMG but lower RMS consistency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Signal Quality =====&lt;br /&gt;
&lt;br /&gt;
Signal quality is evaluated based on SNR and noise level:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;LIU&#039;&#039;&#039; achieves the highest SNR and lowest noise → best signal quality  &lt;br /&gt;
* &#039;&#039;&#039;WANG&#039;&#039;&#039; shows moderate SNR → usable but less robust  &lt;br /&gt;
* &#039;&#039;&#039;ZHONG&#039;&#039;&#039; has the lowest SNR → weakest signal clarity  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Comparison of Repeatability =====&lt;br /&gt;
&lt;br /&gt;
Repeatability is evaluated using the coefficient of variation (CV):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ZHONG (10.60%)&#039;&#039;&#039; → most stable  &lt;br /&gt;
* &#039;&#039;&#039;LIU (12.77%)&#039;&#039;&#039; → acceptable  &lt;br /&gt;
* &#039;&#039;&#039;WANG (24.77%)&#039;&#039;&#039; → poor  &lt;br /&gt;
&lt;br /&gt;
This indicates that WANG’s contraction strength varies significantly between repetitions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===== Engineering Interpretation of Inter-subject Differences =====&lt;br /&gt;
&lt;br /&gt;
The observed differences are mainly attributed to engineering and experimental factors rather than physiological differences.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Electrode contact quality&#039;&#039;&#039;  &lt;br /&gt;
  Variations in electrode placement, pressure, and gel contact affect signal amplitude and stability.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skin impedance&#039;&#039;&#039;  &lt;br /&gt;
  Differences in skin condition (hydration, oil, hair) influence electrode–skin impedance, affecting noise level and signal coupling.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Muscle control consistency&#039;&#039;&#039;  &lt;br /&gt;
  Variations in contraction strength and timing affect repeatability and CV.&lt;br /&gt;
&lt;br /&gt;
Therefore, the variation across subjects reflects practical acquisition conditions rather than intrinsic system limitations.&lt;/div&gt;</summary>
		<author><name>Baoqi</name></author>
	</entry>
</feed>