<?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=Jialuo</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=Jialuo"/>
	<link rel="alternate" type="text/html" href="https://pc5271.org/index.php/Special:Contributions/Jialuo"/>
	<updated>2026-10-19T23:52:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://pc5271.org/index.php?title=Surface_EMG_Sensor_for_Muscle_Activity_Measurement:_AFE_Design_and_Signal_Processing&amp;diff=848</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=848"/>
		<updated>2026-04-16T09:23:19Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* Signal Conditioning and Filtering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|thumb|center|800px|Figure 2.1. Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．]]&lt;br /&gt;
&lt;br /&gt;
=== sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|thumb|center|800px|Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|thumb|center|800px|Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|thumb|center|800px|Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|thumb|center|800px|Figure 2.5. Physical picture of the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
Although the AFE already performs preliminary band-pass filtering and 50 Hz interference suppression in the analog domain, the digitized sEMG signal may still contain residual noise due to component tolerances, electrode-contact variation, and environmental interference. Therefore, an additional digital filtering stage is implemented in software as a complementary post-processing step to improve signal quality and to provide a more stable input for rectification, envelope extraction, and subsequent analysis. In this sense, the software filtering is not a simple repetition of the analog filtering, but a refinement and compensation for non-ideal front-end behavior.&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 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;H_{BP}(z)=\frac{B_{BP}(z)}{A_{BP}(z)}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&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 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In transfer-function form, the notch stage is written as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&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 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&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 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&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 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&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;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>Jialuo</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=847</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=847"/>
		<updated>2026-04-16T09:19:07Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* Signal Conditioning and Filtering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|thumb|center|800px|Figure 2.1. Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．]]&lt;br /&gt;
