<?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=Chenxi</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=Chenxi"/>
	<link rel="alternate" type="text/html" href="https://pc5271.org/index.php/Special:Contributions/Chenxi"/>
	<updated>2026-04-15T20:46:41Z</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=516</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=516"/>
		<updated>2026-04-06T02:20:30Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Signal-to-Noise Ratio (SNR) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&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>Chenxi</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=515</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=515"/>
		<updated>2026-04-06T02:12:03Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Signal Conditioning and Filtering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&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;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;
&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>Chenxi</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=514</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=514"/>
		<updated>2026-04-06T02:11:22Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Signal Conditioning and Filtering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&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;
== Signal Conditioning and Filtering ==&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are highly susceptible to various sources of contamination during acquisition. In practical measurements, dominant disturbances include:&lt;br /&gt;
&lt;br /&gt;
* Low-frequency motion artifacts caused by electrode movement and electrode–skin impedance variation  &lt;br /&gt;
* Narrow-band power-line interference centered at 50 Hz  &lt;br /&gt;
* Broadband high-frequency electronic noise introduced by acquisition hardware  &lt;br /&gt;
&lt;br /&gt;
These unwanted components degrade signal quality and affect the reliability of feature extraction and muscle activity interpretation. Therefore, effective signal conditioning is essential before higher-level analysis.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
=== Signal Processing Pipeline ===&lt;br /&gt;
&lt;br /&gt;
The filtering strategy follows a two-stage principle:&lt;br /&gt;
&lt;br /&gt;
# Restrict the signal bandwidth to the physiological range  &lt;br /&gt;
# Remove residual narrow-band interference  &lt;br /&gt;
&lt;br /&gt;
The processing flow is illustrated below:&lt;br /&gt;
&lt;br /&gt;
[[File:EMG_filter_pipeline.png|center|600px|Flowchart of the real-time sEMG signal conditioning pipeline]]&lt;br /&gt;
&lt;br /&gt;
The raw EMG signal undergoes the following steps:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Band-pass filtering&#039;&#039;&#039; – suppress motion artifacts and high-frequency noise  &lt;br /&gt;
* &#039;&#039;&#039;Notch filtering (50 Hz)&#039;&#039;&#039; – remove power-line interference  &lt;br /&gt;
* &#039;&#039;&#039;Full-wave rectification&#039;&#039;&#039; – convert bipolar signal to unipolar  &lt;br /&gt;
* &#039;&#039;&#039;Envelope extraction&#039;&#039;&#039; – obtain smooth muscle activation level  &lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
=== Band-Pass Filtering ===&lt;br /&gt;
&lt;br /&gt;
The band-pass stage confines the signal to the main spectral region of interest for sEMG.  &lt;br /&gt;
&lt;br /&gt;
The transfer function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;H_{BP}(z) = \frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The passband is selected as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;20 \leq f \leq 160 \text{ Hz}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This range is consistent with the dominant spectral content of surface EMG signals:&lt;br /&gt;
&lt;br /&gt;
* Lower cutoff (~20 Hz): removes motion artifacts and baseline drift  &lt;br /&gt;
* Upper cutoff (~160 Hz): suppresses high-frequency electronic noise  &lt;br /&gt;
&lt;br /&gt;
A fourth-order Butterworth filter is used due to its:&lt;br /&gt;
&lt;br /&gt;
* Smooth monotonic response  &lt;br /&gt;
* Minimal waveform distortion  &lt;br /&gt;
* Suitability for real-time implementation  &lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
=== Notch Filtering (50 Hz) ===&lt;br /&gt;
&lt;br /&gt;
After band limitation, a notch filter is applied to suppress residual power-line interference at 50 Hz.&lt;br /&gt;
&lt;br /&gt;
The notch frequency is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;f_0 = 50 \text{ Hz}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The quality factor is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A high-Q design is used to:&lt;br /&gt;
&lt;br /&gt;
* Ensure narrow-band rejection  &lt;br /&gt;
* Minimize distortion of nearby useful signal components  &lt;br /&gt;
&lt;br /&gt;
This step is critical since power-line interference lies within the EMG frequency band.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
=== Full-Wave Rectification ===&lt;br /&gt;
&lt;br /&gt;
After filtering, the EMG signal is converted to a unipolar representation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;y_{rect}(n) = |x(n)|&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This operation:&lt;br /&gt;
&lt;br /&gt;
* Preserves signal amplitude information  &lt;br /&gt;
* Makes the signal suitable for amplitude-based analysis  &lt;br /&gt;
* Ensures both positive and negative deflections contribute to activation  &lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
=== Envelope Extraction ===&lt;br /&gt;
&lt;br /&gt;
The signal envelope provides a smooth estimate of muscle activation intensity over time.&lt;br /&gt;
&lt;br /&gt;
It is obtained by low-pass filtering or moving-average smoothing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
y_{env}[n] = \frac{1}{N} \sum_{k=0}^{N-1} |x[n-k]|&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the window length  &lt;br /&gt;
* A window duration of ~200 ms is used  &lt;br /&gt;
&lt;br /&gt;
This produces a stable and physiologically meaningful representation for:&lt;br /&gt;
&lt;br /&gt;
* Muscle activation analysis  &lt;br /&gt;
* Force estimation  &lt;br /&gt;
* Fatigue studies  &lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
=== Real-Time Implementation ===&lt;br /&gt;
&lt;br /&gt;
The entire filtering pipeline is implemented in real time using IIR filters.&lt;br /&gt;
&lt;br /&gt;
The recursive form is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Key characteristics:&lt;br /&gt;
&lt;br /&gt;
* Sample-by-sample processing  &lt;br /&gt;
* Low computational cost  &lt;br /&gt;
* Low latency  &lt;br /&gt;
* Suitable for embedded systems  &lt;br /&gt;
&lt;br /&gt;
Internal filter states are preserved between samples to ensure continuity and avoid artificial transients.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
The proposed signal conditioning pipeline:&lt;br /&gt;
&lt;br /&gt;
* Removes motion artifacts, power-line interference, and electronic noise  &lt;br /&gt;
* Preses the physiological content of EMG signals  &lt;br /&gt;
* Produces a smooth envelope for feature extraction  &lt;br /&gt;
* Enables real-time processing for biomedical applications  &lt;br /&gt;
&lt;br /&gt;
This design provides a good balance between signal fidelity, computational efficiency, and practical implementation requirements.&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;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;
&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>Chenxi</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=513</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=513"/>
		<updated>2026-04-06T02:03:52Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Data processing and analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&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;
