Ultra-Low-Power Digital Filtering for Insulated EMG Sensing

Myoelectric prostheses help amputees to regain independence and a higher quality of life. These prostheses are controlled by state-of-the-art electromyography sensors, which use a conductive connection to the skin and are therefore sensitive to sweat. They are applied with some pressure to ensure a conductive connection, which may result in pressure marks and can be problematic for patients with circulatory disorders, who constitute a major group of amputees. Here, we present ultra-low-power digital signal processing algorithms for an insulated EMG sensor which couples the EMG signal capacitively. These sensors require neither conductive connection to the skin nor electrolytic paste or skin preparation. Capacitive sensors allow straightforward application. However, they make a sophisticated signal amplification and noise suppression necessary. A low-cost sensor has been developed for real-time myoelectric prostheses control. The major hurdles in measuring the EMG are movement artifacts and external noise. We designed various digital filters to attenuate this noise. Optimal system setup and filter parameters for the trade-off between attenuation of this noise and sufficient EMG signal power for high signal quality were investigated. Additionally, an algorithm for movement artifact suppression, enabling robust application in real-world environments, is presented. The algorithms, which require minimal calculation resources and memory, are implemented on an ultra-low-power microcontroller.


Introduction
Electromyography (EMG) is the measurement of electrical potential arising from electrochemical effects due to muscle contractions. These signals are transmitted via human tissue to the surface of the skin, where they can be measured by surface EMG electrodes. Areas of application for these sensors include exoskeletons, diagnostics and myoelectric hand prostheses. The state-of-the-art electrodes in prostheses use a conductive connection to the skin [1][2][3]. Numerous EMG systems for myoelectric hand prostheses with various levels of dexterity have been previously presented [4][5][6]. However, in practice, many amputees reject such high-dexterity myoelectric prostheses because they require high cognitive effort [7]. Many patients prefer a basic hand prosthesis which is robust and easy to handle [8].
The algorithms which we present in this article are designed for a conventional myoelectric hand prosthesis with two EMG sensors and two degrees of freedom as provided by Otto Bock Healthcare Products GmbH [2].
In contrast to a conductive electrode, the insulated EMG sensor couples the muscle contraction signal from the skin to the sensor electronics capacitively. The signal quality in conductive sensing

Movement Artifacts
In biosignal measurement, low-frequency artifacts (i.e., movement artifacts) are predominantly in the range of 0-20 Hz [15,16]. Relative movements of the muscle to the EMG sensor generate these artifacts, for example, at the beginning and at the end of a contraction. In capacitive EMG sensors, changes in contact pressure change the capacitance between the signal source and the sensing electrode (i.e., the coupling capacitance) [11]. This leads to asymmetries in differential EMG sensor measurement and thus to movement artifacts, which can also result from movements of the cable connecting the electrode to the amplifier. Figure 2a shows a typical artifact in the time domain, measured with the EMG sensor described in Roland et al. [11] and Figure 2b shows a qualitative sketch in the frequency domain. The flexible design of the sensor assemblies reduces movement artifacts because they adapt to the human forearm anatomy. The capacitive measurement principle already leads to a highpass characteristic [11]. Additionally, we implemented a first-order highpass with a cutoff frequency of 11 Hz in the analog circuit. In this article, we evaluate the choice of the cutoff frequency for the digital highpass filter for capacitively coupled EMG. A good balance between maintaining the EMG signal power and damping the movement artifacts must be found.

Measurement Set-Up
The digital signal processing was designed for the insulated EMG measurement set-up described in Roland et al. [11] (Figure 3), which was applied for EMG signal acquisition in this work. Figure 4 shows the application of the measurement set-up to the human forearm, the EMG sensor and the printed circuit board.

Movement Artifacts
In biosignal measurement, low-frequency artifacts (i.e., movement artifacts) are predominantly in the range of 0-20 Hz [15,16]. Relative movements of the muscle to the EMG sensor generate these artifacts, for example, at the beginning and at the end of a contraction. In capacitive EMG sensors, changes in contact pressure change the capacitance between the signal source and the sensing electrode (i.e., the coupling capacitance) [11]. This leads to asymmetries in differential EMG sensor measurement and thus to movement artifacts, which can also result from movements of the cable connecting the electrode to the amplifier. Figure 2a shows a typical artifact in the time domain, measured with the EMG sensor described in Roland et al. [11] and Figure 2b shows a qualitative sketch in the frequency domain.

Movement Artifacts
In biosignal measurement, low-frequency artifacts (i.e., movement artifacts) are predominantly in the range of 0-20 Hz [15,16]. Relative movements of the muscle to the EMG sensor generate these artifacts, for example, at the beginning and at the end of a contraction. In capacitive EMG sensors, changes in contact pressure change the capacitance between the signal source and the sensing electrode (i.e., the coupling capacitance) [11]. This leads to asymmetries in differential EMG sensor measurement and thus to movement artifacts, which can also result from movements of the cable connecting the electrode to the amplifier. Figure 2a shows a typical artifact in the time domain, measured with the EMG sensor described in Roland et al. [11] and Figure 2b shows a qualitative sketch in the frequency domain. The flexible design of the sensor assemblies reduces movement artifacts because they adapt to the human forearm anatomy. The capacitive measurement principle already leads to a highpass characteristic [11]. Additionally, we implemented a first-order highpass with a cutoff frequency of 11 Hz in the analog circuit. In this article, we evaluate the choice of the cutoff frequency for the digital highpass filter for capacitively coupled EMG. A good balance between maintaining the EMG signal power and damping the movement artifacts must be found.

Measurement Set-Up
The digital signal processing was designed for the insulated EMG measurement set-up described in Roland et al. [11] (Figure 3), which was applied for EMG signal acquisition in this work. Figure 4 shows the application of the measurement set-up to the human forearm, the EMG sensor and the printed circuit board. The flexible design of the sensor assemblies reduces movement artifacts because they adapt to the human forearm anatomy. The capacitive measurement principle already leads to a highpass characteristic [11]. Additionally, we implemented a first-order highpass with a cutoff frequency of 11 Hz in the analog circuit. In this article, we evaluate the choice of the cutoff frequency for the digital highpass filter for capacitively coupled EMG. A good balance between maintaining the EMG signal power and damping the movement artifacts must be found.

Measurement Set-Up
The digital signal processing was designed for the insulated EMG measurement set-up described in Roland et al. [11] (Figure 3), which was applied for EMG signal acquisition in this work. Figure 4 shows the application of the measurement set-up to the human forearm, the EMG sensor and the printed circuit board.  Figure 3. Block diagram outlining the insulated EMG measurement set-up. First, the EMG signal coupled from the human body is amplified and filtered by the analog circuit. In the µC, the signal is then digitally filtered and provided at the sensor system output.

Interface to Human Body
Due to the insulating layer, the flexible sensing electrode has no conductive connection to the skin. This sensor is a multilayer construct made of textiles, foils or a flex circuit board. In this work, the measurements were performed with the foil sensor. The sensor area is shielded with a common-mode shield to increase the common-mode rejection ratio and to protect against noise from the environment. A small conductive reference made of textile connects the sensor electronics to the electrical potential of the body. This reference keeps the common-mode potential of the sensor input amplifier within operating range.
For the measurements presented in this article, the EMG sensor was placed at the musculus extensor digitorum, at one third of the distance between the epicondylus lateralis and the ulna. This muscle was selected for the experiments as a large proportion of upper-limb amputations are at trans-radial level or are farther distal [25][26][27][28].