&lt;br /&gt;
=== sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|thumb|center|800px|Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|thumb|center|800px|Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|thumb|center|800px|Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|thumb|center|800px|Figure 2.5. Physical picture of the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
Although the AFE already performs preliminary band-pass filtering and 50 Hz interference suppression in the analog domain, the digitized sEMG signal may still contain residual noise due to component tolerances, electrode-contact variation, and environmental interference. Therefore, an additional digital filtering stage is implemented in software as a complementary post-processing step to improve signal quality and to provide a more stable input for rectification, envelope extraction, and subsequent analysis. In this sense, the software filtering is not a simple repetition of the analog filtering, but a refinement and compensation for non-ideal front-end behavior.&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 &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;
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 &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;
In transfer-function form, the notch stage is written as &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;H_{N}(z)=\frac{B_{N}(z)}{A_{N}(z)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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 &lt;br /&gt;
&lt;br /&gt;
&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;&lt;br /&gt;
&lt;br /&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 &lt;br /&gt;
&lt;br /&gt;
&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;&lt;br /&gt;
&lt;br /&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;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>Jialuo</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=846</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=846"/>
		<updated>2026-04-16T09:15:04Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* Signal Conditioning and Filtering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Background and Theory==&lt;br /&gt;
&lt;br /&gt;
=== Surface EMG Signals ===&lt;br /&gt;
Surface electromyography (sEMG) refers to the bioelectrical signals detected on the skin surface during muscle contraction. These signals originate from the electrical activity of muscle fibers and provide a non-invasive way to monitor muscle activation. Compared with invasive EMG methods, sEMG is easier to apply, safer for repeated measurements, and more suitable for real-time monitoring. Therefore, it has been widely used in areas such as rehabilitation, motion analysis, human–machine interaction, and physiological monitoring.&lt;br /&gt;
&lt;br /&gt;
=== Characteristics of EMG Signals ===&lt;br /&gt;
EMG signals are generally weak, time-varying, and stochastic in nature. Their waveforms are typically bipolar, fluctuating around zero with both positive and negative components. The amplitude and frequency content of EMG signals depend on factors such as muscle contraction level, electrode placement, skin condition, and individual physiological differences. In practice, the useful frequency components of sEMG are mainly concentrated in a limited low-to-mid frequency range. Because of their low amplitude and variability, EMG signals usually require further conditioning before reliable interpretation and feature extraction can be performed.&lt;br /&gt;
&lt;br /&gt;
=== Bioelectrical Signal Acquisition Principles ===&lt;br /&gt;
The acquisition of bioelectrical signals is based on measuring the small potential difference on the skin surface using electrodes, then converting it into a processable electrical signal through amplification and digitization. For sEMG measurement, electrode placement and skin–electrode contact quality are especially important, since they directly affect signal amplitude and stability. In addition, the front-end acquisition circuit must provide sufficient sensitivity and good interference rejection, so that the recorded signal reflects actual muscle activity rather than environmental disturbance or poor contact conditions.&lt;br /&gt;
&lt;br /&gt;
=== Noise Sources in EMG (50 Hz, motion artifacts) ===&lt;br /&gt;
In practical EMG recording, the measured signal is easily contaminated by different types of noise. Two of the most common sources are power-line interference and motion artifacts. Power-line interference usually appears as a narrow-band component at 50 Hz in the local electrical environment, while motion artifacts are mainly caused by electrode movement, cable disturbance, or variations in the electrode–skin impedance, and are often concentrated in the low-frequency range. In addition, electronic noise from the acquisition hardware may also affect the recording quality. These unwanted components can reduce signal clarity and make muscle activity analysis less reliable, so they must be considered in the design of the signal processing pipeline.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
=== Total Structure Design ===&lt;br /&gt;
&lt;br /&gt;
For clarity，the proposed physiological signal acquisition system mainly consists of two core parts：the analog front－end （AFE）and the ADC board．The AFE is responsible for the preliminary conditioning of weak bioelectrical signals，including amplification，filtering，interference suppression，and level shifting，so that the analog waveform can be converted into a stable and measurable form．The ADC board then performs high－resolution digitization of the conditioned signal and transfers the sampled data to the host computer for subsequent display，storage，and analysis．Therefore，the overall system forms a complete signal－acquisition chain from weak physiological input to digital output．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_1.jpg|thumb|center|800px|Figure 2.1. Overall system architecture of the proposed physiological signal acquisition platform，including the AFE and ADC modules．]]&lt;br /&gt;
&lt;br /&gt;
=== sEMG AFE Design ===&lt;br /&gt;
&lt;br /&gt;
To collect the weak bioelectric potential signals of the human body，an analog front－end（AFE）suitable sEMG measurements was designed．The module is powered by an external 5 V supply，and the complete circuit includes a first－ stage instrumentation amplifier based on INA128（Texas Instruments，Dallas，TX，USA），a band－pass filter，a 50 Hz notch filter，a second－order amplification and level shifting stage，a driver electrode circuit，a precise 1.5 V reference source，and a -5 V voltage generation module for powering the operational amplifiers．&lt;br /&gt;
&lt;br /&gt;
==== First－order Amplifier ====&lt;br /&gt;
&lt;br /&gt;
The input bioelectric signal is first acquired in differential form and applied to the INA128 instrumentation amplifier，which provides high input impedance，high common－mode rejection，and moderate initial gain for sEMG acquisition．This stage enlarges the weak physiological signal before filtering while reducing the risk of premature saturation caused by electrode offset or motion－induced disturbance，thereby preparing a more stable signal for the subsequent conditioning stages．&lt;br /&gt;
&lt;br /&gt;
==== Bandpass Filter ====&lt;br /&gt;
&lt;br /&gt;
After the instrumentation amplifier，the signal passes through a second－order active band－pass filter，as shown in Figure 2．2． This stage suppresses baseline drift and high－frequency noise outside the useful sEMG range，so that the low－frequency envelope information of sEMG can be preserved before further amplification．&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_2.jpg|thumb|center|800px|Figure 2.2. Schematic diagram of the active band-pass filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the band-pass stage used to retain the main physiological signal band while suppressing unwanted lowand high-frequency components.&lt;br /&gt;
&lt;br /&gt;
==== Notch Filter ====&lt;br /&gt;
&lt;br /&gt;
To reduce power-line interference, a dedicated 50 Hz notch filter is introduced after the band-pass stage, as shown in Figure 2.3. This filter attenuates the mains-frequency component that commonly contaminates weak bioelectric measurements, thereby improving the signal-to-noise ratio of sEMG signals before the final amplification stage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_3.jpg|thumb|center|800px|Figure 2.3. Schematic diagram of the 50 Hz notch filter used in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the circuit used to attenuate 50 Hz mains interference in the analog front end.&lt;br /&gt;
&lt;br /&gt;
==== Second-order Amplifier &amp;amp; Level Shifter ====&lt;br /&gt;
&lt;br /&gt;
After filtering, the signal enters the second-stage amplification and level-shifting circuit shown in Figure 2.4. In this stage, the filtered signal is further amplified to improve amplitude utilization and then shifted by a 1.5 V reference so that the output becomes a stable unipolar signal suitable for ADC sampling, while preserving linear operation and providing sufficient output swing margin.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_4.jpg|thumb|center|800px|Figure 2.4. Schematic diagram of the second-stage amplifier and level-shifting circuit in the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows how the conditioned signal is further amplified and shifted to a suitable DC level before digitization.&lt;br /&gt;
&lt;br /&gt;
==== Power Module and Drive-electrode Circuit ====&lt;br /&gt;
&lt;br /&gt;
The AFE is powered by a 5 V supply and also integrates a 1.5 V precision reference, a -5 V generation circuit, and a driveelectrode circuit. These supporting modules provide the required supply rails and reference level for analog signal conditioning, while the drive-electrode circuit feeds back common-mode voltage to the body to suppress interference at the source. As a result, the complete AFE can support sEMG acquisition with adequate gain, filtering, and noise-reduction performance in a compact hardware structure.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_5.jpg|thumb|center|800px|Figure 2.5. Physical picture of the sEMG AFE.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the fabricated sEMG analog front-end hardware used in the system.&lt;br /&gt;
&lt;br /&gt;
Figure 2.5 presents the practical hardware implementation of the proposed sEMG AFE. It integrates amplification, filtering, level shifting, and driven-reference functions in a compact circuit for weak bioelectrical signal acquisition.&lt;br /&gt;
&lt;br /&gt;
=== ADS1256-based ADC Board ===&lt;br /&gt;
&lt;br /&gt;
To digitize the conditioned weak physiological signals with sufficient resolution and low noise, this project developed a dedicated ADC board based on the ADS1256 analog-to-digital converter (Texas Instruments, Dallas, TX, USA) and the STM32F103C8T6 microcontroller (STMicroelectronics, Geneva, Switzerland). The overall design objective of this board was not merely to realize analog-to-digital conversion, but to provide a complete hardware interface between the analog front-end and the digital processing unit, including precision reference generation, clocking, input protection and filtering, serial communication, power regulation, and MCU-based acquisition control. The ADS1256 was selected because it is a&lt;br /&gt;
&lt;br /&gt;
very low-noise 24-bit delta-sigma converter with a programmable gain amplifier (PGA), flexible input multiplexer, programmable digital filter, and SPI-compatible serial interface, which makes it well suited for weak low-frequency physiological signals after analog conditioning. The STM32F103C8T6 was used as the local controller because it provides a 32-bit Cortex-M3 core, up to 72 MHz system clock, SPI, USART, USB, and standard SWD debugging support in a compact and low-cost platform.&lt;br /&gt;
&lt;br /&gt;
==== ADC Core Architecture and Design Rationale ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 was selected as the core ADC because it provides high-resolution, low-noise delta-sigma conversion with an input multiplexer, programmable gain amplifier, and digital filter, which are suitable for weak and low-frequency physiological signals. As shown in Figure 2.6, this architecture emphasizes resolution and noise performance rather than high conversion bandwidth, making it appropriate for sEMG signal digitization after analog conditioning.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_6.jpg|thumb|center|800px|Figure 2.6. Internal functional structure of the ADS1256 analog-to-digital converter.]]&lt;br /&gt;
&lt;br /&gt;
This figure shows the main internal blocks of the ADS1256, including the multiplexer, PGA, modulator, and digital filter.&lt;br /&gt;
&lt;br /&gt;
==== Analog Front-End Interface, Reference, and Clocking ====&lt;br /&gt;
&lt;br /&gt;
The ADS1256 analog inputs are connected to the external header through a passive input-conditioning network that helps suppress high-frequency interference and improve input stability. In addition, the board includes a dedicated precision reference and clocking circuits so that the ADC can perform stable and accurate conversion. Together, these circuits provide a reliable analog interface and timing basis for high-resolution digitization of weak physiological signals.&lt;br /&gt;
&lt;br /&gt;
==== SPI Interface between ADS1256 and STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
Communication between the ADS1256 and the STM32F103C8T6 is implemented through an SPI-compatible interface, with dedicated lines for chip select, serial clock, input/output data, data-ready notification, and hardware reset. This connection allows the MCU to configure the ADC, read conversion results in synchrony with DRDY, and maintain efficient and reliable acquisition control for multi-channel physiological measurements.&lt;br /&gt;
&lt;br /&gt;
==== Power Supply and On-board Regulation ====&lt;br /&gt;
&lt;br /&gt;
The ADC board uses a USB Type-B connector as the main power input and includes protection, voltage regulation, and local decoupling circuits to provide a stable supply for both the MCU and ADC-related hardware. In addition, analog ground and digital ground are separated in the PCB layout to reduce digital noise coupling into the analog path, which is particularly important for weak physiological signal acquisition.&lt;br /&gt;
&lt;br /&gt;
==== Basic Peripheral Circuits of the STM32F103C8T6 ====&lt;br /&gt;
&lt;br /&gt;
The STM32F103C8T6 serves as the local controller of the ADC board and is supported by several basic peripheral circuits, including an external crystal oscillator, reset network, BOOT0 configuration, SWD programming/debugging header, and a CH340N USB-to-UART bridge. These circuits ensure stable MCU operation, convenient firmware downloading and debugging, and reliable data transmission from the board to the host computer for real-time display and storage.&lt;br /&gt;
&lt;br /&gt;
==== Hardware-level Working Principle of the ADC Board ====&lt;br /&gt;
&lt;br /&gt;
In operation, the conditioned analog signal from the AFE enters the ADS1256 through the input header, is digitized with high resolution under the control of the local precision reference and clock, and is then read by the STM32 through the SPI interface. The MCU subsequently forwards the sampled data to the host computer through the serial communication link, so that the entire board functions as a compact digital acquisition backend connecting weak physiological analog signals to later software processing, display, and storage.&lt;br /&gt;
&lt;br /&gt;
[[File:Figure_2_7.jpg|thumb|center|800px|Figure 2.7. Photograph of the fabricated ADS1256-based ADC board developed in this project and the definitions of some key pins.]]&lt;br /&gt;
&lt;br /&gt;
Figure 2.7 shows the ADC board fabricated for this project. It integrates the ADS1256 conversion core, STM32 control circuit, power-conditioning circuits, and communication interfaces on a compact PCB for physiological signal digitization.&lt;br /&gt;
&lt;br /&gt;
== Signal Conditioning and Filtering ==&lt;br /&gt;
Although the AFE already performs preliminary band-pass filtering and 50 Hz interference suppression in the analog domain, the digitized sEMG signal may still contain residual noise due to component tolerances, electrode-contact variation, and environmental interference. Therefore, an additional digital filtering stage is implemented in software as a complementary post-processing step to improve signal quality and to provide a more stable input for rectification, envelope extraction, and subsequent analysis. In this sense, the software filtering is not a simple repetition of the analog filtering, but a refinement and compensation for non-ideal front-end behavior.&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;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>Jialuo</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=503</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=503"/>
		<updated>2026-04-05T06:46:47Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* 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;
==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;/div&gt;</summary>
		<author><name>Jialuo</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=502</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=502"/>
		<updated>2026-04-05T06:28:52Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* 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 may be 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 may be 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 relatively 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. Mathematically, this operation is written as &amp;lt;math&amp;gt;y_{\mathrm{rect}}[n] = |x[n]|&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;x[n]&amp;lt;/math&amp;gt; denotes the filtered discrete-time sEMG signal. 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. In the flowchart, this stage is represented by the low-pass filtering block following full-wave rectification.&lt;br /&gt;