==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;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;
&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>Chenxi</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=512</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=512"/>
		<updated>2026-04-06T02:03:23Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Multi-subject Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&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;
==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;
== 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;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;
&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>Chenxi</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=511</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=511"/>
		<updated>2026-04-06T02:02:49Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* System Evaluation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&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;
==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;
== 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;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;
&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>Chenxi</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=510</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=510"/>
		<updated>2026-04-06T01:58:21Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* 1.2 Signal-to-Noise Ratio (SNR) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&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;
==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;
=== 1.1 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;
=== 1.2 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;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;
&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;
=== 1.3 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;
=== 1.4 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;
=== 1.5 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;
==== 2.1 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;
==== 2.2 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;
==== 2.3 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;
==== 2.4 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;
==== 2.5 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>Chenxi</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=509</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=509"/>
		<updated>2026-04-06T01:54:49Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Multi-subject Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&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;
==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;
=== 1.1 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;
=== 1.2 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;
SNR (dB) = 20 log10 (RMS_contraction / RMS_rest)&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;
=== 1.3 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;
=== 1.4 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;
=== 1.5 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;
==== 2.1 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;
==== 2.2 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;
==== 2.3 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;
==== 2.4 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;
==== 2.5 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>Chenxi</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=508</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=508"/>
		<updated>2026-04-06T01:52:59Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Multi-subject Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&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;
==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;
==== 3.1 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;
==== 3.2 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;
==== 3.3 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;
==== 3.4 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;
==== 3.5 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>Chenxi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Main_Page&amp;diff=282</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Main_Page&amp;diff=282"/>
		<updated>2026-03-06T05:11:54Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome to the wiki page for the course PC5271: Physics of Sensors &amp;quot;(in AY25/26 Sem 2)!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is the repository where projects are documented. You will need to create an account for editing/creating pages. If you need an account, please contact Christian.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logistics&#039;&#039;&#039;:&lt;br /&gt;