Analog Circuit
The analog signal, which is coupled via the EMG sensing electrode, is amplified by the instrumentation amplifier by a gain of 26. The bandpass is formed by a first-order analog highpass and lowpass filter. The highpass has a cutoff frequency of 11 Hz to attenuate the low-frequency noise, and the lowpass has a cutoff frequency of 1064 Hz to filter the high-frequency noise. The signal is further amplified by the µC's internal operational amplifiers (OpAmps) by software-programmable gain. This gain factor is varied to exploit the full operating range at the ADC input. For this work, the gain of the internal OpAmps was varied in the range of 4 to 128, depending on the experiment (noise for comb measurements 128, EMG signal and noise for signal to noise ratio measurements 128, EMG for highpass measurements 32, EMG for comb measurements 16, artifacts for highpass measurements 4) [11]. . Block diagram outlining the insulated EMG measurement set-up. First, the EMG signal coupled from the human body is amplified and filtered by the analog circuit. In the µC, the signal is then digitally filtered and provided at the sensor system output.  Figure 3. Block diagram outlining the insulated EMG measurement set-up. First, the EMG signal coupled from the human body is amplified and filtered by the analog circuit. In the µC, the signal is then digitally filtered and provided at the sensor system output.

Interface to Human Body
Due to the insulating layer, the flexible sensing electrode has no conductive connection to the skin. This sensor is a multilayer construct made of textiles, foils or a flex circuit board. In this work, the measurements were performed with the foil sensor. The sensor area is shielded with a common-mode shield to increase the common-mode rejection ratio and to protect against noise from the environment. A small conductive reference made of textile connects the sensor electronics to the electrical potential of the body. This reference keeps the common-mode potential of the sensor input amplifier within operating range.
For the measurements presented in this article, the EMG sensor was placed at the musculus extensor digitorum, at one third of the distance between the epicondylus lateralis and the ulna. This muscle was selected for the experiments as a large proportion of upper-limb amputations are at trans-radial level or are farther distal [25][26][27][28].

Analog Circuit
The analog signal, which is coupled via the EMG sensing electrode, is amplified by the instrumentation amplifier by a gain of 26. The bandpass is formed by a first-order analog highpass and lowpass filter. The highpass has a cutoff frequency of 11 Hz to attenuate the low-frequency noise, and the lowpass has a cutoff frequency of 1064 Hz to filter the high-frequency noise. The signal is further amplified by the µC's internal operational amplifiers (OpAmps) by software-programmable gain. This gain factor is varied to exploit the full operating range at the ADC input. For this work, the gain of the internal OpAmps was varied in the range of 4 to 128, depending on the experiment (noise for comb measurements 128, EMG signal and noise for signal to noise ratio measurements 128, EMG for highpass measurements 32, EMG for comb measurements 16, artifacts for highpass measurements 4) [11].

Interface to Human Body
Due to the insulating layer, the flexible sensing electrode has no conductive connection to the skin. This sensor is a multilayer construct made of textiles, foils or a flex circuit board. In this work, the measurements were performed with the foil sensor. The sensor area is shielded with a common-mode shield to increase the common-mode rejection ratio and to protect against noise from the environment. A small conductive reference made of textile connects the sensor electronics to the electrical potential of the body. This reference keeps the common-mode potential of the sensor input amplifier within operating range.
For the measurements presented in this article, the EMG sensor was placed at the musculus extensor digitorum, at one third of the distance between the epicondylus lateralis and the ulna. This muscle was selected for the experiments as a large proportion of upper-limb amputations are at trans-radial level or are farther distal [25][26][27][28].

Analog Circuit
The analog signal, which is coupled via the EMG sensing electrode, is amplified by the instrumentation amplifier by a gain of 26. The bandpass is formed by a first-order analog highpass and lowpass filter. The highpass has a cutoff frequency of 11 Hz to attenuate the low-frequency noise, and the lowpass has a cutoff frequency of 1064 Hz to filter the high-frequency noise. The signal is further amplified by the µC's internal operational amplifiers (OpAmps) by software-programmable gain. This gain factor is varied to exploit the full operating range at the ADC input. For this work, the gain of the internal OpAmps was varied in the range of 4 to 128, depending on the experiment (noise for comb measurements 128, EMG signal and noise for signal to noise ratio measurements 128, EMG for highpass measurements 32, EMG for comb measurements 16, artifacts for highpass measurements 4) [11].

Analog-to-Digital Conversion (ADC)
The ADC samples and converts analog signals to digital values. The embedded ADC is configured to extend the default 12-bit resolution by accumulation and averaging to 16 bits. When accumulating 64 samples, the result is right-shifted automatically by two bits to fit the 16-bit register size. To this end, the resolution was increased from 12-to 16-bit precision and noise performance was improved by averaging four samples. In order to be deterministic and synchronous with the digital signal processing (DSP), the ADC result is read and a new ADC conversion is started by the Timer/Counter TC0 callback routine as described in Section 3.4.1.

Digital Signal Processing (DSP)
For DSP, we employed the ATSAML21E18B [29] from Microchip Technology Inc. (Chandler, AZ, USA) This is an ultra-low-power µC with a 32 bit ARM R Cortex R -M0+ processor with a maximum clock frequency of 48 MHz, 256 kB flash and 32 kB SRAM main memory. For our insulated EMG sensor, the 32 pin version was selected for easy prototyping of the circuit board. In the test set-up, the clock frequency was set in the range of 2 MHz-48 MHz. The controller has a 32 bit hardware multiplier, but no hardware divider and no floating-point unit on board. Figure 5 shows a block diagram of the DSP path. A previous version of the digital EMG signal processing with an ATSAML21 was published by Roland et al. [30].

Analog-to-Digital Conversion (ADC)
The ADC samples and converts analog signals to digital values. The embedded ADC is configured to extend the default 12-bit resolution by accumulation and averaging to 16 bits. When accumulating 64 samples, the result is right-shifted automatically by two bits to fit the 16-bit register size. To this end, the resolution was increased from 12-to 16-bit precision and noise performance was improved by averaging four samples. In order to be deterministic and synchronous with the digital signal processing (DSP), the ADC result is read and a new ADC conversion is started by the Timer/Counter TC0 callback routine as described in Section 3.4.1.