&lt;br /&gt;
An important feature of the present implementation is that the entire filtering process is performed in real time, 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. In practical terms, the pipeline may therefore be summarized as raw sEMG input, band-pass filtering, notch filtering, rectification, envelope extraction, and processed output, exactly as shown in the inserted flowchart.&lt;br /&gt;
&lt;br /&gt;
Overall, this signal-conditioning scheme provides a scientifically sound and 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;/div&gt;</summary>
		<author><name>Jialuo</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=501</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=501"/>
		<updated>2026-04-05T03:46:39Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* 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;
===Noise Sources in sEMG===&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are mainly affected by three types of noise: power-line interference (50 Hz), motion artifacts concentrated below 20 Hz, and high-frequency electronic noise. These disturbances degrade signal quality and may reduce the reliability of subsequent feature extraction and parameter estimation. Therefore, an effective filtering strategy is essential for real-time sEMG processing.&lt;br /&gt;
&lt;br /&gt;
===Filtering Strategy===&lt;br /&gt;
&lt;br /&gt;
The proposed filtering scheme follows the principle of“band limitation first, precise filtering second.”Specifically, the raw sEMG signal is first processed by a band-pass filter and then by a notch filter. This structure can be summarized as:&lt;br /&gt;
&lt;br /&gt;
Band-pass → Notch&lt;br /&gt;
&lt;br /&gt;
Applying band-pass filtering first restricts the signal to its effective frequency range and suppresses low-frequency motion artifacts as well as high-frequency noise. On this basis, the notch filter can then more precisely remove the 50 Hz power-line interference that lies within the sEMG frequency band. This order improves both filtering efficiency and signal fidelity in real-time applications.&lt;br /&gt;
&lt;br /&gt;
===Band-pass Filter Design===&lt;br /&gt;
&lt;br /&gt;
A fourth-order Butterworth IIR band-pass filter is adopted in this study. The main design parameters are as follows:&lt;br /&gt;
&lt;br /&gt;
-Type:Butterworth IIR  &lt;br /&gt;
-Order:4th order  &lt;br /&gt;
-Cutoff frequencies:20–160 Hz  &lt;br /&gt;
&lt;br /&gt;
This frequency range is selected according to the spectral characteristics of sEMG. The lower cutoff at 20 Hz helps suppress motion artifacts and unstable low-frequency noise from the electrode–skin interface, while the upper cutoff at 160 Hz removes high-frequency noise and preserves the main energy components of sEMG. The Butterworth structure provides a smooth passband response and is therefore suitable for preserving signal morphology.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;H_{BP}(z) = \frac{B(z)}{A(z)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;f_c \in [20, 160] \text{ Hz}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Notch Filter Design===&lt;br /&gt;
&lt;br /&gt;
To suppress power-line interference, a 50 Hz notch filter is introduced after band-pass filtering. Since 50 Hz lies directly within the effective frequency range of sEMG, this interference must be removed to avoid distortion in subsequent analysis. The bandwidth of the notch filter is controlled by the quality factor (Q), which determines the trade-off between interference suppression and preservation of adjacent useful signal components.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;H_{N}(z) = \frac{B_N(z)}{A_N(z)}&amp;lt;/math&amp;gt;&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;
&amp;lt;math&amp;gt;Q = \frac{f_0}{\Delta f}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Signal Post-processing===&lt;br /&gt;
&lt;br /&gt;
In addition to filtering, signal post-processing is necessary to reflect muscle activation intensity more clearly.After filtering, the sEMG signal is full-wave rectified by taking its absolute value. This converts the bipolar raw signal into a unipolar form that is more suitable for amplitude analysis.Following rectification, the signal envelope is extracted using a low-pass filter with a cutoff frequency of 5–10 Hz. This range corresponds to the typical variation frequency of muscle contraction. The resulting envelope provides a smooth representation of muscle activation intensity and is useful for applications such as force estimation, fatigue analysis, and motor control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;y_{\mathrm{rect}}[n] = |x[n]|&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;y_{\mathrm{env}}[n] = \mathrm{LPF}\bigl(y_{\mathrm{rect}}[n]\bigr)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;&lt;br /&gt;
&lt;br /&gt;
===Real-time Implementation===&lt;br /&gt;
&lt;br /&gt;
For real-time processing, IIR filters are preferred over FIR filters because they require lower order, less computation, and shorter delay to achieve comparable filtering performance. These properties make IIR filters more suitable for embedded systems and streaming applications.&lt;br /&gt;
&lt;br /&gt;
A key issue in real-time IIR filtering is that the filter output depends not only on current and previous inputs, but also on previous outputs. Therefore, state continuity must be maintained during streaming processing. If the internal states are reinitialized for each new data segment, transient distortion will appear at the beginning of the output. In practice, the filter state can be preserved and updated continuously, for example by using the lfilter_zi mechanism provided in SciPy.&lt;br /&gt;
&lt;br /&gt;
The filtering process is implemented in a sample-by-sample streaming manner. For each incoming sample, the signal passes sequentially through the band-pass filter and the notch filter, while the internal states of both filters are updated continuously. This strategy ensures causal, continuous, and low-latency filtering, which is essential for real-time sEMG applications.&lt;br /&gt;
&lt;br /&gt;
&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;&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
This section presents a real-time filtering scheme for sEMG signals based on a band-pass + notch structure. A fourth-order Butterworth IIR band-pass filter (20–160 Hz) is used to preserve the main sEMG components while suppressing motion artifacts and high-frequency noise, and a 50 Hz notch filter is applied to remove power-line interference. In addition, rectification, envelope extraction, and state-preserved streaming implementation further improve the practicality of the proposed method for real-time biomedical signal processing.&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|sEMG signal processing flowchart]]&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;/div&gt;</summary>
		<author><name>Jialuo</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=500</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=500"/>
		<updated>2026-04-05T03:26:18Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* Real-time Implementation */&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;
===Noise Sources in sEMG===&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are mainly affected by three types of noise: power-line interference (50 Hz), motion artifacts concentrated below 20 Hz, and high-frequency electronic noise. These disturbances degrade signal quality and may reduce the reliability of subsequent feature extraction and parameter estimation. Therefore, an effective filtering strategy is essential for real-time sEMG processing.&lt;br /&gt;
&lt;br /&gt;
===Filtering Strategy===&lt;br /&gt;
&lt;br /&gt;
The proposed filtering scheme follows the principle of“band limitation first, precise filtering second.”Specifically, the raw sEMG signal is first processed by a band-pass filter and then by a notch filter. This structure can be summarized as:&lt;br /&gt;
&lt;br /&gt;
Band-pass → Notch&lt;br /&gt;
&lt;br /&gt;
Applying band-pass filtering first restricts the signal to its effective frequency range and suppresses low-frequency motion artifacts as well as high-frequency noise. On this basis, the notch filter can then more precisely remove the 50 Hz power-line interference that lies within the sEMG frequency band. This order improves both filtering efficiency and signal fidelity in real-time applications.&lt;br /&gt;
&lt;br /&gt;
===Band-pass Filter Design===&lt;br /&gt;
&lt;br /&gt;
A fourth-order Butterworth IIR band-pass filter is adopted in this study. The main design parameters are as follows:&lt;br /&gt;
&lt;br /&gt;
-Type:Butterworth IIR  &lt;br /&gt;
-Order:4th order  &lt;br /&gt;
-Cutoff frequencies:20–160 Hz  &lt;br /&gt;
&lt;br /&gt;
This frequency range is selected according to the spectral characteristics of sEMG. The lower cutoff at 20 Hz helps suppress motion artifacts and unstable low-frequency noise from the electrode–skin interface, while the upper cutoff at 160 Hz removes high-frequency noise and preserves the main energy components of sEMG. The Butterworth structure provides a smooth passband response and is therefore suitable for preserving signal morphology.&lt;br /&gt;
&lt;br /&gt;
===Notch Filter Design===&lt;br /&gt;
&lt;br /&gt;
To suppress power-line interference, a 50 Hz notch filter is introduced after band-pass filtering. Since 50 Hz lies directly within the effective frequency range of sEMG, this interference must be removed to avoid distortion in subsequent analysis. The bandwidth of the notch filter is controlled by the quality factor (Q), which determines the trade-off between interference suppression and preservation of adjacent useful signal components.&lt;br /&gt;
&lt;br /&gt;
===Signal Post-processing===&lt;br /&gt;
&lt;br /&gt;
In addition to filtering, signal post-processing is necessary to reflect muscle activation intensity more clearly.After filtering, the sEMG signal is full-wave rectified by taking its absolute value. This converts the bipolar raw signal into a unipolar form that is more suitable for amplitude analysis.Following rectification, the signal envelope is extracted using a low-pass filter with a cutoff frequency of 5–10 Hz. This range corresponds to the typical variation frequency of muscle contraction. The resulting envelope provides a smooth representation of muscle activation intensity and is useful for applications such as force estimation, fatigue analysis, and motor control.&lt;br /&gt;
&lt;br /&gt;
===Real-time Implementation===&lt;br /&gt;
&lt;br /&gt;
For real-time processing, IIR filters are preferred over FIR filters because they require lower order, less computation, and shorter delay to achieve comparable filtering performance. These properties make IIR filters more suitable for embedded systems and streaming applications.&lt;br /&gt;
&lt;br /&gt;
A key issue in real-time IIR filtering is that the filter output depends not only on current and previous inputs, but also on previous outputs. Therefore, state continuity must be maintained during streaming processing. If the internal states are reinitialized for each new data segment, transient distortion will appear at the beginning of the output. In practice, the filter state can be preserved and updated continuously, for example by using the lfilter_zi mechanism provided in SciPy.&lt;br /&gt;
&lt;br /&gt;
The filtering process is implemented in a sample-by-sample streaming manner. For each incoming sample, the signal passes sequentially through the band-pass filter and the notch filter, while the internal states of both filters are updated continuously. This strategy ensures causal, continuous, and low-latency filtering, which is essential for real-time sEMG applications.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
This section presents a real-time filtering scheme for sEMG signals based on a band-pass + notch structure. A fourth-order Butterworth IIR band-pass filter (20–160 Hz) is used to preserve the main sEMG components while suppressing motion artifacts and high-frequency noise, and a 50 Hz notch filter is applied to remove power-line interference. In addition, rectification, envelope extraction, and state-preserved streaming implementation further improve the practicality of the proposed method for real-time biomedical signal processing.&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|sEMG signal processing flowchart]]&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;/div&gt;</summary>
		<author><name>Jialuo</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=499</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=499"/>
		<updated>2026-04-05T03:24:09Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* 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;
