Main Page: Difference between revisions

From pc5271AY2526wiki
Jump to navigationJump to search
Jialuo (talk | contribs)
Jialuo (talk | contribs)
Tag: Manual revert
 
(One intermediate revision by the same user not shown)
Line 46: Line 46:
Materials needed: K-type thermocouple/Thermophile;Arduino
Materials needed: K-type thermocouple/Thermophile;Arduino


=[[Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing]]=
===[[Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing]]===
Team members: Liu Chenxi; Wang Jingyi; Zhong Baoqi; Hong Jialuo; Zhang Lishang;
Team members: Liu Chenxi; Wang Jingyi; Zhong Baoqi; Hong Jialuo; Zhang Lishang;


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.
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.
==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 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.
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.
===Overall Design of the Filtering Chain===
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.
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.
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.
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.
===sEMG Signal Filtering Chain===
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.
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.
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.
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.
===Details of Real-Time Filtering Implementation===
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.
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.
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.
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.
===Conclusion===
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.
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.


===[[Humidity  Detector Based on Quartz Crystal Oscillator]]===
===[[Humidity  Detector Based on Quartz Crystal Oscillator]]===

Latest revision as of 11:48, 28 March 2026

Welcome to the wiki page for the course PC5271: Physics of Sensors "(in AY25/26 Sem 2)!

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.

Logistics: Our location is S11-02-04, time slots for "classes" are Tue and Fri 10:00am-12:00noon.

Projects[edit | edit source]

Fluorescence Sensor for Carbon Quantum Dots: Synthesis, Characterization, and Quality Control[edit | edit source]

Group menber: Zhang yiteng, Li Xiaoyue, Peng Jianxi

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.

Inductive Sensors of Ultra-high Sensitivity Based on Nonlinear Exceptional Point[edit | edit source]

Team members: Yuan Siyu; Zhu Ziyang; Wang Peikun; Li Xunyu

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.

CK: We likely have all the parts for this, but let us know the frequency so we can find the proper amplifier and circuit board.

SY: Thanks for your confirmation. The operating frequency is around 70-80 kHz.

CK: Have!

EA Spectroscopy as a series of sensors: Investigating the Impact of Film-Processing Temperature on Mobility in Organic Diodes[edit | edit source]

Team members: Li Jinhan; Liu Chenyang

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.

Optical Sensor of Magnetic Dynamics: A Balanced-Detection MOKE Magnetometer[edit | edit source]

Team members: LI Junxiang; Patricia Breanne Tan Sy

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.

Precision Measurement of Material and Optical Properties Using Interferometry[edit | edit source]

Team members: Yang SangUk; Zhang ShunYang; Xu Zifang

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.

Precision Thermocouple Based Temperature Measurement System[edit | edit source]

Team members: Sree Ranjani Krishnan; Nisha Ganesh ; Burra Srikari

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. Materials needed: K-type thermocouple/Thermophile;Arduino

Surface EMG Sensor for Muscle Activity Measurement: AFE Design and Signal Processing[edit | edit source]

Team members: Liu Chenxi; Wang Jingyi; Zhong Baoqi; Hong Jialuo; Zhang Lishang;

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.

Humidity Detector Based on Quartz Crystal Oscillator[edit | edit source]

Group menber: Ma Xiangyi; Li Xukuan; Zhang Yixuan; Zhu Rongqi

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.

To Prof. 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?

Resources[edit | edit source]

Books and links[edit | edit source]

Software[edit | edit source]

  • Various Python extensions. Python is a very powerful free programming language that runs on just about any computer platform. It is open source and completely free.
  • 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.
  • 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.
  • 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.

Apps[edit | edit source]

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:

Data sheets[edit | edit source]

A number of components might be useful for several groups. Some common data sheets are here:

  • Photodiodes:
  • Photogates:
  • PT 100 Temperature sensors based on platinum wire: Calibration table
  • Thermistor type B57861S (R0=10kΩ, B=3988Kelvin). Search for Steinhart-Hart equation. See Thermistor page here as well.
  • Humidity sensor
    • Sensirion device the reference unit: SHT30/31
  • Thermopile detectors:
    • G-TPCO-035 / TS418-1N426: Thermopile detector with a built-in optical bandpass filter for light around 4μm wavelength for CO2 absorption
    • TPCO-033 / TS305: Thermopile detector with wideband sensitivity 5um-25um
    • G-TPCO-019 /TS105-10L5.5MM: Thermopile detector with wideband sensitivity 5um-25um and silicon lens (field of view: 10 degree)
  • Resistor color codes are explained here
  • Magnetic field sensors:
    • Fluxgate magnetometer FCL100
    • Hall switch 1 (SOT-23 casing): TLE49681
    • Hall switch 2 (TO-92 casing): AH9246
    • Linear Hall sensor (to come)
  • Lasers
  • Generic amplifiers
    • Instrumentation amplifiers: AD8221 or AD8226
    • Conventional operational amplifiers: Precision: OP27, General purpose: OP07
    • JFET op-amp, reasonably fast: TL071
    • Transimpedance amplifiers for photodetectors: AD8015

Some wiki reference materials[edit | edit source]

Old wikis[edit | edit source]

You can find entries to the wiki from AY2024/25 Sem 2 and AY2023/24 Sem 2.