Digital Signal Processing (DSP)
For DSP, we employed the ATSAML21E18B [29] from Microchip Technology Inc. (Chandler, AZ, USA) This is an ultra-low-power µC with a 32 bit ARM R Cortex R -M0+ processor with a maximum clock frequency of 48 MHz, 256 kB flash and 32 kB SRAM main memory. For our insulated EMG sensor, the 32 pin version was selected for easy prototyping of the circuit board. In the test set-up, the clock frequency was set in the range of 2 MHz-48 MHz. The controller has a 32 bit hardware multiplier, but no hardware divider and no floating-point unit on board. Figure 5 shows a block diagram of the DSP path. A previous version of the digital EMG signal processing with an ATSAML21 was published by Roland et al. [30].  Figure 5. Block diagram of the DSP path, 50 Hz comb filter followed by a highpass, a lowpass and a decision algorithm that handles the movement artifacts. Rectification and smoothing are required for controlling the prosthesis drive. For experiments, the signal can also be connected to an oscilloscope via the digital-to-analog converter (DAC) or transmitted via the Bluetooth Low Energy (BLE) module.

Cyclic Program Processing
Deterministic and cyclic program processing for the DSP functionality is realized by a timer interrupt. The onboard Timer/Counter TC0 is configured to invoke a callback routine, which executes the DSP algorithm. This cycle defines the DSP sampling rate f S .
Larivière et al. [31] and Li et al. [32] state that a sampling frequency of 400-500 Hz is sufficient for EMG measurement. In contrast, Enderle [33] suggests to sample the measurement signal at frequencies at at least ten times the highest signal frequency. High signal quality was desired to evaluate the optimal filter parameters, therefore, the EMG sampling rate f S was chosen at 10 kHz in this work. A high sampling frequency avoids the reflection of high frequency noise, which is not sufficiently attenuated by the anti-aliasing filter, to the EMG frequency range. The proposed filter architectures and cutoff frequencies can correspondingly be applied at lower sampling rates, which allows a reduction of the clock frequency. In Section 4.8, we show the effects of reducing the sampling frequency.

Fixed-Point Representation
q15_t, q31_t and q63_t are standard data types for fixed-point representation in C. Fixed-points, as described by ARM Ltd. (Cambridge, UK) [34], are implemented for the DSP. They resemble an integer data type, and their bit pattern must be used correctly. The coefficients are multiplied by quantization factors for correct scaling of the fixed-point values. Calculations with standard Q1.15 Figure 5. Block diagram of the DSP path, 50 Hz comb filter followed by a highpass, a lowpass and a decision algorithm that handles the movement artifacts. Rectification and smoothing are required for controlling the prosthesis drive. For experiments, the signal can also be connected to an oscilloscope via the digital-to-analog converter (DAC) or transmitted via the Bluetooth Low Energy (BLE) module.

Cyclic Program Processing
Deterministic and cyclic program processing for the DSP functionality is realized by a timer interrupt. The onboard Timer/Counter TC0 is configured to invoke a callback routine, which executes the DSP algorithm. This cycle defines the DSP sampling rate f S .
Larivière et al. [31] and Li et al. [32] state that a sampling frequency of 400-500 Hz is sufficient for EMG measurement. In contrast, Enderle [33] suggests to sample the measurement signal at frequencies at at least ten times the highest signal frequency. High signal quality was desired to evaluate the optimal filter parameters, therefore, the EMG sampling rate f S was chosen at 10 kHz in this work. A high sampling frequency avoids the reflection of high frequency noise, which is not sufficiently attenuated by the anti-aliasing filter, to the EMG frequency range. The proposed filter architectures and cutoff frequencies can correspondingly be applied at lower sampling rates, which allows a reduction of the clock frequency. In Section 4.8, we show the effects of reducing the sampling frequency.

Fixed-Point Representation
q15_t, q31_t and q63_t are standard data types for fixed-point representation in C. Fixed-points, as described by ARM Ltd. (Cambridge, UK) [34], are implemented for the DSP. They resemble an integer data type, and their bit pattern must be used correctly. The coefficients are multiplied by quantization factors for correct scaling of the fixed-point values. Calculations with standard Q1.15 variables result in fixed-points with deviating bit pattern; for instance, a Q2.15 is generated when two Q1.15 variables are added. Therefore, the programmer must implement the data type with the correct bit pattern while considering truncation and overflow or saturation.
The numerical values must be scaled such that the full operating range is exploited while overflows are prevented. When calculating with fixed-point data type, the µC processor uses integer numbers, and thus the high performance of the integrated single-cycle hardware multiplier of the 32 bit ARM processor can be exploited. Quantization and overflows are taken into account in the filter design. To ensure stability after quantization, the poles of the quantized coefficients were investigated.

Comb Filter
The comb filter was designed as a highpass filter with a sampling frequency of 50 Hz, which is the frequency to be filtered f filt . The amplitude spectrum is mirrored at f filt /2 according to the Nyquist-Shannon sampling theorem [21] and it is identical at its harmonics, which leads to a comb filter behavior. The name of the comb filter (1-7 Hz) is derived from the highpass cutoff frequency f C used to design the filter. Accordingly, the comb filter cutoff frequencies around 50 Hz are in the range of 43-49 Hz and 51-57 Hz. This frequency characteristic is replicated at the harmonics of 50 Hz.
In this work, we considered applying Bessel [35], Butterworth [36], Chebyshev [37] and Elliptic [38] filters. Butterworth and Chebyshev filters were implemented, as they provide a good balance between low ringing and overshoot and a steep roll-off. The Bessel and the Elliptic filters were not implemented because the former has low roll-off and the latter tends to ring and overshoot.
The filter was designed with the Matlab R FDA filter tool [39] by first determining the filter zeros, poles and gain for an analog lowpass. These were then transformed into state-space form, where the lowpass can be converted to the desired filter behavior, such as highpass, bandpass or bandstop. By bilinear transformation [40], the analog filter was transformed into a digital filter and then converted back to zero-pole gain form. The filter coefficients determined were floating-point numbers (Table 1). Additionally, a third-order finite impulse response (FIR) filter which enables fast calculation was implemented for comparison. To this end, the frequency-independent scaling due to the filters was compensated for equal passband amplification. However, in the final implementation, this scaling does not need to be compensated at this point as long as the signal remains within value range of the fixed-point variable. Table 1. Floating-point comb filter coefficients.

Filter a[0] a[200] a[400] a[600] b[0] b[200] b[400] b[600]
1 Hz Che The filter frequency f f ilt = 50 Hz corresponds to a 20 ms time period, which equals 200 samples at the EMG signal sampling rate f S = 10 kHz. Figure 6 shows the transfer function which considers the quantization effects.

Comb Filter Evaluation
For the comb evaluation, various comb filters were implemented on the µC and assessed in a standardized scenario. Two test subjects were measured three times each with contracted and relaxed muscle. The measurements were repeated for all comb implementations. The amplitude at the DAC, to which the highpass output was applied, was measured with an oscilloscope at a 10 kHz sampling rate. These measurements were examined for the ability to attenuate PLI while maintaining EMG signal power.

Comb Filter Implementation
The comb filter was implemented in C as an infinite impulse response (IIR) filter in direct form II (Figure 7), for which only one center array was required. The center array, with length = 200 f ilterorder + 1, is a ring buffer [41], so the entries do not need to be shifted at each iteration. For addressing the ring buffer, a pointer array with a length of f ilterorder + 1 is implemented.
This IIR filter has coefficients in a Q2.10 format, and they are implemented as a 16-bit fixed-point in Q6.10 format. The input has Q1.15 format. The coefficients and the input signal are multiplied. This intermediate result is stored in a 64-bit internal accumulator in Q39.25 format. Additions can therefore be executed without the risk of overflows while preserving full precision. The resulting center in Q5. 25 format is then right-shifted by 10 bits, thus removing the least significant bits, and stored in a 32 bit fixed-point in Q17.15 format. The center for the second-order filters is calculated by 10. (2)