Our &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;location is S11-02-04&amp;lt;/span&amp;gt;&#039;&#039;&#039;, time slots for &amp;quot;classes&amp;quot; are &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;Tue and Fri 10:00am-12:00noon&amp;lt;/span&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Projects==&lt;br /&gt;
&lt;br /&gt;
===[[Fluorescence Sensor for Carbon Quantum Dots: Synthesis, Characterization, and Quality Control]]===&lt;br /&gt;
&lt;br /&gt;
Group menber: Zhang yiteng, Li Xiaoyue, Peng Jianxi&lt;br /&gt;
&lt;br /&gt;
This project aims to develop a low-cost, repeatable optical sensing system to quantify the quality of Carbon Quantum Dots (CQDs). We synthesize CQDs using a microwave-assisted method with citric acid and urea, and characterize their fluorescence properties using a custom-built setup comprising a UV LED excitation source and a fiber-optic spectrometer. By analyzing spectral metrics such as peak wavelength, intensity, and FWHM, we establish a robust quality control protocol for nanomaterial production.&lt;br /&gt;
&lt;br /&gt;
===[[Inductive Sensors of Ultra-high Sensitivity Based on Nonlinear Exceptional Point]]===&lt;br /&gt;
Team members: Yuan Siyu; Zhu Ziyang; Wang Peikun; Li Xunyu&lt;br /&gt;
&lt;br /&gt;
We are building two coupled oscillating circuits: one that naturally loses energy (lossy) and one that gains energy (active) using a specific amplifier that saturates at high amplitudes. When tuning these two circuits to a nonlinear Exceptional Point (NEP), the system becomes extremely sensitive to small perturbations in inductance, following a steep cubic-root response curve, while remaining resistant to noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CK:&#039;&#039;&#039; We likely have all the parts for this, but let us know the frequency so we can find the proper amplifier and circuit board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SY:&#039;&#039;&#039; Thanks for your confirmation. The operating frequency is around 70-80 kHz.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CK:&#039;&#039;&#039; Have!&lt;br /&gt;
&lt;br /&gt;
===[[EA Spectroscopy as a series of sensors: Investigating the Impact of Film-Processing Temperature on Mobility in Organic Diodes]]===&lt;br /&gt;
Team members: Li Jinhan; Liu Chenyang&lt;br /&gt;
&lt;br /&gt;
We will use EA spectroscopy, which will include optical sensors, electrical sensors, and lock-in amplifiers, among other components as a highly sensitive, non-destructive optical sensing platform to measure the internal electric field modulation response of organic diodes under operating conditions, and to quantitatively extract carrier mobility based on this measurement. By systematically controlling the thin film preparation temperature and comparing the EA response characteristics of different samples, the project aims to reveal the influence of film preparation temperature on device mobility and its potential physical origins.&lt;br /&gt;
&lt;br /&gt;
===[[Optical Sensor of Magnetic Dynamics: A Balanced-Detection MOKE Magnetometer]]===&lt;br /&gt;
Team members: LI Junxiang; Patricia Breanne Tan Sy&lt;br /&gt;
&lt;br /&gt;
We will use a laser-based magneto-optical Kerr effect setup featuring a high-sensitivity differential photodiode array to measure the Kerr rotation angle induced by surface magnetism. This system serves as a versatile optical platform to investigate how external perturbations such as magnetic fields or radiation source alter the magnetic ordering of materials, allowing for the quantitative extraction of the magneto-optical coupling coefficients of various thin films.&lt;br /&gt;
&lt;br /&gt;
===[[Precision Measurement of Material and Optical Properties Using Interferometry]]===&lt;br /&gt;
Team members: Yang SangUk; Zhang ShunYang; Xu Zifang&lt;br /&gt;
&lt;br /&gt;
We will be constructing an interferometer and use it as a tool for precision measurement. One primary objective is determination of the refractive index of various gases by analyzing the resulting shift interference fringes.&lt;br /&gt;
===[[Precision Thermocouple Based Temperature Measurement System]]===&lt;br /&gt;
Team members: Sree Ranjani Krishnan; Nisha Ganesh ; Burra Srikari&lt;br /&gt;
&lt;br /&gt;
We will design, build, and validate a precision thermocouple-based temperature measurement system using the Seebeck effect. The system will convert the extremely small thermoelectric voltage generated by a thermocouple into accurate, real-time temperature data. Since the output voltage is really small we will be using an instrumentation amplifier to amplify the output voltage and use an Arduino to digitalize the results.&lt;br /&gt;
Materials needed: K-type thermocouple/Thermophile;Arduino&lt;br /&gt;
&lt;br /&gt;
===[[Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing]]===&lt;br /&gt;
Team members: Liu Chenxi; Wang Jingyi; Zhong Baoqi; Hong Jialuo; Zhang Lishang;&lt;br /&gt;
&lt;br /&gt;
Electromyography (EMG) measures the electrical activity generated by skeletal muscles and is widely used in biomedical sensing, rehabilitation, and human–machine interfaces. The electrical signals produced by muscle fibers are typically in the microvolt to millivolt range and are easily corrupted by noise and motion artifacts, making proper signal conditioning essential. In this project, we design and implement an analog front-end (AFE) for surface EMG acquisition, including an instrumentation amplifier, band-pass filtering, and a 50 Hz notch filter to suppress power-line interference. The conditioned signal is then observed and recorded using an oscilloscope for further analysis of muscle activity in both the time and frequency domains.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
===Books and links===&lt;br /&gt;
* A good textbook on the Physics of Sensors is Jacob Fraden: Handbook of Mondern Sensors, Springer, ISBN 978-3-319-19302-1 or [https://link.springer.com/book/10.1007/978-3-319-19303-8 doi:10.1007/978-3-319-19303-8]. There shoud be an e-book available through the NUS library at https://linc.nus.edu.sg/record=b3554643&lt;br /&gt;
* Another good textbook: John B.Bentley: Principles of Measurement Systems, 4th Edition, Pearson, ISBN: 0-13-043028-5 or https://linc.nus.edu.sg/record=b2458243 in our library.&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* Various Python extensions. [https://www.python.org Python] is a very powerful free programming language that runs on just about any computer platform. It is open source and completely free.&lt;br /&gt;
* [https://www.gnuplot.info Gnuplot]: A free and very mature data display tool that works on just about any platform used that produces excellent publication-grade eps and pdf figures. Can be also used in scripts. Open source and completely free.&lt;br /&gt;
* Matlab: Very common, good toolset also for formal mathematics, good graphics. Expensive. We may have a site license, but I am not sure how painful it is for us to get a license for this course. Ask if interested.&lt;br /&gt;
* Mathematica: More common among theroetical physicists, very good in formal maths, now with better numerics. Graphs are ok but can be a pain to make looking good. As with Matlab, we do have a campus license. Ask if interested.&lt;br /&gt;
&lt;br /&gt;
===Apps===&lt;br /&gt;
Common mobile phones these days are equipped with an amazing toolchest of sensors. There are a few apps that allow you to access them directly, and turn your phone into a powerful sensor. Here some suggestions:&lt;br /&gt;
&lt;br /&gt;
* Physics Toolbox sensor suite on [https://play.google.com/store/apps/details?id=com.chrystianvieyra.physicstoolboxsuite&amp;amp;hl=en_SG Google play store] or [https://apps.apple.com/us/app/physics-toolbox-sensor-suite/id1128914250 Apple App store].&lt;br /&gt;
&lt;br /&gt;
===Data sheets===&lt;br /&gt;
A number of components might be useful for several groups. Some common data sheets are here:&lt;br /&gt;
* Photodiodes:&lt;br /&gt;
** Generic Silicon pin Photodiode type [[Media:Bpw34.pdf|BPW34]]&lt;br /&gt;
** Fast photodiodes (Silicon PIN, small area): [[Media:S5971_etc_kpin1025e.pdf|S5971/S5972/S5973]]&lt;br /&gt;
* Photogates:&lt;br /&gt;
** (to come)&lt;br /&gt;
* PT 100 Temperature sensors based on platinum wire: [[Media:PT100_TABLA_R_T.pdf|Calibration table]]&lt;br /&gt;
* Thermistor type [[Media:Thermistor B57861S.pdf|B57861S]] (R0=10k&amp;amp;Omega;, B=3988Kelvin). Search for   [https://en.wikipedia.org/wiki/Steinhart-Hart_equation Steinhart-Hart equation]. See [[Thermistor]] page here as well.&lt;br /&gt;
* Humidity sensor&lt;br /&gt;
** Sensirion device the reference unit: [[media:Sensirion SHT30-DIS.pdf|SHT30/31]]&lt;br /&gt;
* Thermopile detectors:&lt;br /&gt;
** [[Media:Thermopile_G-TPCO-035 TS418-1N426.pdf|G-TPCO-035 / TS418-1N426]]: Thermopile detector with a built-in optical bandpass filter for light around 4&amp;amp;mu;m wavelength for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; absorption&lt;br /&gt;
** [[Media:Thermopile_TS305_TCPO-033.pdf|TPCO-033 / TS305]]: Thermopile detector with wideband sensitivity 5um-25um&lt;br /&gt;
** [[Media:Thermopile_G-TPCO-019_TS105-10L5.5MM.pdf|G-TPCO-019 /TS105-10L5.5MM]]: Thermopile detector with wideband sensitivity 5um-25um and silicon lens (field of view: 10 degree)&lt;br /&gt;
* Resistor color codes are explained [https://en.wikipedia.org/wiki/Electronic_color_code here]&lt;br /&gt;
&amp;lt;!-- * Ultrasonic detectors:&lt;br /&gt;
** plastic detctor, 40 kHz, -74dB: [[Media:MCUSD16P40B12RO.pdf|MCUSD16P40B12RO]]&lt;br /&gt;
** metal casing/waterproof, 48 kHz, -90dB, [[Media:MCUSD14A48S09RS-30C.pdf|MCUSD14A48S09RS-30C]]&lt;br /&gt;
** metal casing, 40 kHz, sensitivity unknown, [[Media:MCUST16A40S12RO.pdf|MCUST16A40S12RO]]&lt;br /&gt;
** metal casing/waterproof, 300kHz, may need high voltage: [[Media:MCUSD13A300B09RS.pdf|MCUSD13A300B09RS]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* Magnetic field sensors:&lt;br /&gt;
** Fluxgate magnetometer [[media:Data-sheet FLC-100.pdf|FCL100]]&lt;br /&gt;
** Hall switch 1 (SOT-23 casing): [[media:INFineon_TLE49681KXTSA1.pdf|TLE49681]]&lt;br /&gt;
** Hall switch 2 (TO-92 casing): [[media:DiodesInc_AH9246-P-8.pdf|AH9246]]&lt;br /&gt;
** Linear Hall sensor (to come)&lt;br /&gt;
* Lasers&lt;br /&gt;
** Red laser diode [[media:HL6501MG.pdf|HL6501MG]]&lt;br /&gt;
* Generic amplifiers&lt;br /&gt;
** Instrumentation amplifiers: [[media:Ad8221.pdf|AD8221]] or [[media:AD8226.pdf|AD8226]]&lt;br /&gt;
** Conventional operational amplifiers: Precision: [[media:OP27.pdf | OP27]], General purpose: [[media:OP07.pdf | OP07]]&lt;br /&gt;
** JFET op-amp, reasonably fast: [https://www.ti.com/document-viewer/tl071/datasheet TL071]&lt;br /&gt;
** Transimpedance amplifiers for photodetectors: [[media:AD8015.pdf | AD8015]]&lt;br /&gt;
&lt;br /&gt;
==Some wiki reference materials==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [[Writing mathematical expressions]]&lt;br /&gt;
* [[Uploading images and files]]&lt;br /&gt;
&lt;br /&gt;
==Old wikis==&lt;br /&gt;
You can find entries to the wiki from [https://pc5271.org/PC5271_AY2425S2 AY2024/25 Sem 2] and [https://pc5271.org/PC5271_AY2324S2 AY2023/24 Sem 2].&lt;/div&gt;</summary>
		<author><name>Chenxi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Main_Page&amp;diff=281</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Main_Page&amp;diff=281"/>
		<updated>2026-03-06T05:11:21Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome to the wiki page for the course PC5271: Physics of Sensors &amp;quot;(in AY25/26 Sem 2)!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is the repository where projects are documented. You will need to create an account for editing/creating pages. If you need an account, please contact Christian.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logistics&#039;&#039;&#039;:&lt;br /&gt;
Our &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;location is S11-02-04&amp;lt;/span&amp;gt;&#039;&#039;&#039;, time slots for &amp;quot;classes&amp;quot; are &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;Tue and Fri 10:00am-12:00noon&amp;lt;/span&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Projects==&lt;br /&gt;
&lt;br /&gt;
===[[Fluorescence Sensor for Carbon Quantum Dots: Synthesis, Characterization, and Quality Control]]===&lt;br /&gt;
&lt;br /&gt;
Group menber: Zhang yiteng, Li Xiaoyue, Peng Jianxi&lt;br /&gt;
&lt;br /&gt;
This project aims to develop a low-cost, repeatable optical sensing system to quantify the quality of Carbon Quantum Dots (CQDs). We synthesize CQDs using a microwave-assisted method with citric acid and urea, and characterize their fluorescence properties using a custom-built setup comprising a UV LED excitation source and a fiber-optic spectrometer. By analyzing spectral metrics such as peak wavelength, intensity, and FWHM, we establish a robust quality control protocol for nanomaterial production.&lt;br /&gt;
&lt;br /&gt;
===[[Inductive Sensors of Ultra-high Sensitivity Based on Nonlinear Exceptional Point]]===&lt;br /&gt;
Team members: Yuan Siyu; Zhu Ziyang; Wang Peikun; Li Xunyu&lt;br /&gt;
&lt;br /&gt;
We are building two coupled oscillating circuits: one that naturally loses energy (lossy) and one that gains energy (active) using a specific amplifier that saturates at high amplitudes. When tuning these two circuits to a nonlinear Exceptional Point (NEP), the system becomes extremely sensitive to small perturbations in inductance, following a steep cubic-root response curve, while remaining resistant to noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CK:&#039;&#039;&#039; We likely have all the parts for this, but let us know the frequency so we can find the proper amplifier and circuit board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SY:&#039;&#039;&#039; Thanks for your confirmation. The operating frequency is around 70-80 kHz.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CK:&#039;&#039;&#039; Have!&lt;br /&gt;
&lt;br /&gt;
===[[EA Spectroscopy as a series of sensors: Investigating the Impact of Film-Processing Temperature on Mobility in Organic Diodes]]===&lt;br /&gt;
Team members: Li Jinhan; Liu Chenyang&lt;br /&gt;
&lt;br /&gt;
We will use EA spectroscopy, which will include optical sensors, electrical sensors, and lock-in amplifiers, among other components as a highly sensitive, non-destructive optical sensing platform to measure the internal electric field modulation response of organic diodes under operating conditions, and to quantitatively extract carrier mobility based on this measurement. By systematically controlling the thin film preparation temperature and comparing the EA response characteristics of different samples, the project aims to reveal the influence of film preparation temperature on device mobility and its potential physical origins.&lt;br /&gt;
&lt;br /&gt;
===[[Optical Sensor of Magnetic Dynamics: A Balanced-Detection MOKE Magnetometer]]===&lt;br /&gt;
Team members: LI Junxiang; Patricia Breanne Tan Sy&lt;br /&gt;
&lt;br /&gt;
We will use a laser-based magneto-optical Kerr effect setup featuring a high-sensitivity differential photodiode array to measure the Kerr rotation angle induced by surface magnetism. This system serves as a versatile optical platform to investigate how external perturbations such as magnetic fields or radiation source alter the magnetic ordering of materials, allowing for the quantitative extraction of the magneto-optical coupling coefficients of various thin films.&lt;br /&gt;
&lt;br /&gt;
===[[Precision Measurement of Material and Optical Properties Using Interferometry]]===&lt;br /&gt;
Team members: Yang SangUk; Zhang ShunYang; Xu Zifang&lt;br /&gt;
&lt;br /&gt;
We will be constructing an interferometer and use it as a tool for precision measurement. One primary objective is determination of the refractive index of various gases by analyzing the resulting shift interference fringes.&lt;br /&gt;
===[[Precision Thermocouple Based Temperature Measurement System]]===&lt;br /&gt;
Team members: Sree Ranjani Krishnan; Nisha Ganesh ; Burra Srikari&lt;br /&gt;
&lt;br /&gt;
We will design, build, and validate a precision thermocouple-based temperature measurement system using the Seebeck effect. The system will convert the extremely small thermoelectric voltage generated by a thermocouple into accurate, real-time temperature data. Since the output voltage is really small we will be using an instrumentation amplifier to amplify the output voltage and use an Arduino to digitalize the results.&lt;br /&gt;
Materials needed: K-type thermocouple/Thermophile;Arduino&lt;br /&gt;
&lt;br /&gt;
===[[Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing]]===&lt;br /&gt;
Team members: Liu Chenxi; Wang Jingyi; Zhong Baoqi; Hong Jialuo; Zhang Lishang;&lt;br /&gt;
Electromyography (EMG) measures the electrical activity generated by skeletal muscles and is widely used in biomedical sensing, rehabilitation, and human–machine interfaces. The electrical signals produced by muscle fibers are typically in the microvolt to millivolt range and are easily corrupted by noise and motion artifacts, making proper signal conditioning essential. In this project, we design and implement an analog front-end (AFE) for surface EMG acquisition, including an instrumentation amplifier, band-pass filtering, and a 50 Hz notch filter to suppress power-line interference. The conditioned signal is then observed and recorded using an oscilloscope for further analysis of muscle activity in both the time and frequency domains.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
===Books and links===&lt;br /&gt;
* A good textbook on the Physics of Sensors is Jacob Fraden: Handbook of Mondern Sensors, Springer, ISBN 978-3-319-19302-1 or [https://link.springer.com/book/10.1007/978-3-319-19303-8 doi:10.1007/978-3-319-19303-8]. There shoud be an e-book available through the NUS library at https://linc.nus.edu.sg/record=b3554643&lt;br /&gt;
* Another good textbook: John B.Bentley: Principles of Measurement Systems, 4th Edition, Pearson, ISBN: 0-13-043028-5 or https://linc.nus.edu.sg/record=b2458243 in our library.&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* Various Python extensions. [https://www.python.org Python] is a very powerful free programming language that runs on just about any computer platform. It is open source and completely free.&lt;br /&gt;
* [https://www.gnuplot.info Gnuplot]: A free and very mature data display tool that works on just about any platform used that produces excellent publication-grade eps and pdf figures. Can be also used in scripts. Open source and completely free.&lt;br /&gt;
* Matlab: Very common, good toolset also for formal mathematics, good graphics. Expensive. We may have a site license, but I am not sure how painful it is for us to get a license for this course. Ask if interested.&lt;br /&gt;
* Mathematica: More common among theroetical physicists, very good in formal maths, now with better numerics. Graphs are ok but can be a pain to make looking good. As with Matlab, we do have a campus license. Ask if interested.&lt;br /&gt;
&lt;br /&gt;
===Apps===&lt;br /&gt;
Common mobile phones these days are equipped with an amazing toolchest of sensors. There are a few apps that allow you to access them directly, and turn your phone into a powerful sensor. Here some suggestions:&lt;br /&gt;
&lt;br /&gt;
* Physics Toolbox sensor suite on [https://play.google.com/store/apps/details?id=com.chrystianvieyra.physicstoolboxsuite&amp;amp;hl=en_SG Google play store] or [https://apps.apple.com/us/app/physics-toolbox-sensor-suite/id1128914250 Apple App store].&lt;br /&gt;
&lt;br /&gt;
===Data sheets===&lt;br /&gt;
A number of components might be useful for several groups. Some common data sheets are here:&lt;br /&gt;
* Photodiodes:&lt;br /&gt;
** Generic Silicon pin Photodiode type [[Media:Bpw34.pdf|BPW34]]&lt;br /&gt;
** Fast photodiodes (Silicon PIN, small area): [[Media:S5971_etc_kpin1025e.pdf|S5971/S5972/S5973]]&lt;br /&gt;
* Photogates:&lt;br /&gt;
** (to come)&lt;br /&gt;
* PT 100 Temperature sensors based on platinum wire: [[Media:PT100_TABLA_R_T.pdf|Calibration table]]&lt;br /&gt;
* Thermistor type [[Media:Thermistor B57861S.pdf|B57861S]] (R0=10k&amp;amp;Omega;, B=3988Kelvin). Search for   [https://en.wikipedia.org/wiki/Steinhart-Hart_equation Steinhart-Hart equation]. See [[Thermistor]] page here as well.&lt;br /&gt;
* Humidity sensor&lt;br /&gt;
** Sensirion device the reference unit: [[media:Sensirion SHT30-DIS.pdf|SHT30/31]]&lt;br /&gt;
* Thermopile detectors:&lt;br /&gt;
** [[Media:Thermopile_G-TPCO-035 TS418-1N426.pdf|G-TPCO-035 / TS418-1N426]]: Thermopile detector with a built-in optical bandpass filter for light around 4&amp;amp;mu;m wavelength for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; absorption&lt;br /&gt;
** [[Media:Thermopile_TS305_TCPO-033.pdf|TPCO-033 / TS305]]: Thermopile detector with wideband sensitivity 5um-25um&lt;br /&gt;
** [[Media:Thermopile_G-TPCO-019_TS105-10L5.5MM.pdf|G-TPCO-019 /TS105-10L5.5MM]]: Thermopile detector with wideband sensitivity 5um-25um and silicon lens (field of view: 10 degree)&lt;br /&gt;
* Resistor color codes are explained [https://en.wikipedia.org/wiki/Electronic_color_code here]&lt;br /&gt;
&amp;lt;!-- * Ultrasonic detectors:&lt;br /&gt;
** plastic detctor, 40 kHz, -74dB: [[Media:MCUSD16P40B12RO.pdf|MCUSD16P40B12RO]]&lt;br /&gt;
** metal casing/waterproof, 48 kHz, -90dB, [[Media:MCUSD14A48S09RS-30C.pdf|MCUSD14A48S09RS-30C]]&lt;br /&gt;
** metal casing, 40 kHz, sensitivity unknown, [[Media:MCUST16A40S12RO.pdf|MCUST16A40S12RO]]&lt;br /&gt;
** metal casing/waterproof, 300kHz, may need high voltage: [[Media:MCUSD13A300B09RS.pdf|MCUSD13A300B09RS]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* Magnetic field sensors:&lt;br /&gt;
** Fluxgate magnetometer [[media:Data-sheet FLC-100.pdf|FCL100]]&lt;br /&gt;
** Hall switch 1 (SOT-23 casing): [[media:INFineon_TLE49681KXTSA1.pdf|TLE49681]]&lt;br /&gt;
** Hall switch 2 (TO-92 casing): [[media:DiodesInc_AH9246-P-8.pdf|AH9246]]&lt;br /&gt;
** Linear Hall sensor (to come)&lt;br /&gt;
* Lasers&lt;br /&gt;
** Red laser diode [[media:HL6501MG.pdf|HL6501MG]]&lt;br /&gt;
* Generic amplifiers&lt;br /&gt;
** Instrumentation amplifiers: [[media:Ad8221.pdf|AD8221]] or [[media:AD8226.pdf|AD8226]]&lt;br /&gt;
** Conventional operational amplifiers: Precision: [[media:OP27.pdf | OP27]], General purpose: [[media:OP07.pdf | OP07]]&lt;br /&gt;
** JFET op-amp, reasonably fast: [https://www.ti.com/document-viewer/tl071/datasheet TL071]&lt;br /&gt;
** Transimpedance amplifiers for photodetectors: [[media:AD8015.pdf | AD8015]]&lt;br /&gt;
&lt;br /&gt;
==Some wiki reference materials==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [[Writing mathematical expressions]]&lt;br /&gt;
* [[Uploading images and files]]&lt;br /&gt;
&lt;br /&gt;
==Old wikis==&lt;br /&gt;
You can find entries to the wiki from [https://pc5271.org/PC5271_AY2425S2 AY2024/25 Sem 2] and [https://pc5271.org/PC5271_AY2324S2 AY2023/24 Sem 2].&lt;/div&gt;</summary>
		<author><name>Chenxi</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Main_Page&amp;diff=280</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Main_Page&amp;diff=280"/>
		<updated>2026-03-06T05:11:02Z</updated>

		<summary type="html">&lt;p&gt;Chenxi: /* Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome to the wiki page for the course PC5271: Physics of Sensors &amp;quot;(in AY25/26 Sem 2)!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is the repository where projects are documented. You will need to create an account for editing/creating pages. If you need an account, please contact Christian.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logistics&#039;&#039;&#039;:&lt;br /&gt;
Our &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;location is S11-02-04&amp;lt;/span&amp;gt;&#039;&#039;&#039;, time slots for &amp;quot;classes&amp;quot; are &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;Tue and Fri 10:00am-12:00noon&amp;lt;/span&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Projects==&lt;br /&gt;
&lt;br /&gt;
===[[Fluorescence Sensor for Carbon Quantum Dots: Synthesis, Characterization, and Quality Control]]===&lt;br /&gt;
&lt;br /&gt;
Group menber: Zhang yiteng, Li Xiaoyue, Peng Jianxi&lt;br /&gt;
&lt;br /&gt;
This project aims to develop a low-cost, repeatable optical sensing system to quantify the quality of Carbon Quantum Dots (CQDs). We synthesize CQDs using a microwave-assisted method with citric acid and urea, and characterize their fluorescence properties using a custom-built setup comprising a UV LED excitation source and a fiber-optic spectrometer. By analyzing spectral metrics such as peak wavelength, intensity, and FWHM, we establish a robust quality control protocol for nanomaterial production.&lt;br /&gt;
&lt;br /&gt;
===[[Inductive Sensors of Ultra-high Sensitivity Based on Nonlinear Exceptional Point]]===&lt;br /&gt;
Team members: Yuan Siyu; Zhu Ziyang; Wang Peikun; Li Xunyu&lt;br /&gt;
&lt;br /&gt;
We are building two coupled oscillating circuits: one that naturally loses energy (lossy) and one that gains energy (active) using a specific amplifier that saturates at high amplitudes. When tuning these two circuits to a nonlinear Exceptional Point (NEP), the system becomes extremely sensitive to small perturbations in inductance, following a steep cubic-root response curve, while remaining resistant to noise.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CK:&#039;&#039;&#039; We likely have all the parts for this, but let us know the frequency so we can find the proper amplifier and circuit board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SY:&#039;&#039;&#039; Thanks for your confirmation. The operating frequency is around 70-80 kHz.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CK:&#039;&#039;&#039; Have!&lt;br /&gt;
&lt;br /&gt;
===[[EA Spectroscopy as a series of sensors: Investigating the Impact of Film-Processing Temperature on Mobility in Organic Diodes]]===&lt;br /&gt;
Team members: Li Jinhan; Liu Chenyang&lt;br /&gt;
&lt;br /&gt;
We will use EA spectroscopy, which will include optical sensors, electrical sensors, and lock-in amplifiers, among other components as a highly sensitive, non-destructive optical sensing platform to measure the internal electric field modulation response of organic diodes under operating conditions, and to quantitatively extract carrier mobility based on this measurement. By systematically controlling the thin film preparation temperature and comparing the EA response characteristics of different samples, the project aims to reveal the influence of film preparation temperature on device mobility and its potential physical origins.&lt;br /&gt;
&lt;br /&gt;
===[[Optical Sensor of Magnetic Dynamics: A Balanced-Detection MOKE Magnetometer]]===&lt;br /&gt;
Team members: LI Junxiang; Patricia Breanne Tan Sy&lt;br /&gt;
&lt;br /&gt;
We will use a laser-based magneto-optical Kerr effect setup featuring a high-sensitivity differential photodiode array to measure the Kerr rotation angle induced by surface magnetism. This system serves as a versatile optical platform to investigate how external perturbations such as magnetic fields or radiation source alter the magnetic ordering of materials, allowing for the quantitative extraction of the magneto-optical coupling coefficients of various thin films.&lt;br /&gt;
&lt;br /&gt;
===[[Precision Measurement of Material and Optical Properties Using Interferometry]]===&lt;br /&gt;
Team members: Yang SangUk; Zhang ShunYang; Xu Zifang&lt;br /&gt;
&lt;br /&gt;
We will be constructing an interferometer and use it as a tool for precision measurement. One primary objective is determination of the refractive index of various gases by analyzing the resulting shift interference fringes.&lt;br /&gt;
===[[Precision Thermocouple Based Temperature Measurement System]]===&lt;br /&gt;
Team members: Sree Ranjani Krishnan; Nisha Ganesh ; Burra Srikari&lt;br /&gt;
&lt;br /&gt;
We will design, build, and validate a precision thermocouple-based temperature measurement system using the Seebeck effect. The system will convert the extremely small thermoelectric voltage generated by a thermocouple into accurate, real-time temperature data. Since the output voltage is really small we will be using an instrumentation amplifier to amplify the output voltage and use an Arduino to digitalize the results.&lt;br /&gt;
Materials needed: K-type thermocouple/Thermophile;Arduino&lt;br /&gt;
&lt;br /&gt;
===[[Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing]]===&lt;br /&gt;
Team members: Liu Chenxi; Wang Jingyi; Zhong Baoqi; Hong Jialuo; Zhang Lishang&lt;br /&gt;
Electromyography (EMG) measures the electrical activity generated by skeletal muscles and is widely used in biomedical sensing, rehabilitation, and human–machine interfaces. The electrical signals produced by muscle fibers are typically in the microvolt to millivolt range and are easily corrupted by noise and motion artifacts, making proper signal conditioning essential. In this project, we design and implement an analog front-end (AFE) for surface EMG acquisition, including an instrumentation amplifier, band-pass filtering, and a 50 Hz notch filter to suppress power-line interference. The conditioned signal is then observed and recorded using an oscilloscope for further analysis of muscle activity in both the time and frequency domains.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
===Books and links===&lt;br /&gt;
* A good textbook on the Physics of Sensors is Jacob Fraden: Handbook of Mondern Sensors, Springer, ISBN 978-3-319-19302-1 or [https://link.springer.com/book/10.1007/978-3-319-19303-8 doi:10.1007/978-3-319-19303-8]. There shoud be an e-book available through the NUS library at https://linc.nus.edu.sg/record=b3554643&lt;br /&gt;
* Another good textbook: John B.Bentley: Principles of Measurement Systems, 4th Edition, Pearson, ISBN: 0-13-043028-5 or https://linc.nus.edu.sg/record=b2458243 in our library.&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* Various Python extensions. [https://www.python.org Python] is a very powerful free programming language that runs on just about any computer platform. It is open source and completely free.&lt;br /&gt;
* [https://www.gnuplot.info Gnuplot]: A free and very mature data display tool that works on just about any platform used that produces excellent publication-grade eps and pdf figures. Can be also used in scripts. Open source and completely free.&lt;br /&gt;
* Matlab: Very common, good toolset also for formal mathematics, good graphics. Expensive. We may have a site license, but I am not sure how painful it is for us to get a license for this course. Ask if interested.&lt;br /&gt;
* Mathematica: More common among theroetical physicists, very good in formal maths, now with better numerics. Graphs are ok but can be a pain to make looking good. As with Matlab, we do have a campus license. Ask if interested.&lt;br /&gt;
&lt;br /&gt;
===Apps===&lt;br /&gt;
Common mobile phones these days are equipped with an amazing toolchest of sensors. There are a few apps that allow you to access them directly, and turn your phone into a powerful sensor. Here some suggestions:&lt;br /&gt;
&lt;br /&gt;
* Physics Toolbox sensor suite on [https://play.google.com/store/apps/details?id=com.chrystianvieyra.physicstoolboxsuite&amp;amp;hl=en_SG Google play store] or [https://apps.apple.com/us/app/physics-toolbox-sensor-suite/id1128914250 Apple App store].&lt;br /&gt;
&lt;br /&gt;
===Data sheets===&lt;br /&gt;
A number of components might be useful for several groups. Some common data sheets are here:&lt;br /&gt;
* Photodiodes:&lt;br /&gt;
** Generic Silicon pin Photodiode type [[Media:Bpw34.pdf|BPW34]]&lt;br /&gt;
** Fast photodiodes (Silicon PIN, small area): [[Media:S5971_etc_kpin1025e.pdf|S5971/S5972/S5973]]&lt;br /&gt;
* Photogates:&lt;br /&gt;
** (to come)&lt;br /&gt;
* PT 100 Temperature sensors based on platinum wire: [[Media:PT100_TABLA_R_T.pdf|Calibration table]]&lt;br /&gt;
* Thermistor type [[Media:Thermistor B57861S.pdf|B57861S]] (R0=10k&amp;amp;Omega;, B=3988Kelvin). Search for   [https://en.wikipedia.org/wiki/Steinhart-Hart_equation Steinhart-Hart equation]. See [[Thermistor]] page here as well.&lt;br /&gt;
* Humidity sensor&lt;br /&gt;
** Sensirion device the reference unit: [[media:Sensirion SHT30-DIS.pdf|SHT30/31]]&lt;br /&gt;
* Thermopile detectors:&lt;br /&gt;
** [[Media:Thermopile_G-TPCO-035 TS418-1N426.pdf|G-TPCO-035 / TS418-1N426]]: Thermopile detector with a built-in optical bandpass filter for light around 4&amp;amp;mu;m wavelength for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; absorption&lt;br /&gt;
** [[Media:Thermopile_TS305_TCPO-033.pdf|TPCO-033 / TS305]]: Thermopile detector with wideband sensitivity 5um-25um&lt;br /&gt;
** [[Media:Thermopile_G-TPCO-019_TS105-10L5.5MM.pdf|G-TPCO-019 /TS105-10L5.5MM]]: Thermopile detector with wideband sensitivity 5um-25um and silicon lens (field of view: 10 degree)&lt;br /&gt;
* Resistor color codes are explained [https://en.wikipedia.org/wiki/Electronic_color_code here]&lt;br /&gt;
&amp;lt;!-- * Ultrasonic detectors:&lt;br /&gt;
** plastic detctor, 40 kHz, -74dB: [[Media:MCUSD16P40B12RO.pdf|MCUSD16P40B12RO]]&lt;br /&gt;
** metal casing/waterproof, 48 kHz, -90dB, [[Media:MCUSD14A48S09RS-30C.pdf|MCUSD14A48S09RS-30C]]&lt;br /&gt;
** metal casing, 40 kHz, sensitivity unknown, [[Media:MCUST16A40S12RO.pdf|MCUST16A40S12RO]]&lt;br /&gt;
** metal casing/waterproof, 300kHz, may need high voltage: [[Media:MCUSD13A300B09RS.pdf|MCUSD13A300B09RS]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* Magnetic field sensors:&lt;br /&gt;
** Fluxgate magnetometer [[media:Data-sheet FLC-100.pdf|FCL100]]&lt;br /&gt;
** Hall switch 1 (SOT-23 casing): [[media:INFineon_TLE49681KXTSA1.pdf|TLE49681]]&lt;br /&gt;
** Hall switch 2 (TO-92 casing): [[media:DiodesInc_AH9246-P-8.pdf|AH9246]]&lt;br /&gt;
** Linear Hall sensor (to come)&lt;br /&gt;
* Lasers&lt;br /&gt;
** Red laser diode [[media:HL6501MG.pdf|HL6501MG]]&lt;br /&gt;
* Generic amplifiers&lt;br /&gt;
** Instrumentation amplifiers: [[media:Ad8221.pdf|AD8221]] or [[media:AD8226.pdf|AD8226]]&lt;br /&gt;
** Conventional operational amplifiers: Precision: [[media:OP27.pdf | OP27]], General purpose: [[media:OP07.pdf | OP07]]&lt;br /&gt;
** JFET op-amp, reasonably fast: [https://www.ti.com/document-viewer/tl071/datasheet TL071]&lt;br /&gt;
** Transimpedance amplifiers for photodetectors: [[media:AD8015.pdf | AD8015]]&lt;br /&gt;
&lt;br /&gt;
==Some wiki reference materials==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [[Writing mathematical expressions]]&lt;br /&gt;
* [[Uploading images and files]]&lt;br /&gt;
&lt;br /&gt;
==Old wikis==&lt;br /&gt;
You can find entries to the wiki from [https://pc5271.org/PC5271_AY2425S2 AY2024/25 Sem 2] and [https://pc5271.org/PC5271_AY2324S2 AY2023/24 Sem 2].&lt;/div&gt;</summary>
		<author><name>Chenxi</name></author>
	</entry>
</feed>