===Noise Sources in sEMG===&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are mainly affected by three types of noise: power-line interference (50 Hz), motion artifacts concentrated below 20 Hz, and high-frequency electronic noise. These disturbances degrade signal quality and may reduce the reliability of subsequent feature extraction and parameter estimation. Therefore, an effective filtering strategy is essential for real-time sEMG processing.&lt;br /&gt;
&lt;br /&gt;
===Filtering Strategy===&lt;br /&gt;
&lt;br /&gt;
The proposed filtering scheme follows the principle of“band limitation first, precise filtering second.”Specifically, the raw sEMG signal is first processed by a band-pass filter and then by a notch filter. This structure can be summarized as:&lt;br /&gt;
&lt;br /&gt;
Band-pass → Notch&lt;br /&gt;
&lt;br /&gt;
Applying band-pass filtering first restricts the signal to its effective frequency range and suppresses low-frequency motion artifacts as well as high-frequency noise. On this basis, the notch filter can then more precisely remove the 50 Hz power-line interference that lies within the sEMG frequency band. This order improves both filtering efficiency and signal fidelity in real-time applications.&lt;br /&gt;
&lt;br /&gt;
===Band-pass Filter Design===&lt;br /&gt;
&lt;br /&gt;
A fourth-order Butterworth IIR band-pass filter is adopted in this study. The main design parameters are as follows:&lt;br /&gt;
&lt;br /&gt;
-Type:Butterworth IIR  &lt;br /&gt;
-Order:4th order  &lt;br /&gt;
-Cutoff frequencies:20–160 Hz  &lt;br /&gt;
&lt;br /&gt;
This frequency range is selected according to the spectral characteristics of sEMG. The lower cutoff at 20 Hz helps suppress motion artifacts and unstable low-frequency noise from the electrode–skin interface, while the upper cutoff at 160 Hz removes high-frequency noise and preserves the main energy components of sEMG. The Butterworth structure provides a smooth passband response and is therefore suitable for preserving signal morphology.&lt;br /&gt;
&lt;br /&gt;
===Notch Filter Design===&lt;br /&gt;
&lt;br /&gt;
To suppress power-line interference, a 50 Hz notch filter is introduced after band-pass filtering. Since 50 Hz lies directly within the effective frequency range of sEMG, this interference must be removed to avoid distortion in subsequent analysis. The bandwidth of the notch filter is controlled by the quality factor (Q), which determines the trade-off between interference suppression and preservation of adjacent useful signal components.&lt;br /&gt;
&lt;br /&gt;
===Signal Post-processing===&lt;br /&gt;
&lt;br /&gt;
In addition to filtering, signal post-processing is necessary to reflect muscle activation intensity more clearly.After filtering, the sEMG signal is full-wave rectified by taking its absolute value. This converts the bipolar raw signal into a unipolar form that is more suitable for amplitude analysis.Following rectification, the signal envelope is extracted using a low-pass filter with a cutoff frequency of 5–10 Hz. This range corresponds to the typical variation frequency of muscle contraction. The resulting envelope provides a smooth representation of muscle activation intensity and is useful for applications such as force estimation, fatigue analysis, and motor control.&lt;br /&gt;
&lt;br /&gt;
===Real-time Implementation===&lt;br /&gt;
&lt;br /&gt;
For real-time processing, IIR filters are preferred over FIR filters because they require lower order, less computation, and shorter delay to achieve comparable filtering performance. These properties make IIR filters more suitable for embedded systems and streaming applications.&lt;br /&gt;
&lt;br /&gt;
A key issue in real-time IIR filtering is that the filter output depends not only on current and previous inputs, but also on previous outputs. Therefore, state continuity must be maintained during streaming processing. If the internal states are reinitialized for each new data segment, transient distortion will appear at the beginning of the output. In practice, the filter state can be preserved and updated continuously, for example by using the lfilter_zi mechanism provided in SciPy.&lt;br /&gt;
&lt;br /&gt;
The filtering process is implemented in a sample-by-sample streaming manner. For each incoming sample, the signal passes sequentially through the band-pass filter and the notch filter, while the internal states of both filters are updated continuously. The processing pipeline can be expressed as:&lt;br /&gt;
&lt;br /&gt;
Input → Band-pass → Notch → Output&lt;br /&gt;
&lt;br /&gt;
This strategy ensures causal, continuous, and low-latency filtering, which is essential for real-time sEMG applications.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
This section presents a real-time filtering scheme for sEMG signals based on a band-pass + notch structure. A fourth-order Butterworth IIR band-pass filter (20–160 Hz) is used to preserve the main sEMG components while suppressing motion artifacts and high-frequency noise, and a 50 Hz notch filter is applied to remove power-line interference. In addition, rectification, envelope extraction, and state-preserved streaming implementation further improve the practicality of the proposed method for real-time biomedical signal processing.&lt;br /&gt;
[[File:flowchart.png|thumb|center|500px|sEMG signal processing flowchart]]&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;/div&gt;</summary>
		<author><name>Jialuo</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=File:Flowchart.png&amp;diff=498</id>
		<title>File:Flowchart.png</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=File:Flowchart.png&amp;diff=498"/>
		<updated>2026-04-05T03:21:19Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jialuo</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=497</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=497"/>
		<updated>2026-04-05T02:37:23Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* Signal Post-processing */&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;