Comb Filter Evaluation
For the comb evaluation, various comb filters were implemented on the µC and assessed in a standardized scenario. Two test subjects were measured three times each with contracted and relaxed muscle. The measurements were repeated for all comb implementations. The amplitude at the DAC, to which the highpass output was applied, was measured with an oscilloscope at a 10 kHz sampling rate. These measurements were examined for the ability to attenuate PLI while maintaining EMG signal power.

Comb Filter Implementation
The comb filter was implemented in C as an infinite impulse response (IIR) filter in direct form II (Figure 7), for which only one center array was required. The center array, with length = 200 f ilterorder + 1, is a ring buffer [41], so the entries do not need to be shifted at each iteration. For addressing the ring buffer, a pointer array with a length of f ilterorder + 1 is implemented.
This IIR filter has coefficients in a Q2.10 format, and they are implemented as a 16-bit fixed-point in Q6.10 format. The input has Q1.15 format. The coefficients and the input signal are multiplied. This intermediate result is stored in a 64-bit internal accumulator in Q39.25 format. Additions can therefore be executed without the risk of overflows while preserving full precision. The resulting center in Q5.25 format is then right-shifted by 10 bits, thus removing the least significant bits, and stored in a 32 bit fixed-point in Q17.15 format. The center for the second-order filters is calculated by In the next step, the output is calculated from the 32-bit (Q17.15 format) center array by multiplications with the Q2.10 format coefficients. Again, a 64 bit internal accumulator eliminates the risk of overflows and preserves full precision. When these Q7.25 fixed-points are added up three times, a Q9.25 format is generated. This intermediate result is truncated again by removing the 10 least significant bits and generating a Q9.15 format. This is saturated to a Q1.15, which does not affect the contraction EMG, as it does not exceed the value range of the fixed-point variable; however, artifacts might exceed the value range. The Q1.15 output, which is stored as a 16 bit fixed-point variable, is calculated by Sensors 2019, 19, 1 9 of 24 In the next step, the output is calculated from the 32-bit (Q17.15 format) center array by multiplications with the Q2.10 format coefficients. Again, a 64 bit internal accumulator eliminates the risk of overflows and preserves full precision. When these Q7.25 fixed-points are added up three times, a Q9.25 format is generated. This intermediate result is truncated again by removing the 10 least significant bits and generating a Q9.15 format. This is saturated to a Q1.15, which does not affect the contraction EMG, as it does not exceed the value range of the fixed-point variable; however, artifacts might exceed the value range. The Q1.15 output, which is stored as a 16 bit fixed-point variable, is calculated by

Comb Filter Runtime
The runtime of the comb filter was measured with an oscilloscope [42]. For this purpose, only the comb filter function was implemented; its start and end are indicated by a digital output signal change.

Highpass Filter
The highpass filter attenuates low-frequency artifacts, which are described in Section 2.4. We evaluated which filter characteristics are appropriate for insulated EMG sensors. To this end, we designed second-order Chebyshev and Butterworth IIR filters. The sampling frequency f S was set to 10 kHz and the cutoff frequency f C varied from 20 Hz to 100 Hz with a 10 Hz iteration, which resulted in the coefficients listed in Table 2.
The numerators for all highpass filters are: As these coefficients are implemented in fixed-point format, the denominators and numerators are scaled and truncated. Figure 8 shows the transfer function for the highpass with the quantized coefficients: Signal flow graph of a second-order IIR direct form II filter realization, with the numerators b and the denominators a. Only one storage array, center, is required.

Comb Filter Runtime
The runtime of the comb filter was measured with an oscilloscope [42]. For this purpose, only the comb filter function was implemented; its start and end are indicated by a digital output signal change.

Highpass Filter
The highpass filter attenuates low-frequency artifacts, which are described in Section 2.4. We evaluated which filter characteristics are appropriate for insulated EMG sensors. To this end, we designed second-order Chebyshev and Butterworth IIR filters. The sampling frequency f S was set to 10 kHz and the cutoff frequency f C varied from 20 Hz to 100 Hz with a 10 Hz iteration, which resulted in the coefficients listed in Table 2.
The numerators for all highpass filters are: As these coefficients are implemented in fixed-point format, the denominators and numerators are scaled and truncated. Figure 8 shows the transfer function for the highpass with the quantized coefficients:

Highpass Filter Evaluation
To determine the optimal choice of filter characteristic and f C , we recorded EMG signals from three subjects both at the left and at the right arm. A 50 Hz comb filter was implemented at the µC for the measurements, but no highpass filter was implemented for the evaluation. Three contraction and three artifact signals were recorded at each arm of each subject. Each measurement lasted 10 s, but only 8 s were evaluated because the on-set of the contraction was not considered. The artifacts were created by mechanical interferences, which might occur in real-world environments, such as tapping, shifting or lifting of the sensor. By using these artifacts for the filter parameter evaluation, the resulting system will be robust against this noise. The entire 10 s of the artifacts were evaluated. The oscilloscope [42] was set to a sampling rate of 10 kHz.
The evaluation was performed in Matlab R [39]. To this end, the filtering was carried out such that the µC implementation was represented. The coefficients, the measurement values, the intermediate results and the final results were quantized and truncated as in the controller. Furthermore, the limits of the variable sizes were considered in the filtering to prevent overflows.
Based on the root mean square value, we calculated the signal loss in % for all the contraction EMG and the artifact measurements for the different filters. The differences between artifact-and EMG signal losses were calculated, as the maximum value indicates an optimal trade-off.

Highpass Filter Evaluation
To determine the optimal choice of filter characteristic and f C , we recorded EMG signals from three subjects both at the left and at the right arm. A 50 Hz comb filter was implemented at the µC for the measurements, but no highpass filter was implemented for the evaluation. Three contraction and three artifact signals were recorded at each arm of each subject. Each measurement lasted 10 s, but only 8 s were evaluated because the on-set of the contraction was not considered. The artifacts were created by mechanical interferences, which might occur in real-world environments, such as tapping, shifting or lifting of the sensor. By using these artifacts for the filter parameter evaluation, the resulting system will be robust against this noise. The entire 10 s of the artifacts were evaluated. The oscilloscope [42] was set to a sampling rate of 10 kHz.
The evaluation was performed in Matlab R [39]. To this end, the filtering was carried out such that the µC implementation was represented. The coefficients, the measurement values, the intermediate results and the final results were quantized and truncated as in the controller. Furthermore, the limits of the variable sizes were considered in the filtering to prevent overflows.
Based on the root mean square value, we calculated the signal loss in % for all the contraction EMG and the artifact measurements for the different filters. The differences between artifact-and EMG signal losses were calculated, as the maximum value indicates an optimal trade-off.
The EMG signal was evaluated in the frequency range from 40 to 600 Hz to consider contraction EMG power, but no low-frequency noise. The choice of the 600 Hz had a negligible impact on the results as long as it exceeded the main EMG power frequency range.

