1. Introduction
Measuring muscle activity is both fascinating and highly valuable for various reasons [
1,
2,
3]. These measurements have several key applications and are discussed in many publications. Articles [
4,
5] are among the review papers in this field. One of the primary applications of EMG/MMG signals is in the development of prostheses that mimic healthy limbs and are controlled by muscle activity. For this purpose, various numerical gesture recognition algorithms have been proposed [
6,
7,
8,
9]. Similar algorithms can also be applied to the use of EMG/MMG signals in human–machine interfaces [
10,
11]. Additionally, medical diagnostics and rehabilitation represent other crucial areas of application [
12,
13].
It is difficult to determine the date of the discoveries leading to modern EMG solutions. It would probably be appropriate to cite Luigi Galvani’s world-famous experiment in which the author demonstrated that electricity could initiate the contraction of frog leg muscles, and the experiment of Emil du Bois-Reymond, who discovered that it was also possible to record electrical activity during voluntary muscle contraction [
3].
The biochemical processes occurring in muscles during their activity are complex [
1]. In a simplified way, they can be interpreted as follows. When muscles are activated, their cells produce an electrical potential known as myopotential. This potential results from the movement of ions in muscle fibers when they are stimulated to contract. Contraction of a single fiber takes place on a zero–one rule. Multiple muscle fibers activated by a single motoneuron constitute a so-called MU (motor unit). The activity of each motor unit is based on its random recruitment and release. The superposition of potential changes from all motor units can be recorded within the muscle (invasive method) or on the skin overactive muscles as a surface electromyographic signal (sEMG). Due to the large number of motor units and the random nature of this process, the EMG signal has the character of a stochastic process with a Gaussian-like distribution [
5,
8]. MU activity is also accompanied by the generation of mechanical acoustic waves, which gives rise to the MMG (mechanomyography) method, which in some publications is referred to as SMG (sound myography) [
11,
14,
15]. The described electrical phenomena that leads to EMG signals, at the macroscopic level, leads also to changes in the electrical impedance of the muscles, which is the basis of the EI (electric impedance method) [
4], also referred to as EIM (electro impedance myography) [
13]. Just as EI is the macroscopic result of ion generation in muscle tissues, the change in muscle dimensions during contraction is the macroscopic result of muscle MU stimulation. These changes are visible as skin bulges over the muscles, and these can be recorded as a change in force or pressure by force/pressure sensors placed on the body surface. This is how force myography (FMG) works [
4,
16].
Among the aforementioned methods for muscle activity testing (EMG, MMG, EI, MG), EMG measurement has become the most widely used due to its relatively reproducible signal and fewer artifacts compared to other techniques [
4,
16,
17].
For clarity, this article refers specifically to non-invasive EMG measurements, which are sometimes called sEMG (surface EMG) in a number of publications (e.g., [
2,
10,
18,
19,
20,
21] and many others). This contrasts with the invasive EMG method, which involves electrodes embedded in muscle tissue. Additionally, the abbreviation MMG used in this article refers to acoustic signals, which are described as “muscle sounds” in some publications [
11,
14,
15].
One of the key challenges in EMG research is the high cost of commercial measurement systems, which limits accessibility. In the articles cited above, various operational or instrumentation amplifiers are used to build EMG sensors. In this project, it was decided to use the AD8232 circuit [
22]. This circuit was described in [
23] as potentially applicable as a front-end for measuring EMG signals. However, our article shows its own practical application. In addition, in this paper, the issue of the circuit’s intrinsic noise, which is a subject often raised in the literature but usually not quantified, was analyzed in detail.
This paper also presents a solution to the problem of power line hum, which was implemented in two stages: It was addressed by traditional methods known from EMC and by using simple digital filters that can be implemented in a relatively inexpensive microprocessor chip that supports at the same time analog-to-digital converters and communication with a PC type computer.
An important advantage of the presented system is that, in addition to the sensor, it includes a 16-channel analog-to-digital converter. This aspect is often overlooked in the literature, as off-the-shelf universal acquisition systems are used [
2,
4,
5,
11,
23]. In this respect, the presented design is complete, technologically very simple, and cost effective, which differs, for example, from the solution presented in [
10]. The design of the EMG/MMG sensor system with dedicated analog-to-digital converters combined with a microcontroller makes the presented system compact and easy to use. The popular USB interface, present in every PC, allows for simultaneous data transmission and power supply. Moreover, in addition to simplicity and low price, the main features of the presented solution are robustness and reliability.
2. Material and Methods
2.1. MMG Sensor
As shown in the sensor schematic (
Figure 1), the MMG sensor was constructed using a microphone. A state-of-the-art MEMS technology microphone of the INMP510 type [
24] was used. It includes both an acoustic wave sensor and a preamplifier. In addition, the output signal is amplified by an operational amplifier with a gain of approximately
where
is expressed in
V/V, values of resistors are seen in
Figure 1. The value of the gain was chosen experimentally and is a compromise between sufficient sensitivity to MMG signals and too high sensitivity to external disturbed sounds. The upper limit frequency was selected after [
15,
25] as follows:
and the low limit frequency results from the microphone characteristics are equal as
fMMGHP3dB ≅ 20
Hz [
16]. The frequency is higher than those cited in the literature [
14,
15] (by a few
Hz), but the usefulness of signals at such low frequencies in practical systems may be questionable. In practical applications (e.g., prosthetics), what is important is the speed of the system’s response, which can be arbitrarily defined at say 100 to 200
ms. It seems that analysis of a signal with a period comparable to these times is not obvious in practical applications.
The MMG sensor experienced no interference from electronic noise or power line interference. This is due to the microphone’s integration with the preamplifier and its placement in well-shielded miniature housing. However, a very high sensitivity to ambient sound signals was observed, which can be a serious limitation in practical applications.
2.2. EMG Sensor
EMG signals exhibit stochastic characteristics with a Gaussian-like distribution [
5,
8] and have a voltage amplitude ranging from several to several hundred µV
RMS. The bandwidth of the signals range from a few to several hundred hertz [
18]. Such signal parameters, especially the very small amplitude, require a careful approach in design. Many options for EMG sensor design are considered in the literature [
19,
21,
23,
25,
26,
27]. We decided on a three-electrode sensor with a reference electrode between and the over two electrodes connected to an instrumentation amplifier.
A detailed schematic of the sensor is shown in
Figure 1. As the basic front-end of the EMG sensor, an AD8232 integrated circuit (IC) was used. The AD8232 is an IC designed for biopotential measurement applications [
22]. The AD8232 front-end was originally designed for ECG (electrocardiogram) systems but can be easily adapted to EMG signals [
22,
23].
The core component of the AD8232 circuit is an instrumentation amplifier with a gain of 40 dB. Compared to a traditional measurement amplifier like the AD8422 and more from Analog Devices, its special design allows it to amplify the signal yet reject electrode offset of up to 300 mV. The circuit also offers a half-cell potential as a reference signal and an optional right leg driver (RLD) signal [
22,
25,
28]. Moreover, the AD8232 integrates an operational amplifier that enables the implementation of second-order high-pass and low-pass filters to constrain the frequency bandwidth. The useful bandwidth of the EMG signal is limited to a range from 0 to 500 Hz, although the dominant energy is between 50 and 150 Hz [
18]. Slightly different practical values are encountered in the literature [
23,
25,
27]. In the presented solution, an arbitrary 3 dB bandwidth 5 to 300 Hz was adopted. As described, the lower cut-off frequency of the second-order high-pass filter is assumed to be equal to (
Figure 1 and Refs. [
22,
23])
An additional operational amplifier, implemented in the AD8232 circuit, allows for the construction of a second-order low-pass filter. In the presented system, the limiting frequency of this filter is assumed to be equal to
at a gain of about
where the values of resistors and capacitors are seen in
Figure 1.
The total gain (instrumentation amplifier and operational amplifier) concentrated in the probe for EMG signals is therefore about 60 dB (1000 V/V). The reference electrode can be connected either to the RLD signal (right leg driver) provided in this circuit specifically for ECG measurements, or to the Vref voltage (1/2 supply) depending on the position of resistor R8. In both cases, similar sensor behavior was observed. In particular, no significant differences in power supply noise were observed, although the noise was slightly lower in the first case. The results presented later in this article were obtained for the second option, i.e., for the reference electrode connected to Vref. The probe can be powered by an external voltage source of 4–6 V. This voltage is stabilized using a linear regulator to provide an undisturbed voltage of 3.3 V.
EMG electrodes can be fabricated from various materials and with different dimensions. Based on literature recommendations [
29,
30], the authors adopted the simple and practical solution approach. Dry electrodes in the form of silver flat bars with a width of 3
mm, a length of 10.5
mm, and a distance between of about 9.5
mm were used (
Figure 2). The dimensions of the probe are 25 × 15
mm, and it is housed in a rectangular housing made by 3D printing.
2.3. Noise in the Sensor
EMG signals are bioelectrical signals of very low amplitude [
18]. Therefore, it is very important to take into account the noise of electronic systems that can interfere with EMG signals. In medical measurements, we encounter various types of noise. The first is intrinsic amplifier noise, which primarily consists of thermal Johnson noise, shot noise, and flicker noise (1/f) [
31,
32,
33]. The second type is electromagnetic interference at various frequencies, with the most significant usually being power line noise (hum) at 50
Hz or 60
Hz.
2.3.1. Intrinsic Noise of the Amplifier
The inherent noise of electronic systems cannot be eliminated. However, they can be minimized by properly designing a low-noise front-end circuit so that the noise of the other stages of the system is negligibly small. In the presented solution, the AD8232 integrated biomedical front-end was used. It offers an instrumentation amplifier with a very high common mode rejection ratio (CMRR) (typically 86
dB), a high input resistance (~5
Gom), and moderately low noise [
22].
The RTI (related to input) noise spectral density of the instrumentation amplifier shown in
Figure 3 can be read from the catalog data. Taking into account the frequency response of the basic amplifier with the designed second-order filters with 3
dB frequencies of 5 and 300
Hz, respectively, as shown in
Figure 4, the total noise at the output of the system can be estimated from the formula
where
VAn(f) is the RTI voltage noise spectral density of the instrumentation amplifier and
H(f) (
Figure 4) is the transmittance of the system. Estimated from Equation (6), the RMS value of the circuit noise voltage is approximately 2.9
µVRMS (RTI). Thus, the RTO noise voltage (associated with the output) of the sensor is 2.9
mVRMS.
The equivalent current noise of the instrumentation amplifier has been neglected in these calculations, as it is not specified in the AD8232 datasheet, implying that it is negligibly small. Furthermore, the noise of the second stage, i.e., the operational amplifier with low-pass filter, can be neglected due to the large (40
dB) gain of the previous stage. Taking the transmittance functions into account (
Figure 4), the RTI spectral noise density of the whole system can be determined, as presented in
Figure 5. The noise model of the entire EMG system is shown in
Figure 6. Measurements of self-noise (baseline), obtained by recording the output voltage with the measurement electrodes shorted to the reference electrode, confirm the above calculations.
According to
Figure 6 and
Figure 7, the total noise at the output of the EMG sensor can be expressed by the formula
where:
UScop = oscilloscope noise estimated to be less than 1.8 mV,
Un = 8.75
mVRMS can be read from
Figure 7,
U
50 Hz = 5
mVRMS we can read from
Figure 7 (−46
dB/1 VRMS),
UAn = 2.9 mVRMS was calculated previously from Equation (6)
URn = 0.85/1.9/2.7
mVRMS can be estimated as the Johnson thermal noise [
31,
32] for skin resistance of 100
kΩ/500
kΩ/1000
kΩ, respectively, as well as the transmittance of the system (
Figure 4).
Figure 7.
Signal of EMG sensor (blue) and its spectrum (red) with relaxed muscle. Note power grid hum of 5 mVRMS (−46 dB is related to 1 VRMS).
Figure 7.
Signal of EMG sensor (blue) and its spectrum (red) with relaxed muscle. Note power grid hum of 5 mVRMS (−46 dB is related to 1 VRMS).
After applying all the above values into Equation (7), we get
UEMGn = 6.6/6.1/5.7
mVRMS (RTO). These values can be interpreted as EMG signal noise (“unintentional muscle activity”) for assumed skin resistance of 100
kΩ/500
kΩ/1000
kΩ, respectively. These values are greater than the amplifier noise (2.9
mVRMS - RTO). It can therefore be concluded that the noise of the electronic amplifier system used is not critical, especially when compared to the EMG signal strength for active muscles (
Figure 8).
Figure 8 shows the analog EMG signals (taken before the AD transducers) obtained for low, medium, and high forearm muscle activity (near the ‘extensor carpi ulnaris’). A comparison of the results in
Figure 8 and the intrinsic noise of the amplifier (
Figure 6) shows that the dynamic range of the EMG signals is not less than 45 dB, which would allow the use of an AD converter with a much lower resolution than the one used in the project (ADS1178 [
34]). However, the use of the ADS1178 chip with a resolution as high as 16 bits and a full-scale range of 5 V is advantageous, as it allows the system to be greatly simplified by neglecting the mismatch between the reference voltages of the sensor (
Vref = 1.65
V) and the converter (2.5
V) and not paying attention to the offset of both.
2.3.2. Power Line Hum
Elimination of interference from other electronic sources, particularly power line noise, is usually achieved using standard EMC design principles. The most important of these principles are signal symmetry (differential signals) and common-mode shielding [
35,
36]. Such principles are implemented through appropriate PCB and mechanical design [
35,
37].
The most difficult signal to eliminate in medical measurements is 50 Hz (60
Hz) power line hum. It usually has two components—a large amplitude common mode component and a much smaller differential component. The common mode component can be limited by EMC techniques [
35,
36]:
placement of a preamplifier directly at the electrodes, thus reducing the possibility of capacitive coupling,
use of an instrumentation amplifier with a high CMRR (above 80
dB [
11]),
symmetrical design of the electronic circuit not worsening the CMRR of the amplifier,
use of shielding,
proper grounding of the system.
All these techniques were used in the presented solution. An instrumentation amplifier with a CMRR of about 86
dB was used. The design was carried out in accordance with EMC rules [
33,
34,
35] and datasheet recommendations [
22], though it was not possible to eliminate hum completely. The difficulty of entirely eliminating the hum is due to the fact that the elimination of low-frequency network signals is difficult in practice, especially in terms of magnetic field shielding [
35,
36], and that, to some small extent, interfering signals can also induce a differential signal that cannot be eliminated. An example is the measurement made in the laboratory, shown in
Figure 7, where the EMG signal (relaxed muscles) is measured in a single probe applied to a forearm muscle, and where there is a small but visible 50
Hz component in the signal spectrum.
Laboratory tests show large differences in power line noise depending on many factors (e.g., measurement location, measurement time). Therefore, it seems that the use of a 50
Hz band-stop (notch) filter is essential if such a system is to be robust and reliable in practical applications. The design of analog notch filters is well known and in use [
25,
27,
38]. Such a filter requires additional area on the circuit board, which increases the dimensions of the system. In addition, the use of such a filter requires precision components and usually requires fine tuning. It is also difficult to change the frequency from 50
Hz to 60
Hz if the conditions in which the system is used require it.
A good solution seems to be the use of a digital filter implemented already after signal acquisition (as used in the described circuit and described in the next chapter of the paper). However, it should be borne in mind that the condition for the proper operation of such a solution is that the signal from the probe, including the hum, is limited to values that do not cause saturation of the analog system. In other words, there is no signal interference between power line hum and EMG signal caused by system nonlinearities. Therefore, the traditional methods of eliminating hum [
35,
36,
37] used in the project and mentioned above are also indispensable.
2.4. Microprocessor-Based Acquisition System
The system presented in the article allows for easy data collection from eight probes using any computer equipped with a USB interface. This interface provides both data transmission and power to the system, making EMG/MMG data collection easy to use. The acquisition system consists of ADS1178 (
Figure 9 and
Figure 10) analog-to-digital converters [
34]. A characteristic feature of these circuits is that they can be connected in series, thus increasing the number of channels. In the presented system, two circuits were used, which allows the possibility of reading 16 analog channels with their simultaneous samplings. The signal from the converters is read by the STM32H503 microprocessor via a simplified SPI-like serial interface. A high-speed USB interface, which simulates a serial COM port, was used for external communication with the computer.
The input voltage range of the converters is 0 to 5
V (reference voltage ½ of supply = 2.5
V). This full scaling range allows for easy software recognition of sensor saturation, whose output voltages are 0–3.3
V. The sampling frequency is 8333.333
sps, but only every 6th sample is read by the microprocessor. This gives a final sampling frequency of 1388.889
sps. A major advantage of the AD1178 converters used is also the use of Δ-Σ conversion with large oversampling [
39]. It makes it possible to dispense with an extensive anti-analyzing filter, which simplifies the design considerably.
The only disadvantage of the ADS1178 chips is the need for three supply voltages for the analog part at 5 V, for the digital outputs at 3.3 V, and for the core supply at 1.8 V. All these voltages are obtained by using linear regulators from 6 V. The 6 V voltage is produced by a step-up converter located on a separate PCB from the USB interface (5 V). Optionally, instead of the step-up converter supplied with 5 V via USB, a battery made of two Li-lon or Li-Pol cells can be used.
In its current form, a single sensor EMG/MMG draws <0.4 mA (5 V) of current, while the entire system draws around 180 mA when powered by USB. This can be easily used to estimate power requirements in options of supply.
Program
In the microprocessor program, in addition to the function of data acquisition from the analog-to-digital converters and sending the results via USB port, IIR (Infinite Impulse Response) digital filters were implemented [
39,
40,
41]. The first of these filters is a DC filter. It was decided that the study use the simplest first-order filter with a transmittance function as follows:
which can be rewritten in the form of an iterative function:
where it was adopted arbitrarily that
α = 0.99. Thus,
y() and
x() represent output and input signals of the filter, respectively, and
n is the number of samples.
The second filter is a notch filter [
39,
40,
42,
43,
44] for power line hum frequencies of 50 Hz (or 60 Hz). Its transmittance function in Z-transform notation is as follows:
where
a1 =
b1 =
b3 = 1 is assumed. Such coefficients result in a slight variation from a transmittance from 0
dB in the pass band (less than 0.2
dB), which, however, does not affect the practical results of EMG signals but significantly reduces the computational effort of the procedures. The coefficients
b2,
a2, and
a3 are calculated from the formulas
where the sampling frequency
fs = 1388.889
sps and the power line frequency
f0 = 50
Hz (or 60
Hz), and
BW = 10
Hz is the bandwidth. The value
BW = 10
Hz was chosen arbitrarily. This value may be lower, but a reduction in power line frequency attenuation should be expected if the processor clock frequency is not stable (sampling frequency varies) or if the power line frequency deviates from 50 (60
Hz). While the processor’s clock frequency can be considered to be known fairly accurately thanks to the use of a crystal resonator, the power line frequency can vary depending on the supply and demand of electricity, the fluctuations of which are inevitable, especially currently when energy is generated from renewable sources such as photovoltaics and wind turbines.
Choosing a bandwidth of BW = 10
Hz means that for the power line frequency range from 49.95 Hz to 50.05 Hz, the attenuation of the unwanted signal will not be less than 40
dB. The second-order filter transmittance shown above (10) corresponds to the recursive formula
In both filters, i.e., the DC-filter and the notch filter, zero initial values were assumed.
The filters used add an additional signal acquisition delay of 3 sampling periods (1 for the DC filter and 2 for the notch filter). Therefore, the total delay from sampling to transmission start is 4 sampling periods (<3 ms). This is significantly less than the signal analysis and decision-making time in applications such as prostheses or human–machine interfaces.
4. Discussion
The aim of the project was to create a cheap and easy-to-use system for EMG/MMG signal testing, as well as to construct our own probe for later practical use, e.g., in prosthetics or as a human-machine interface, or for many other applications. The presented system has eight EMG/MMG sensors and meets all the above set objectives. The article presents a detailed analysis of the input noise in the front-end circuit, demonstrating that achieving low noise levels is not challenging for modern front-end designs, such as the AD8232 IC used in this study. Pre-eliminating power line noise can be achieved by traditional methods such as symmetrical signal and high CMRR of the preamplifier and designed in accordance with data sheet recommendations and EMC regulations. In addition, it is not necessary to use a notch filter in analog form. It can be replaced by a digital filter, which can be easily implemented in a microprocessor of moderate speed and price, such as the STM32H503. Of course, the prerequisite for using a digital filter is to limit the noise to below the saturation level of the analog part of the system, which is not difficult using traditional rules.
It should be emphasized that the presented solution meets the technical parameters of the gold standard for EMG recording: a high sampling frequency for accurate signal representation (1380
sps), signal filtering (e.g., band-pass filtering) to eliminate interference (5 Hz–300 Hz), and high electrode input impedance, which minimizes noise and motion artifacts (greater than 100 MΩ). The cost of the developed system prototype (
Figure 12) with eight EMG/MMG probes (with the option for 16 EMG probes) is less than
$200, covering electronics and assembly but excluding design costs. For comparison,
Table 1 provides a summary of several commercial systems currently available on the market that feature similar technical specifications. The comparison includes key parameters such as the number of recording channels, analog-to-digital resolution, signal sampling rate, intrinsic noise level, and the ability to acquire raw, unprocessed data. These factors are critical for evaluating the performance and applicability of each system in research. It is worth noting that the price of the described system is several times lower than that of commercial alternatives, aligning with the information published in [
10].
The presented system allows for easy collection of raw data from eight EMG/MMG probes using any computer equipped with a USB interface with a power consumption of 0.9 W. This interface provides both data transmission and power to the system. The limitation of the presented solution is the high sensitivity of MMG signals to external acoustic interference, which can be reduced in the future by additionally isolating the probes from the environment. Nevertheless, the system in its current form is fully capable, as demonstrated in studies [
45,
46] where the first prototype of the presented probes was used as a source of raw EMG/MMG signals under laboratory conditions. The above works are a prelude to the use of the presented system for building a hand prosthesis in which grips and wrist movements will be controlled by the non-amputated forearm muscles.
5. Conclusions
The EMG and MMG signal acquisition system presented in this paper provides a cost-effective alternative to commercial systems, maintaining comparable performance in terms of bandwidth, resolution, and noise level. The project involved developing a custom measurement probe and system using readily available and inexpensive components, including a biomedical measurement front-end integrated circuit, a MEMS microphone, two 8-channel 16-bit ADCs, and an STM32H5 microcontroller. The acquisition system works in real time, enabling immediate data collection via the ubiquitous USB interface. Electromagnetic interference, a common challenge in biomedical measurements, has been minimized by applying general EMC principles in combination with PCB design rules. Additional suppression of digital power line interference (hum) has been achieved by implementing a digital notch filter.
In the future, the personalized construction of the system presented in this paper will be used by authors to develop and test prosthetic hands controlled by signals from non-amputated muscles. This research will contribute to the development of new possibilities for practical applications in medicine, rehabilitation, prosthetics, and human–machine interfaces.