===Noise Sources in sEMG===&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are mainly affected by three types of noise: power-line interference (50 Hz), motion artifacts concentrated below 20 Hz, and high-frequency electronic noise. These disturbances degrade signal quality and may reduce the reliability of subsequent feature extraction and parameter estimation. Therefore, an effective filtering strategy is essential for real-time sEMG processing.&lt;br /&gt;
&lt;br /&gt;
===Filtering Strategy===&lt;br /&gt;
&lt;br /&gt;
The proposed filtering scheme follows the principle of“band limitation first, precise filtering second.”Specifically, the raw sEMG signal is first processed by a band-pass filter and then by a notch filter. This structure can be summarized as:&lt;br /&gt;
&lt;br /&gt;
Band-pass → Notch&lt;br /&gt;
&lt;br /&gt;
Applying band-pass filtering first restricts the signal to its effective frequency range and suppresses low-frequency motion artifacts as well as high-frequency noise. On this basis, the notch filter can then more precisely remove the 50 Hz power-line interference that lies within the sEMG frequency band. This order improves both filtering efficiency and signal fidelity in real-time applications.&lt;br /&gt;
&lt;br /&gt;
===Band-pass Filter Design===&lt;br /&gt;
&lt;br /&gt;
A fourth-order Butterworth IIR band-pass filter is adopted in this study. The main design parameters are as follows:&lt;br /&gt;
&lt;br /&gt;
-Type:Butterworth IIR  &lt;br /&gt;
-Order:4th order  &lt;br /&gt;
-Cutoff frequencies:20–160 Hz  &lt;br /&gt;
&lt;br /&gt;
This frequency range is selected according to the spectral characteristics of sEMG. The lower cutoff at 20 Hz helps suppress motion artifacts and unstable low-frequency noise from the electrode–skin interface, while the upper cutoff at 160 Hz removes high-frequency noise and preserves the main energy components of sEMG. The Butterworth structure provides a smooth passband response and is therefore suitable for preserving signal morphology.&lt;br /&gt;
&lt;br /&gt;
===Notch Filter Design===&lt;br /&gt;
&lt;br /&gt;
To suppress power-line interference, a 50 Hz notch filter is introduced after band-pass filtering. Since 50 Hz lies directly within the effective frequency range of sEMG, this interference must be removed to avoid distortion in subsequent analysis. The bandwidth of the notch filter is controlled by the quality factor (Q), which determines the trade-off between interference suppression and preservation of adjacent useful signal components.&lt;br /&gt;
&lt;br /&gt;
===Signal Post-processing===&lt;br /&gt;
&lt;br /&gt;
In addition to filtering, signal post-processing is necessary to reflect muscle activation intensity more clearly.After filtering, the sEMG signal is full-wave rectified by taking its absolute value. This converts the bipolar raw signal into a unipolar form that is more suitable for amplitude analysis.Following rectification, the signal envelope is extracted using a low-pass filter with a cutoff frequency of 5–10 Hz. This range corresponds to the typical variation frequency of muscle contraction. The resulting envelope provides a smooth representation of muscle activation intensity and is useful for applications such as force estimation, fatigue analysis, and motor control.&lt;br /&gt;
&lt;br /&gt;
===Real-time Implementation===&lt;br /&gt;
&lt;br /&gt;
For real-time processing, IIR filters are preferred over FIR filters because they require lower order, less computation, and shorter delay to achieve comparable filtering performance. These properties make IIR filters more suitable for embedded systems and streaming applications.&lt;br /&gt;
&lt;br /&gt;
A key issue in real-time IIR filtering is that the filter output depends not only on current and previous inputs, but also on previous outputs. Therefore, state continuity must be maintained during streaming processing. If the internal states are reinitialized for each new data segment, transient distortion will appear at the beginning of the output. In practice, the filter state can be preserved and updated continuously, for example by using the lfilter_zi mechanism provided in SciPy.&lt;br /&gt;
&lt;br /&gt;
The filtering process is implemented in a sample-by-sample streaming manner. For each incoming sample, the signal passes sequentially through the band-pass filter and the notch filter, while the internal states of both filters are updated continuously. The processing pipeline can be expressed as:&lt;br /&gt;
&lt;br /&gt;
Input → Band-pass → Notch → Output&lt;br /&gt;
&lt;br /&gt;
This strategy ensures causal, continuous, and low-latency filtering, which is essential for real-time sEMG applications.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
This section presents a real-time filtering scheme for sEMG signals based on a band-pass + notch structure. A fourth-order Butterworth IIR band-pass filter (20–160 Hz) is used to preserve the main sEMG components while suppressing motion artifacts and high-frequency noise, and a 50 Hz notch filter is applied to remove power-line interference. In addition, rectification, envelope extraction, and state-preserved streaming implementation further improve the practicality of the proposed method for real-time biomedical signal processing.&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;/div&gt;</summary>
		<author><name>Jialuo</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=491</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=491"/>
		<updated>2026-04-01T03:32:19Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* Filter */&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;
===Noise Sources in sEMG===&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals are mainly affected by three types of noise: power-line interference (50 Hz), motion artifacts concentrated below 20 Hz, and high-frequency electronic noise. These disturbances degrade signal quality and may reduce the reliability of subsequent feature extraction and parameter estimation. Therefore, an effective filtering strategy is essential for real-time sEMG processing.&lt;br /&gt;
&lt;br /&gt;
===Filtering Strategy===&lt;br /&gt;
&lt;br /&gt;
The proposed filtering scheme follows the principle of“band limitation first, precise filtering second.”Specifically, the raw sEMG signal is first processed by a band-pass filter and then by a notch filter. This structure can be summarized as:&lt;br /&gt;
&lt;br /&gt;
Band-pass → Notch&lt;br /&gt;
&lt;br /&gt;
Applying band-pass filtering first restricts the signal to its effective frequency range and suppresses low-frequency motion artifacts as well as high-frequency noise. On this basis, the notch filter can then more precisely remove the 50 Hz power-line interference that lies within the sEMG frequency band. This order improves both filtering efficiency and signal fidelity in real-time applications.&lt;br /&gt;
&lt;br /&gt;
===Band-pass Filter Design===&lt;br /&gt;
&lt;br /&gt;
A fourth-order Butterworth IIR band-pass filter is adopted in this study. The main design parameters are as follows:&lt;br /&gt;
&lt;br /&gt;
-Type:Butterworth IIR  &lt;br /&gt;
-Order:4th order  &lt;br /&gt;
-Cutoff frequencies:20–160 Hz  &lt;br /&gt;
&lt;br /&gt;
This frequency range is selected according to the spectral characteristics of sEMG. The lower cutoff at 20 Hz helps suppress motion artifacts and unstable low-frequency noise from the electrode–skin interface, while the upper cutoff at 160 Hz removes high-frequency noise and preserves the main energy components of sEMG. The Butterworth structure provides a smooth passband response and is therefore suitable for preserving signal morphology.&lt;br /&gt;
&lt;br /&gt;
===Notch Filter Design===&lt;br /&gt;
&lt;br /&gt;
To suppress power-line interference, a 50 Hz notch filter is introduced after band-pass filtering. Since 50 Hz lies directly within the effective frequency range of sEMG, this interference must be removed to avoid distortion in subsequent analysis. The bandwidth of the notch filter is controlled by the quality factor (Q), which determines the trade-off between interference suppression and preservation of adjacent useful signal components.&lt;br /&gt;
&lt;br /&gt;
===Signal Post-processing===&lt;br /&gt;
&lt;br /&gt;
In addition to filtering, signal post-processing is necessary to reflect muscle activation intensity more clearly.&lt;br /&gt;
&lt;br /&gt;
After filtering, the sEMG signal is full-wave rectified by taking its absolute value. This converts the bipolar raw signal into a unipolar form that is more suitable for amplitude analysis.&lt;br /&gt;
&lt;br /&gt;
Following rectification, the signal envelope is extracted using a low-pass filter with a cutoff frequency of 5–10 Hz. This range corresponds to the typical variation frequency of muscle contraction. The resulting envelope provides a smooth representation of muscle activation intensity and is useful for applications such as force estimation, fatigue analysis, and motor control.&lt;br /&gt;
&lt;br /&gt;
===Real-time Implementation===&lt;br /&gt;
&lt;br /&gt;
For real-time processing, IIR filters are preferred over FIR filters because they require lower order, less computation, and shorter delay to achieve comparable filtering performance. These properties make IIR filters more suitable for embedded systems and streaming applications.&lt;br /&gt;
&lt;br /&gt;
A key issue in real-time IIR filtering is that the filter output depends not only on current and previous inputs, but also on previous outputs. Therefore, state continuity must be maintained during streaming processing. If the internal states are reinitialized for each new data segment, transient distortion will appear at the beginning of the output. In practice, the filter state can be preserved and updated continuously, for example by using the lfilter_zi mechanism provided in SciPy.&lt;br /&gt;
&lt;br /&gt;
The filtering process is implemented in a sample-by-sample streaming manner. For each incoming sample, the signal passes sequentially through the band-pass filter and the notch filter, while the internal states of both filters are updated continuously. The processing pipeline can be expressed as:&lt;br /&gt;
&lt;br /&gt;
Input → Band-pass → Notch → Output&lt;br /&gt;
&lt;br /&gt;
This strategy ensures causal, continuous, and low-latency filtering, which is essential for real-time sEMG applications.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
This section presents a real-time filtering scheme for sEMG signals based on a band-pass + notch structure. A fourth-order Butterworth IIR band-pass filter (20–160 Hz) is used to preserve the main sEMG components while suppressing motion artifacts and high-frequency noise, and a 50 Hz notch filter is applied to remove power-line interference. In addition, rectification, envelope extraction, and state-preserved streaming implementation further improve the practicality of the proposed method for real-time biomedical signal processing.&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;/div&gt;</summary>
		<author><name>Jialuo</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=442</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=442"/>
		<updated>2026-03-28T03:50:12Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: Created page with &amp;quot;==Filter== ===Introduction===  Surface electromyographic (sEMG) signals reflect the electrophysiological activity generated during skeletal muscle contraction and have been widely applied in sports medicine, rehabilitation assessment, and human–computer interaction. In practical acquisition environments, however, sEMG signals are often contaminated by various sources of noise. Power-line interference (50 Hz or 60 Hz), caused by electromagnetic coupling from power cable...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Filter==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals reflect the electrophysiological activity generated during skeletal muscle contraction and have been widely applied in sports medicine, rehabilitation assessment, and human–computer interaction. In practical acquisition environments, however, sEMG signals are often contaminated by various sources of noise. Power-line interference (50 Hz or 60 Hz), caused by electromagnetic coupling from power cables, is one of the most common sources of interference. Motion artifacts, arising from relative displacement between the electrode and the skin, are mainly concentrated in the low-frequency band. In addition, high-frequency electronic noise may also be superimposed on the target signal. The presence of such noise severely degrades signal quality and, if not effectively suppressed, will directly affect subsequent feature extraction and parameter estimation.&lt;br /&gt;