Highpass Filter Implementation
The highpass with the maximum difference between artifact signal loss and EMG signal loss was implemented in direct form II (Figure 7) at the µC. The bit pattern of the fixed-point data type of the input, coefficients, intermediate results and output is equivalent to the comb filter implementation in Section 3.4.5. The implementation was done according to Highpass Filter Runtime The highpass filter runtime was calculated in the same way as the comb filter runtime (see Section "Comb Filter Runtime").

Lowpass Filter
Two lowpass filters are applied in the DSP. One eliminates the high frequency noise after the highpass, and the other one is applied for smoothing to get a DC output signal, which is proportional to the muscle contraction intensity to control the prosthesis drive.
We designed a first-order IIR filter (first-order lag element) with the transfer function: with the input U[z] and the output Y[z]. This lowpass filter was designed such that it requires only one storage variable. Therefore, the filter coefficients are described with the parameter c as follows: The coefficients a [1] and b[0] are selected with equivalent absolute values to facilitate the calculation, as only one multiplication is required: with the preliminary output y[k], the input u[k] and c as the coefficient.
The behavior of first-order lag elements is adapted by the time constant T or the cutoff frequency f C , which relate to the parameter c at this lowpass as follows: Hence, the coefficient c is calculated according to: with the sampling time The filter introduces a scaling which is compensated for by a shift of the preliminary output before being passed to the next signal processing stage: pass Filter Implementation For the µC implementation, the preliminary output y[k] was calculated according to Equation ( ly one addition, multiplication and shift are required at each sample. The preliminary output y[k] was implemented as a 64-bit fixed-point variable in C. The input u .15) and the coefficient c (Q1.10) were implemented as 16-bit fixed-point variables. The resul t-shifted by 10 bits at each sample step, thus removing the 10 least significant bits. The lowp put LP OUT [k] is implemented as a Q1.15 variable.
In the lowpass filter after the highpass, no saturation was implemented for y[k] and LP OUT ce the EMG signal is distributed across the operating range (no clipping) and therefore does n se overflows. For artifacts, which may cause clipping at the limits of the value range, overflo

Lowpass Filter Implementation
For the µC implementation, the preliminary output y[k] was calculated according to Equation (11). Only one addition, multiplication and shift are required at each sample.
The preliminary output y[k] was implemented as a 64-bit fixed-point variable in C. The input u[k] (Q1.15) and the coefficient c (Q1.10) were implemented as 16-bit fixed-point variables. The result is right-shifted by 10 bits at each sample step, thus removing the 10 least significant bits. The lowpass output LP OUT [k] is implemented as a Q1.15 variable.
In the lowpass filter after the highpass, no saturation was implemented for y[k] and LP OUT [k], since the EMG signal is distributed across the operating range (no clipping) and therefore does not cause overflows. For artifacts, which may cause clipping at the limits of the value range, overflows may occur. As the prosthesis drive is turned off for artifacts in any case, these overflows are tolerated.
For filtering the signal after the highpass filter, f C was set to 531 Hz, which results in a c of 0.75. y[k] was right-shifted by one bit to calculate the output LP OUT [k]. In the lowpass for smoothing, the f C was set to 3.1 Hz (c = 0.9981) and the signal was right-shifted by eight bits.

Lowpass Filter Runtime
The measurement of the runtime is described in Section "Comb Filter Runtime". The runtime of (i) the described lowpass filter with fixed-point data type was compared to (ii) an implementation with fixed-point data type in direct form II (Figure 7) and (iii) an implementation with floating-point data type in direct form II.
(i) A first-order IIR filter with fixed-point data type as designed in Section 3.4.7.
(ii) A first-order IIR filter was implemented with fixed-point coefficients in direct form II (Figure 7) for a cutoff frequency f C of 3.1 Hz. In contrast to the presented architecture, this implementation requires more arithmetic steps. The center is a 32-bit array and the coefficients, input and output are 16-bit fixed-point variables.
(iii) For the floating-point implementation, a first-order IIR filter was designed and implemented in C. The f C was set to 3.1 Hz, which is equivalent to the smoothing f C . The input, the coefficients, the center array of the direct form II implementation and the output are 32-bit floating-point numbers (float32_t). The value range of the variables was chosen such that overflows are prevented.
(iv) Additionally, a FIR filter with floating-point coefficients (float32_t) was designed and implemented in C. The input, center array and output are also in 32-bit floating-point format. The filter wase designed with order 5, and the f C was set to 3.1 Hz.
(v) Same filter as (iv) with filter order 8. The floating-point filters are not described in more detail, as they were implemented only for the runtime comparison.

Rectification and Smoothing
The EMG signal is rectified and smoothed to control the prosthesis drive. Linear rectification rect out,linear [k] = abs(rect in [k]) (18) and squared rectification were considered in this work. A combination of these two would be possible to combine their behavior, but, due to its higher calculation effort, it was not implemented. After rectification, the signal is limited to prevent overflows and keep the signal within a defined operating range. Due to this limit, the signal returns faster to amplitudes below the activation threshold after a contraction.
Smoothing is achieved with the lowpass filter ( f C = 3.1 Hz) as described in Section 3.4.7.
After smoothing, the signal is right-shifted by eight bits. An offset of 113 is added, which corresponds to 91 mV. The output signal to the prosthesis drive will be proportional to the muscle contraction as described in the Introduction.

Rectification and Smoothing Runtime
For the runtime calculation, see Section "Comb Filter Runtime".

Decision Algorithm
The decision algorithm is not considered in detail in this article, as it has already been described by Roland et al. [23].
Prostheses drive activation by movement artifacts that have not been filtered sufficiently by the highpass is one of the major problems in myoelectric prosthesis control. This has to be avoided to the greatest feasible extent. For this reason, a real-time decision algorithm was implemented. The short-time Fourier transform (STFT) of signal windows is calculated in the µC; these windows overlap in time for fast decisions by the algorithm. A compromise between good frequency and good time resolution must be found. Narrow STFT windows lead to a good time resolution but poor frequency resolution, and vice versa. The algorithm decides whether the signal is an artifact or a contraction, which results in disabling or activation of the prosthesis drive. The amplitude spectrum of a reference contraction is determined by an automatic calibration procedure and stored in the non-volatile memory on the µC. Frequency bands of the current STFT signal are compared with the reference amplitude spectrum. The difference between reference and current signal is calculated for each frequency band, and then the sum of these differences over the frequency bands is computed (gray area in Figure 10). When this sum exceeds a predefined threshold, the prosthesis drive is disabled to avoid erroneous activation. non-volatile memory on the µC. Frequency bands of the current STFT signal are compared with the reference amplitude spectrum. The difference between reference and current signal is calculated for each frequency band, and then the sum of these differences over the frequency bands is computed (gray area in Figure 10). When this sum exceeds a predefined threshold, the prosthesis drive is disabled to avoid erroneous activation.

Output
For evaluation of the measurement set-up, the digitally filtered signal can be measured at the DAC with an oscilloscope [42], or the digital signal can be transmitted to a PC via Bluetooth Low Energy (BLE). In real-world applications, the filtered, rectified and smoothed signal is passed on to the prosthesis drive via the 12-bit digital-to-analog converter (DAC). The DAC is configured to use the analog supply voltage as internal reference voltage resulting in a conversion range between ground (0 V) and analog supply voltage (3.3 V). A new conversion starts as soon as a new value is loaded into the DAC data register and takes 24 clock cycles.

Signal Quality Dependent on DSP Sampling Frequency
Above, the filter evaluation was carried out at a 10 kHz DSP sampling frequency. In order to assess the influence on the signal quality and power consumption, the DSP sampling frequency was varied in the range from 500 Hz up to 10 kHz. The ADC settings remained unchanged throughout all measurements, and 64 ADC samples were measured per DSP sampling period (t S = 1/ f S ). The system clock frequency as well as the DSP sampling frequency were modified according to Section 4.8. The filter parameters were adjusted to the respective DSP sampling frequency. The signal used for the calculation of the SNR was measured with the subjects compressing an adjustable hand grip exerciser allowing an adjustable tension at 20% of the MVC to avoid fatigue from influencing the measurements. Additionally, the subjects took sufficient rest periods and the order of the measurements was inverted for the second subject. The noise level was measured at the relaxed muscle. Two subjects were measured with five sampling frequencies and each measurement was conducted three times. The signal was measured for 5 s with the oscilloscope [42] at a sampling frequency of 20 kHz. The insulated EMG sensor was placed above the flexor carpi radialis and the measurement was started after the onset of the muscle contraction. In the measurements, the implemented notch, highpass and lowpass filters were activated.

Output
For evaluation of the measurement set-up, the digitally filtered signal can be measured at the DAC with an oscilloscope [42], or the digital signal can be transmitted to a PC via Bluetooth Low Energy (BLE). In real-world applications, the filtered, rectified and smoothed signal is passed on to the prosthesis drive via the 12-bit digital-to-analog converter (DAC). The DAC is configured to use the analog supply voltage as internal reference voltage resulting in a conversion range between ground (0 V) and analog supply voltage (3.3 V). A new conversion starts as soon as a new value is loaded into the DAC data register and takes 24 clock cycles.

Signal Quality Dependent on DSP Sampling Frequency
Above, the filter evaluation was carried out at a 10 kHz DSP sampling frequency. In order to assess the influence on the signal quality and power consumption, the DSP sampling frequency was varied in the range from 500 Hz up to 10 kHz. The ADC settings remained unchanged throughout all measurements, and 64 ADC samples were measured per DSP sampling period (t S = 1/ f S ). The system clock frequency as well as the DSP sampling frequency were modified according to Section 4.8. The filter parameters were adjusted to the respective DSP sampling frequency. The signal used for the calculation of the SNR was measured with the subjects compressing an adjustable hand grip exerciser allowing an adjustable tension at 20% of the MVC to avoid fatigue from influencing the measurements. Additionally, the subjects took sufficient rest periods and the order of the measurements was inverted for the second subject. The noise level was measured at the relaxed muscle. Two subjects were measured with five sampling frequencies and each measurement was conducted three times. The signal was measured for 5 s with the oscilloscope [42] at a sampling frequency of 20 kHz. The insulated EMG sensor was placed above the flexor carpi radialis and the measurement was started after the onset of the muscle contraction. In the measurements, the implemented notch, highpass and lowpass filters were activated.

Results
The DSP runtime is significantly reduced by designing the filters particularly for real-time, ultra-low-power applications. No floating-point units and no divisions were implemented, and the number of calculations was minimized for minimal calculation effort. These algorithms were implemented on a low-cost µC.
The final measurement system features IIR filters, as they are more efficient regarding runtime and memory consumption than FIR filters. They can be realized with low filter order, and their delay is negligible. Their parametrization, stability, effect of quantization and runtime were investigated. Figure 11 shows the measurement results of the comb filter implementations. For the Butterworth filter with 1 Hz cutoff frequency f C and for the third-order FIR filter, a peak remains at the PLI frequency. This type of filter has a high filter quality and a steep slope ( Figure 6) but does not filter the PLI sufficiently. This is explained by the deviating power-line frequency, which makes a broader comb filter stop-band necessary.

Comb Filter
The 5 Hz Butterworth implementation was selected because it provides sufficient PLI filtering and it is insensitive to deviations of the power-line frequency. The Butterworth implementation is preferred over the Chebyshev implementation because it exhibits less overshoot and ringing. The Chebyshev has high gain at the edges of the passband, which has an adverse effect at power-line frequency fluctuations. With the 5 Hz f C filter, more EMG signal power is preserved than with the 7 Hz f C filter. the number of calculations was minimized for minimal calculation effort. These algorithms were implemented on a low-cost µC. The final measurement system features IIR filters, as they are more efficient regarding runtime and memory consumption than FIR filters. They can be realized with low filter order, and their delay is negligible. Their parametrization, stability, effect of quantization and runtime were investigated. Figure 11 shows the measurement results of the comb filter implementations. For the Butterworth filter with 1 Hz cutoff frequency f C and for the third-order FIR filter, a peak remains at the PLI frequency. This type of filter has a high filter quality and a steep slope ( Figure 6) but does not filter the PLI sufficiently. This is explained by the deviating power-line frequency, which makes a broader comb filter stop-band necessary.

Comb Filter
The 5 Hz Butterworth implementation was selected because it provides sufficient PLI filtering and it is insensitive to deviations of the power-line frequency. The Butterworth implementation is preferred over the Chebyshev implementation because it exhibits less overshoot and ringing. The Chebyshev has high gain at the edges of the passband, which has an adverse effect at power-line frequency fluctuations. With the 5 Hz f C filter, more EMG signal power is preserved than with the 7 Hz f C filter.

Comb Filter Stability
The poles are listed in Table 3 and plotted in Figure 12 to illustrate the filter stability. All filters are stable, as the absolute value is <1 in all implementations. For FIR filters, stability is given in all

Comb Filter Stability
The poles are listed in Table 3 and plotted in Figure 12 to illustrate the filter stability. All filters are stable, as the absolute value is <1 in all implementations. For FIR filters, stability is given in all cases. For IIR filters, poles closer to the origin of the unit circle are preferred in the implementation because oscillations abate more rapidly. The selected 5 Hz Butterworth comb filter fully meets the stability requirements.  Chebyshev 0.914 ± 0.119i 0.723 ± 0.310i 0.527 ± 0.435i 0.335 ± 0.511i Butterworth 0.912 ± 0.077i 0.738 ± 0.206i 0.572 ± 0.292i 0.413 ± 0.352i

Lowpass Filter
In this section, the parametrization of the lowpass filter, which is applied after the highpass filter, is evaluated. For the smoothing lowpass, the architecture, runtime and implementation are equivalent to the filter described in this section, and its parametrization is described in Section 3.4.8.
The lowpass after the highpass filter has the time constant T = 300 µs and the cutoff frequency f C = 531 Hz. A higher f C does not sufficiently filter the high-frequency edges of the quantizations, and a lower f C would markedly attenuate the EMG signal.