&lt;br /&gt;
For this reason, filtering has become an indispensable step in sEMG signal analysis. Unlike offline processing, real-time application scenarios, such as prosthetic control, rehabilitation training, and human–computer interaction, impose much more stringent requirements on the filtering system. Specifically, the filter must achieve low-latency, continuous, and stable streaming processing while preserving signal fidelity. This part systematically presents a complete real-time filtering scheme for sEMG, including the design of the filtering chain, the rationale for parameter selection, and the details of engineering implementation.&lt;br /&gt;
&lt;br /&gt;
===Overall Design of the Filtering Chain===&lt;br /&gt;
&lt;br /&gt;
The proposed scheme adopts a filtering architecture whose core principle can be summarized as “band limitation first, precise filtering second.” In other words, the signal is first constrained to its effective frequency band by a band-pass filter, and then power-line interference is accurately suppressed by a notch filter. This processing order has been carefully designed. Applying the band-pass filter first can effectively reduce the signal dynamic range, thereby preventing amplifier saturation caused by high-frequency noise, while also narrowing the spectral range that must be handled by the notch filter. If the order were reversed, the full-bandwidth raw signal might overload the notch filter, and any phase distortion introduced at out-of-band frequencies would remain in the processed signal.&lt;br /&gt;
&lt;br /&gt;
A fourth-order Butterworth infinite impulse response (IIR) filter is adopted for band-pass filtering. This choice is motivated by the maximally flat magnitude response of the Butterworth filter in the passband, which minimizes the introduction of artificial signal components. In addition, its monotonic attenuation characteristic helps reduce signal distortion. The power-line notch filtering stage follows the same general design framework, with the notch bandwidth controlled by the quality factor (Q), thereby achieving a balance between interference suppression and signal fidelity.&lt;br /&gt;
&lt;br /&gt;
For sEMG, the passband is selected as 20–160 Hz, and its main energy is concentrated in the 50–150 Hz band. As a result, power-line notch filtering is especially important, because 50 Hz lies directly within the effective frequency range of sEMG. In the post-processing stage, the filtered sEMG signal requires additional rectification and envelope extraction in order to reflect variations in muscle contraction intensity.&lt;br /&gt;
&lt;br /&gt;
The constraints associated with real-time processing are considered throughout the entire design. First, the filter must satisfy causality, meaning that the current output can only depend on current and past inputs. This requirement excludes zero-phase filtering methods that rely on future samples. Second, the computational delay must remain within an acceptable range so as to satisfy the requirements of real-time feedback. Most importantly, state continuity must be maintained. Since the data arrive sequentially in a streaming manner, the filter must preserve the continuity of its internal states to avoid transient responses and signal discontinuities caused by state reinitialization.&lt;br /&gt;
&lt;br /&gt;
===sEMG Signal Filtering Chain===&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic signals originate from the superposition of action potentials generated by skeletal muscle fibers and measured on the skin surface. Their spectral characteristics are closely related to the muscle type, electrode configuration, and physiological properties of the subject. In general, the effective frequency range of sEMG extends from 10 Hz to 500 Hz, while the majority of its energy is concentrated in the 50–150 Hz band. The low-frequency components below 20 Hz mainly contain motion artifacts and unstable noise associated with the electrode–skin interface, whereas the high-frequency components above 200 Hz decay rapidly and are more susceptible to noise contamination.&lt;br /&gt;
&lt;br /&gt;
Based on these characteristics, the cutoff frequencies of the sEMG band-pass filter are set to 20 Hz and 160 Hz. The 20 Hz high-pass cutoff represents a practical compromise between motion artifact suppression and signal integrity. This choice is supported by the classical studies of De Luca and colleagues and is widely regarded as a best practice in sEMG preprocessing. The 160 Hz low-pass cutoff preserves the main energy components of sEMG while attenuating high-frequency noise. A fourth-order Butterworth filter is employed to provide a smooth frequency response and sufficiently steep attenuation.&lt;br /&gt;
&lt;br /&gt;
Power-line notch filtering is of particular importance for sEMG signals. The 50 Hz power-line component lies exactly within the core frequency band of sEMG. If not removed, it will significantly contaminate the signal and interfere with subsequent analysis. Therefore, the notch filter is designed to ensure accurate suppression of power-line interference while minimizing the phase and amplitude distortion imposed on adjacent frequency components.&lt;br /&gt;
&lt;br /&gt;
The post-processing of sEMG is also essential. Since the EMG signal is a bipolar, zero-mean stochastic process, its raw amplitude cannot directly indicate muscle contraction intensity. Therefore, after filtering, full-wave rectification is required to convert the bipolar signal into a unipolar one by taking its absolute value. This operation significantly changes the spectral distribution of the signal and highlights the low-frequency components corresponding to the envelope. Envelope extraction is then performed by low-pass filtering, with the cutoff frequency typically chosen between 5 Hz and 10 Hz, which matches the maximum frequency of muscle contraction, approximately 10 Hz. The resulting envelope provides a smooth representation of the time-varying intensity of muscle contraction and serves as the basis for muscle force estimation, fatigue analysis, and motor control.&lt;br /&gt;
&lt;br /&gt;
===Details of Real-Time Filtering Implementation===&lt;br /&gt;
&lt;br /&gt;
Real-time processing is the core constraint of the proposed scheme. It requires the filter to generate output immediately as the data arrive in a streaming manner, rather than waiting for the entire signal to be collected and then processed offline in batch mode. This requirement directly affects the choice of filter type. Compared with finite impulse response (FIR) filters, infinite impulse response (IIR) filters require a lower order, less computation, and shorter delay to achieve comparable frequency response characteristics. Therefore, they are more suitable for resource-limited embedded systems and real-time applications.&lt;br /&gt;
&lt;br /&gt;
A key challenge in implementing IIR filters is state preservation. Unlike FIR filters, which depend only on current and past input samples, the output of an IIR filter depends not only on current and previous inputs but also on previous outputs. These internal states must remain consistent throughout continuous data processing. In point-by-point processing mode, after each sample has been filtered, the internal state of the filter, including the historical input and output values stored in the delay line, must be preserved and then used as the initial state for the next incoming sample. In practice, this mechanism can be implemented using the `lfilter_zi` function in the SciPy signal processing library, which computes the initial state vector of the filter and ensures continuous state transfer between data blocks or during sample-by-sample processing.&lt;br /&gt;
&lt;br /&gt;
The importance of state preservation can be understood from several perspectives. First, it eliminates transient responses when the filter is restarted. If each new segment of data were processed from a zero initial state, the filter output would exhibit unstable oscillations at the beginning, which is unacceptable in real-time streaming applications. Second, it ensures both causality and continuity, meaning that the filter output depends strictly on current and past inputs in a physically consistent manner. Third, state preservation supports flexible processing strategies. Whether the data are handled sample by sample, in fixed-length buffers, or in variable-length blocks, the continuity of the filtering behavior can still be maintained.&lt;br /&gt;
&lt;br /&gt;
The point-by-point processing procedure constitutes the basic unit of the real-time filtering system. For each newly arriving sample, the system performs the following operations in sequence. First, the raw sample is fed into the band-pass filter, and the stored state vector is used to calculate the filtered output while updating the internal state. Second, the output of the band-pass filter is taken as the input to the notch filter, where filtering and state updating are carried out in the same manner. The final single-sample output is then obtained as the filtering result at the current time instant and can be used for display, storage, or subsequent analysis. By repeating this process at every sampling instant, a continuous streaming processing pipeline is formed.&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
This chapter has systematically presented a real-time filtering scheme for sEMG signals. Centered on Butterworth IIR filters, the proposed method establishes a two-stage processing chain consisting of band-pass filtering and power-line notch filtering. By properly selecting cutoff frequencies and filter parameters, the scheme achieves a good balance between signal fidelity and noise suppression. The real-time implementation adopts a point-by-point processing mode together with a state-preservation mechanism, thereby ensuring the continuity and causality of the streaming data.&lt;br /&gt;
&lt;br /&gt;
The main technical features of the proposed scheme can be summarized as follows. First, the filtering chain follows the principle of “band limitation first, precise filtering second,” whereby the initial band-pass filtering reduces signal dynamic range and creates favorable conditions for subsequent processing. Second, the use of Butterworth filters takes into account both frequency-response and phase-related considerations, and the maximally flat passband characteristic helps prevent the introduction of artificial signal components. Third, the IIR structure, together with state preservation, offers significant advantages in computational efficiency and real-time performance, making it particularly suitable for embedded systems and real-time applications. Finally, the proposed signal chain is adapted to the characteristics of sEMG, thereby demonstrating both practicality and flexibility in real-time biomedical signal processing.&lt;/div&gt;</summary>
		<author><name>Jialuo</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Main_Page&amp;diff=441</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Main_Page&amp;diff=441"/>
		<updated>2026-03-28T03:48:31Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* 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 solution of different salt concentration by analyzing the resulting shift interference fringes.&lt;br /&gt;
&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;
===[[Humidity  Detector Based on Quartz Crystal Oscillator]]===&lt;br /&gt;
&lt;br /&gt;
Group menber: Ma Xiangyi; Li Xukuan; Zhang Yixuan; Zhu Rongqi&lt;br /&gt;
&lt;br /&gt;
This project aims to develop a humidity sensor based on a quartz crystal oscillator. The group will first construct the oscillator circuit on a breadboard. They will then fabricate the sensing device by depositing water-absorbing materials onto the quartz crystal. Humidity detection will be achieved by measuring the frequency change of the circuit caused by the mass variation on the crystal surface.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To Prof.&#039;&#039;&#039;   Several materials are available for use as the water-absorbing layer, such as PVA, polyimide, graphene oxide, and silica gel. We are currently unsure which material would be the most suitable for our device. Could you provide us with some suggestions?&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;
** reflective, with mounting holes: [[Media:TTElectronics-OPB704WZ.pdf|OPB704.WZ]]&lt;br /&gt;
** transmissive, no mounting holes: [[Media:Vishay_TCST1103.pdf|TCST1103]]&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>Jialuo</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Main_Page&amp;diff=440</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Main_Page&amp;diff=440"/>
		<updated>2026-03-28T03:47:55Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* Filter */&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 solution of different salt concentration by analyzing the resulting shift interference fringes.&lt;br /&gt;