Lowpass Filter Stability
Since the pole at 0.75 is located within the unit circle, the filter is stable. Figure 13 shows the highpass-filtered artifacts and contraction EMG. An optimal balance of high artifact attenuation and low EMG signal attenuation is desired. The null hypothesis that the Root Mean Square (RMS) values and the signal loss of the contraction EMG and artifacts are normally distributed was not rejected at a 5% significance level. The one-sample Kolmogorov-Smirnov test [43] resulted in a p = 0.9995 for the RMS of the contraction EMG and in a p = 0.0896 for the RMS of the artifacts. For the signal loss, the p-values depend on the applied filter. The artifacts have lower p-values because the probability density function of artifacts is skewed. The standard deviations in Figure 13c result from the frequency characteristics of the highly variable artifacts measured. The signal loss is the difference of the RMS values of the unfiltered and filtered signal, referred to the unfiltered signal. As we strive  Chebyshev 0.914 ± 0.119i 0.723 ± 0.310i 0.527 ± 0.435i 0.335 ± 0.511i Butterworth 0.912 ± 0.077i 0.738 ± 0.206i 0.572 ± 0.292i 0.413 ± 0.352i

Lowpass Filter
In this section, the parametrization of the lowpass filter, which is applied after the highpass filter, is evaluated. For the smoothing lowpass, the architecture, runtime and implementation are equivalent to the filter described in this section, and its parametrization is described in Section 3.4.8.
The lowpass after the highpass filter has the time constant T = 300 µs and the cutoff frequency f C = 531 Hz. A higher f C does not sufficiently filter the high-frequency edges of the quantizations, and a lower f C would markedly attenuate the EMG signal.

Lowpass Filter Stability
Since the pole at 0.75 is located within the unit circle, the filter is stable. Figure 13 shows the highpass-filtered artifacts and contraction EMG. An optimal balance of high artifact attenuation and low EMG signal attenuation is desired. The null hypothesis that the Root Mean Square (RMS) values and the signal loss of the contraction EMG and artifacts are normally distributed was not rejected at a 5% significance level. The one-sample Kolmogorov-Smirnov test [43] resulted in a p = 0.9995 for the RMS of the contraction EMG and in a p = 0.0896 for the RMS of the artifacts. For the signal loss, the p-values depend on the applied filter. The artifacts have lower p-values because the probability density function of artifacts is skewed. The standard deviations in Figure 13c result from the frequency characteristics of the highly variable artifacts measured. The signal loss is the difference of the RMS values of the unfiltered and filtered signal, referred to the unfiltered signal. As we strive for low EMG signal loss and high artifact signal loss, the difference of these signal losses is plotted in Figure 13d. Since the maximum is at the cutoff frequency f C = 60 Hz for the Chebyshev filter, we chose this filter for the final implementation in the insulated EMG measurement system.

Highpass Filter Stability
The poles are listed in Table 4 and plotted in Figure 14 to illustrate the stability of the filters. All highpass filters are stable because their poles are located within the unit circle. The poles of the filters with low f C are close to the edges of the unit circle, but they are stable.

Highpass Filter Stability
The poles are listed in Table 4 and plotted in Figure 14 to illustrate the stability of the filters. All highpass filters are stable because their poles are located within the unit circle. The poles of the filters with low f C are close to the edges of the unit circle, but they are stable.

Highpass Filter Stability
The poles are listed in Table 4 and plotted in Figure 14 to illustrate the stability of the filters. All highpass filters are stable because their poles are located within the unit circle. The poles of the filters with low f C are close to the edges of the unit circle, but they are stable.

Rectification and Smoothing
Linear rectification was chosen for the final implementation, as it enables better proportional control than squared rectification. Since the values of squared high signals are much greater than those of squared small signals, the small signal amplitudes from noise, but also weak contractions, vanish due to the squaring. The slope steepness is better for squaring, but with linear rectification sufficient steepness of the signal slopes still can be achieved for light co-contractions.
The cutoff frequency f C was set to 3.11 Hz. This lowpass, which is a discrete first-order lag element, has a time constant T of 51.1 ms. A lower f C would lead to longer delays, and a higher f C would not smooth the signal sufficiently for a stable prosthesis control. Figure 16 shows the rectified and smoothed signals of various movements. As the prosthesis drive has an integrated lowpass characteristic, a slight ripple in the smoothed signal does not affect the drive speed.

Runtime
The runtimes of the implemented signal processing chain for various filters are listed in Table 5. Different lowpass implementations at a 48 MHz clock frequency are compared in Table 6. The runtime is inversely proportional to the clock frequency, i.e., decreasing the clock frequency by half will double the runtime. Avoiding FIR filters is recommended for real-time ultra-low-power systems, as runtime is significantly longer, depending on the order of the filter. Furthermore, the fifth-order FIR filter has a poorer damping characteristic than the presented IIR filter. In many EMG systems, FIR filters have window sizes of 50-350 ms [44], implying a filter order of 500-3500. Such filters cannot be calculated in real-time with this system. The selected implementation requires less calculation effort than the

Rectification and Smoothing
Linear rectification was chosen for the final implementation, as it enables better proportional control than squared rectification. Since the values of squared high signals are much greater than those of squared small signals, the small signal amplitudes from noise, but also weak contractions, vanish due to the squaring. The slope steepness is better for squaring, but with linear rectification sufficient steepness of the signal slopes still can be achieved for light co-contractions.
The cutoff frequency f C was set to 3.11 Hz. This lowpass, which is a discrete first-order lag element, has a time constant T of 51.1 ms. A lower f C would lead to longer delays, and a higher f C would not smooth the signal sufficiently for a stable prosthesis control. Figure 16 shows the rectified and smoothed signals of various movements. As the prosthesis drive has an integrated lowpass characteristic, a slight ripple in the smoothed signal does not affect the drive speed.

Runtime
The runtimes of the implemented signal processing chain for various filters are listed in Table 5. Different lowpass implementations at a 48 MHz clock frequency are compared in Table 6. The runtime is inversely proportional to the clock frequency, i.e., decreasing the clock frequency by half will double the runtime. Avoiding FIR filters is recommended for real-time ultra-low-power systems, as runtime is significantly longer, depending on the order of the filter. Furthermore, the fifth-order FIR filter has a poorer damping characteristic than the presented IIR filter. In many EMG systems, FIR filters have window sizes of 50-350 ms [44], implying a filter order of 500-3500. Such filters cannot be calculated in real-time with this system. The selected implementation requires less calculation effort than the floating-point moving-average filter. Even when the fixed-point implementations are compared, our lowpass architecture decreases runtime.

Power Consumption
The current consumption of the sensor system, as presented by Roland et al. [11] was measured to be 8.5 mA at a supply voltage of 3.7 V (=31.5 mW). This includes the µC, which requires 5.2 mA. For this measurement, the controller was set to 48 MHz clock frequency in PL2 mode and the ADC, DAC, brown out detector and IO-pins were activated. The current consumption of the controller includes also the integrated OpAmps for gain adjustment, the non-volatile memory and the DSP software. The BLE module would increase the current consumption at 3.7 V by 0.9 mA in advertising mode and by 8.9 mA in send/receive mode [45]. The send/receive mode is only activated in case of sensor configuration or data transfer to the PC. In deep sleep mode, the power consumption of the BLE module is negligible. However, the high clock frequency was selected to avoid limitations in

Power Consumption
The current consumption of the sensor system, as presented by Roland et al. [11] was measured to be 8.5 mA at a supply voltage of 3.7 V (=31.5 mW). This includes the µC, which requires 5.2 mA. For this measurement, the controller was set to 48 MHz clock frequency in PL2 mode and the ADC, DAC, brown out detector and IO-pins were activated. The current consumption of the controller includes also the integrated OpAmps for gain adjustment, the non-volatile memory and the DSP software. The BLE module would increase the current consumption at 3.7 V by 0.9 mA in advertising mode and by 8.9 mA in send/receive mode [45]. The send/receive mode is only activated in case of sensor configuration or data transfer to the PC. In deep sleep mode, the power consumption of the BLE module is negligible. However, the high clock frequency was selected to avoid limitations in the experiments, which comprise also floating point implementations. The relation between µC clock frequency and power consumption is given in Table 7. Due to the fact that the ADC clock is connected to the µC clock, the ADC settings have to be checked and recalculated accordingly.

Signal Quality Dependent on DSP Sampling Frequency
The reduction of the DSP sampling frequency allows a reduction of the clock frequency, which further reduces the power consumption, see Table 7. Figure 17 shows that a reduction of the DSP sampling frequency also reduces the SNR as high frequency noise is reflected to the EMG frequency range.   The EMG signal was measured at a muscle force at 20% of MVC and the noise was measured at a relaxed muscle. Note that the SNR is higher at 100% MVC than at these measurements with lower muscle force.

Memory
The presented implementation including all configurations, filters, rectification and smoothing and the decision algorithm requires 32.4% of the 256 kB program memory and 35.3% of the 32 kB data memory.

Signal Delay
The signal delay is dominated by the time constant T of the first-order lag element which forms the lowpass filter for smoothing. This T of 51.1 ms is not perceptible to the user as described in the Introduction.

Discussion
Insulated EMG has various advantages, such as insensitivity to sweat and prevention of pressure marks, over state-of-the-art conductive EMG. However, insulated EMG requires sophisticated measurement electronics and signal processing. Implementing these filters as analog circuits, cost for many components, matching these components and designing and developing a more extensive circuit board arise. Digital filters implemented in a microcontroller based DSP increases flexibility and decreases cost. We suggest digital filtering instead of analog filtering to best meet the requirements for Figure 17. SNR at different sampling frequencies. The EMG signal was measured at a muscle force at 20% of MVC and the noise was measured at a relaxed muscle. Note that the SNR is higher at 100% MVC than at these measurements with lower muscle force.

Memory
The presented implementation including all configurations, filters, rectification and smoothing and the decision algorithm requires 32.4% of the 256 kB program memory and 35.3% of the 32 kB data memory.

Signal Delay
The signal delay is dominated by the time constant T of the first-order lag element which forms the lowpass filter for smoothing. This T of 51.1 ms is not perceptible to the user as described in the Introduction.

Discussion
Insulated EMG has various advantages, such as insensitivity to sweat and prevention of pressure marks, over state-of-the-art conductive EMG. However, insulated EMG requires sophisticated measurement electronics and signal processing. Implementing these filters as analog circuits, cost for many components, matching these components and designing and developing a more extensive circuit board arise. Digital filters implemented in a microcontroller based DSP increases flexibility and decreases cost. We suggest digital filtering instead of analog filtering to best meet the requirements for EMG sensing, like low-power consumption, high signal quality, stability, proportionality, etc., as listed in the Introduction.
The comb filter, which suppresses the PLI in this sensor, is very effective, stable and requires low computation power; however, the EMG signal is also reduced. A trade-off between high filter Q and stability has to be dealt with. A high filter Q increases the sensitivity to power-line frequency deviations and, depending on the filter type, causes ringing and overshoot. For stable operation, we suggest applying the 5 Hz Butterworth filter.
One major problem in EMG measurement is movement artifacts. Changes in contact pressure, which occur due to movements, change the coupling capacity and further alter the signal amplitude. Therefore, the evaluated higher cutoff frequency for highpass filtering might also result from the fact that the system is designed for high stability in the context of movement artifacts. We suggest a higher cutoff frequency at 60 Hz for insulated EMG in contrast to the 5-30 Hz cutoff frequency recommended for highpass filtering in conductive EMG.
The EMG signal is smoothed to control the prosthesis drive. A short response time of the system, which is dominated by the T (=51.1 ms) of the lowpass filter for smoothing, is desired. A low T leads to a fast system while reducing signal quality and stability due to insufficient smoothing. To control the prosthesis drive speed proportional to the muscle force, the prosthesis drive has to be activated already at low signal levels. High slope steepness facilitates co-contractions; however, this impairs stability.
To achieve high signal quality in the evaluations, the DSP sampling frequency was set to 10 kHz. This frequency could be reduced, having a slightly lower signal-to-noise ratio. If the signal is smoothed, high signal quality is not required and we suggest a sampling frequency in the range from 0.5 kHz to 1 kHz. However, if the signal is further processed, like in feature extraction for machine learning, we suggest higher DSP sampling frequencies from 2 kHz up to 10 kHz.
The decision algorithm, which distinguishes between movement artifacts and muscle contraction, has already been tested on amputees in real-world environments. As movement artifacts are a major problem in prosthesis control, this algorithm significantly improves the performance of the prosthesis.
The whole capacitive EMG sensor system has not been applied to amputees in real-world environments yet. Nevertheless, noise, which occurs in real-world environments such as movement artifacts and power-line interferences, were measured and incorporated in the filter design. This work demonstrates the principles of how to implement this filter design aiming at robust control.

Conclusions
Insulated EMG sensors are different in construction to conductive EMG sensors and can avoid pressure marks and skin irritations. Due to the measurement principle, insulated EMG sensors have special requirements in signal amplification and processing.
DSP implemented into a microcontroller reduces the sensor hardware to a minimum and enables configuration, calibration and continuous improvement without hardware modifications. This work demonstrates optimized system setup, filter selection and implementation into an embedded low-power real-time sensor. By incorporating artifacts and other noise, which occur in real-world environments, to the selection of the filter parameters, a robust system was obtained. High signal quality and stable control of the myoelectric upper-limb prosthesis were achieved with these algorithms, although they require minimal calculation effort.
With the knowledge of the DSP calculation effort, the clock frequency and the power consumption can be optimized. This microcontroller based sensor system provides the opportunity to implement and test future innovations and developments.
As part of future work, we plan to further investigate the discrimination between artifacts and muscle contraction to ensure that the prosthesis drive is activated only by actual muscle contractions. Time domain features allow fast decisions at minimal calculation effort. Our next step will be the testing of the presented insulated EMG measurement system with amputees in real-world environments. To extend the system to a multi-sensor application, we will design low-power decision algorithms to distinguish between various hand movements for high-dexterity prostheses.

Abbreviations
The following abbreviations are used in this manuscript: ADC