&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;
&lt;br /&gt;
===[[Humidity  Detector Based on Quartz Crystal Oscillator]]===&lt;br /&gt;
&lt;br /&gt;
Group menber: Ma Xiangyi; Li Xukuan; Zhang Yixuan; Zhu Rongqi&lt;br /&gt;
&lt;br /&gt;
This project aims to develop a humidity sensor based on a quartz crystal oscillator. The group will first construct the oscillator circuit on a breadboard. They will then fabricate the sensing device by depositing water-absorbing materials onto the quartz crystal. Humidity detection will be achieved by measuring the frequency change of the circuit caused by the mass variation on the crystal surface.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To Prof.&#039;&#039;&#039;   Several materials are available for use as the water-absorbing layer, such as PVA, polyimide, graphene oxide, and silica gel. We are currently unsure which material would be the most suitable for our device. Could you provide us with some suggestions?&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;
** reflective, with mounting holes: [[Media:TTElectronics-OPB704WZ.pdf|OPB704.WZ]]&lt;br /&gt;
** transmissive, no mounting holes: [[Media:Vishay_TCST1103.pdf|TCST1103]]&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>Jialuo</name></author>
	</entry>
	<entry>
		<id>https://pc5271.org/index.php?title=Main_Page&amp;diff=439</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pc5271.org/index.php?title=Main_Page&amp;diff=439"/>
		<updated>2026-03-28T03:46:11Z</updated>

		<summary type="html">&lt;p&gt;Jialuo: /* 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 solution of different salt concentration by analyzing the resulting shift interference fringes.&lt;br /&gt;
&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;
==Filter==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic (sEMG) signals reflect the electrophysiological activity generated during skeletal muscle contraction and have been widely applied in sports medicine, rehabilitation assessment, and human–computer interaction. In practical acquisition environments, however, sEMG signals are often contaminated by various sources of noise. Power-line interference (50 Hz or 60 Hz), caused by electromagnetic coupling from power cables, is one of the most common sources of interference. Motion artifacts, arising from relative displacement between the electrode and the skin, are mainly concentrated in the low-frequency band. In addition, high-frequency electronic noise may also be superimposed on the target signal. The presence of such noise severely degrades signal quality and, if not effectively suppressed, will directly affect subsequent feature extraction and parameter estimation.&lt;br /&gt;
&lt;br /&gt;
For this reason, filtering has become an indispensable step in sEMG signal analysis. Unlike offline processing, real-time application scenarios, such as prosthetic control, rehabilitation training, and human–computer interaction, impose much more stringent requirements on the filtering system. Specifically, the filter must achieve low-latency, continuous, and stable streaming processing while preserving signal fidelity. This part systematically presents a complete real-time filtering scheme for sEMG, including the design of the filtering chain, the rationale for parameter selection, and the details of engineering implementation.&lt;br /&gt;
&lt;br /&gt;
===Overall Design of the Filtering Chain===&lt;br /&gt;
&lt;br /&gt;
The proposed scheme adopts a filtering architecture whose core principle can be summarized as “band limitation first, precise filtering second.” In other words, the signal is first constrained to its effective frequency band by a band-pass filter, and then power-line interference is accurately suppressed by a notch filter. This processing order has been carefully designed. Applying the band-pass filter first can effectively reduce the signal dynamic range, thereby preventing amplifier saturation caused by high-frequency noise, while also narrowing the spectral range that must be handled by the notch filter. If the order were reversed, the full-bandwidth raw signal might overload the notch filter, and any phase distortion introduced at out-of-band frequencies would remain in the processed signal.&lt;br /&gt;
&lt;br /&gt;
A fourth-order Butterworth infinite impulse response (IIR) filter is adopted for band-pass filtering. This choice is motivated by the maximally flat magnitude response of the Butterworth filter in the passband, which minimizes the introduction of artificial signal components. In addition, its monotonic attenuation characteristic helps reduce signal distortion. The power-line notch filtering stage follows the same general design framework, with the notch bandwidth controlled by the quality factor (Q), thereby achieving a balance between interference suppression and signal fidelity.&lt;br /&gt;
&lt;br /&gt;
For sEMG, the passband is selected as 20–160 Hz, and its main energy is concentrated in the 50–150 Hz band. As a result, power-line notch filtering is especially important, because 50 Hz lies directly within the effective frequency range of sEMG. In the post-processing stage, the filtered sEMG signal requires additional rectification and envelope extraction in order to reflect variations in muscle contraction intensity.&lt;br /&gt;
&lt;br /&gt;
The constraints associated with real-time processing are considered throughout the entire design. First, the filter must satisfy causality, meaning that the current output can only depend on current and past inputs. This requirement excludes zero-phase filtering methods that rely on future samples. Second, the computational delay must remain within an acceptable range so as to satisfy the requirements of real-time feedback. Most importantly, state continuity must be maintained. Since the data arrive sequentially in a streaming manner, the filter must preserve the continuity of its internal states to avoid transient responses and signal discontinuities caused by state reinitialization.&lt;br /&gt;
&lt;br /&gt;
===sEMG Signal Filtering Chain===&lt;br /&gt;
&lt;br /&gt;
Surface electromyographic signals originate from the superposition of action potentials generated by skeletal muscle fibers and measured on the skin surface. Their spectral characteristics are closely related to the muscle type, electrode configuration, and physiological properties of the subject. In general, the effective frequency range of sEMG extends from 10 Hz to 500 Hz, while the majority of its energy is concentrated in the 50–150 Hz band. The low-frequency components below 20 Hz mainly contain motion artifacts and unstable noise associated with the electrode–skin interface, whereas the high-frequency components above 200 Hz decay rapidly and are more susceptible to noise contamination.&lt;br /&gt;
&lt;br /&gt;
Based on these characteristics, the cutoff frequencies of the sEMG band-pass filter are set to 20 Hz and 160 Hz. The 20 Hz high-pass cutoff represents a practical compromise between motion artifact suppression and signal integrity. This choice is supported by the classical studies of De Luca and colleagues and is widely regarded as a best practice in sEMG preprocessing. The 160 Hz low-pass cutoff preserves the main energy components of sEMG while attenuating high-frequency noise. A fourth-order Butterworth filter is employed to provide a smooth frequency response and sufficiently steep attenuation.&lt;br /&gt;
&lt;br /&gt;
Power-line notch filtering is of particular importance for sEMG signals. The 50 Hz power-line component lies exactly within the core frequency band of sEMG. If not removed, it will significantly contaminate the signal and interfere with subsequent analysis. Therefore, the notch filter is designed to ensure accurate suppression of power-line interference while minimizing the phase and amplitude distortion imposed on adjacent frequency components.&lt;br /&gt;
&lt;br /&gt;
The post-processing of sEMG is also essential. Since the EMG signal is a bipolar, zero-mean stochastic process, its raw amplitude cannot directly indicate muscle contraction intensity. Therefore, after filtering, full-wave rectification is required to convert the bipolar signal into a unipolar one by taking its absolute value. This operation significantly changes the spectral distribution of the signal and highlights the low-frequency components corresponding to the envelope. Envelope extraction is then performed by low-pass filtering, with the cutoff frequency typically chosen between 5 Hz and 10 Hz, which matches the maximum frequency of muscle contraction, approximately 10 Hz. The resulting envelope provides a smooth representation of the time-varying intensity of muscle contraction and serves as the basis for muscle force estimation, fatigue analysis, and motor control.&lt;br /&gt;
&lt;br /&gt;
===Details of Real-Time Filtering Implementation===&lt;br /&gt;
&lt;br /&gt;
Real-time processing is the core constraint of the proposed scheme. It requires the filter to generate output immediately as the data arrive in a streaming manner, rather than waiting for the entire signal to be collected and then processed offline in batch mode. This requirement directly affects the choice of filter type. Compared with finite impulse response (FIR) filters, infinite impulse response (IIR) filters require a lower order, less computation, and shorter delay to achieve comparable frequency response characteristics. Therefore, they are more suitable for resource-limited embedded systems and real-time applications.&lt;br /&gt;
&lt;br /&gt;
A key challenge in implementing IIR filters is state preservation. Unlike FIR filters, which depend only on current and past input samples, the output of an IIR filter depends not only on current and previous inputs but also on previous outputs. These internal states must remain consistent throughout continuous data processing. In point-by-point processing mode, after each sample has been filtered, the internal state of the filter, including the historical input and output values stored in the delay line, must be preserved and then used as the initial state for the next incoming sample. In practice, this mechanism can be implemented using the `lfilter_zi` function in the SciPy signal processing library, which computes the initial state vector of the filter and ensures continuous state transfer between data blocks or during sample-by-sample processing.&lt;br /&gt;
&lt;br /&gt;
The importance of state preservation can be understood from several perspectives. First, it eliminates transient responses when the filter is restarted. If each new segment of data were processed from a zero initial state, the filter output would exhibit unstable oscillations at the beginning, which is unacceptable in real-time streaming applications. Second, it ensures both causality and continuity, meaning that the filter output depends strictly on current and past inputs in a physically consistent manner. Third, state preservation supports flexible processing strategies. Whether the data are handled sample by sample, in fixed-length buffers, or in variable-length blocks, the continuity of the filtering behavior can still be maintained.&lt;br /&gt;
&lt;br /&gt;
The point-by-point processing procedure constitutes the basic unit of the real-time filtering system. For each newly arriving sample, the system performs the following operations in sequence. First, the raw sample is fed into the band-pass filter, and the stored state vector is used to calculate the filtered output while updating the internal state. Second, the output of the band-pass filter is taken as the input to the notch filter, where filtering and state updating are carried out in the same manner. The final single-sample output is then obtained as the filtering result at the current time instant and can be used for display, storage, or subsequent analysis. By repeating this process at every sampling instant, a continuous streaming processing pipeline is formed.&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
This chapter has systematically presented a real-time filtering scheme for sEMG signals. Centered on Butterworth IIR filters, the proposed method establishes a two-stage processing chain consisting of band-pass filtering and power-line notch filtering. By properly selecting cutoff frequencies and filter parameters, the scheme achieves a good balance between signal fidelity and noise suppression. The real-time implementation adopts a point-by-point processing mode together with a state-preservation mechanism, thereby ensuring the continuity and causality of the streaming data.&lt;br /&gt;
&lt;br /&gt;
The main technical features of the proposed scheme can be summarized as follows. First, the filtering chain follows the principle of “band limitation first, precise filtering second,” whereby the initial band-pass filtering reduces signal dynamic range and creates favorable conditions for subsequent processing. Second, the use of Butterworth filters takes into account both frequency-response and phase-related considerations, and the maximally flat passband characteristic helps prevent the introduction of artificial signal components. Third, the IIR structure, together with state preservation, offers significant advantages in computational efficiency and real-time performance, making it particularly suitable for embedded systems and real-time applications. Finally, the proposed signal chain is adapted to the characteristics of sEMG, thereby demonstrating both practicality and flexibility in real-time biomedical signal processing.&lt;br /&gt;
&lt;br /&gt;
===[[Humidity  Detector Based on Quartz Crystal Oscillator]]===&lt;br /&gt;
&lt;br /&gt;
Group menber: Ma Xiangyi; Li Xukuan; Zhang Yixuan; Zhu Rongqi&lt;br /&gt;
&lt;br /&gt;
This project aims to develop a humidity sensor based on a quartz crystal oscillator. The group will first construct the oscillator circuit on a breadboard. They will then fabricate the sensing device by depositing water-absorbing materials onto the quartz crystal. Humidity detection will be achieved by measuring the frequency change of the circuit caused by the mass variation on the crystal surface.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To Prof.&#039;&#039;&#039;   Several materials are available for use as the water-absorbing layer, such as PVA, polyimide, graphene oxide, and silica gel. We are currently unsure which material would be the most suitable for our device. Could you provide us with some suggestions?&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;
** reflective, with mounting holes: [[Media:TTElectronics-OPB704WZ.pdf|OPB704.WZ]]&lt;br /&gt;
** transmissive, no mounting holes: [[Media:Vishay_TCST1103.pdf|TCST1103]]&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>Jialuo</name></author>
	</entry>
</feed>