Compression of high-density EMG signals for trapezius and gastrocnemius muscles

Background New technologies for data transmission and multi-electrode arrays increased the demand for compressing high-density electromyography (HD EMG) signals. This article aims the compression of HD EMG signals recorded by two-dimensional electrode matrices at different muscle-contraction forces. It also shows methodological aspects of compressing HD EMG signals for non-pinnate (upper trapezius) and pinnate (medial gastrocnemius) muscles, using image compression techniques. Methods HD EMG signals were placed in image rows, according to two distinct electrode orders: parallel and perpendicular to the muscle longitudinal axis. For the lossless case, the images obtained from single-differential signals as well as their differences in time were compressed. For the lossy algorithm, the images associated to the recorded monopolar or single-differential signals were compressed for different compression levels. Results Lossless compression provided up to 59.3% file-size reduction (FSR), with lower contraction forces associated to higher FSR. For lossy compression, a 90.8% reduction on the file size was attained, while keeping the signal-to-noise ratio (SNR) at 21.19 dB. For a similar FSR, higher contraction forces corresponded to higher SNR Conclusions The computation of signal differences in time improves the performance of lossless compression while the selection of signals in the transversal order improves the lossy compression of HD EMG, for both pinnate and non-pinnate muscles.

The development of new wireless technologies for data transmission (e.g. Bluetooth), as well as the high-density multi-electrode arrays for EMG signal detection [24], has generated new research lines. In recent works, linear prediction techniques have been applied to the compression of multi-channel EMG signals from biceps brachii (BB) [25]. On the other hand, transform-based compression has not been applied to multichannel EMG yet. Furthermore, no compression studies have been performed with multi-channel EMG from pinnate muscles, whose muscle fibers are not parallel to the skin surface and whose signals have different morphology.
In this work, compression techniques based on linear prediction (lossless JPEG) and transforms (lossy JPEG) were evaluated for multi-channel EMG signals from upper trapezius (UT) and medial gastrocnemius (MG). Each signal was placed on a matrix row, each sampling time instant was attributed to a column, and the matrix was interpreted as an image. Two signal arrangements provided different images to be compressed. The effect of applying compression before and after time differentiating the signals was also studied.
The aim of this research was to show the importance of methodological aspects on the use of lossless and lossy image compression techniques for propagating and nonpropagating high-density multi-channel EMG signals.

Methods
EMG signals differ from muscle to muscle and subject to subject, however the basic shapes and discharge rates of the constituent motor unit action potential (MUAP) trains are similar and 90-95% of the signal power is within the 10-450 Hz range. Muscle fiber conduction velocity (of the propagating components) is in the range 3-5 m/s and non-propagating components are generated by the "end of fiber effect" due to the extinction of the MUAPs at fiber ends. The latter phenomenon is particularly relevant in pinnate muscles whose fibers terminate near the surface.
The signals considered in this study were generated by three muscles: the Upper Trapezius (UT) and the Biceps Brachii (BB), both with fibers parallel to the skin and predominantly propagating components, and the Medial Gastrocnemius (MG) highly pinnate, with fiber at an angle with respect to the skin and predominantly nonpropagating components.

EMG signals from the upper trapezius muscle
Four recordings of 63 single-differential signals were obtained from a database from Laboratorio di Ingegneria del Sistema Neuromuscolare (LISiN), Politecnico di Torino, Italy [26]. All subjects signed an informed consent form and the protocol was approved by the local Regional Ethics Committee (Commissione di Vigilanza, Servizio Sanitario Nazionale -Regione Piemonte -ASL 1 -Torino, Italy). These signals were recorded from the UT muscle of two healthy males, at twenty and forty percent of maximum voluntary contraction force (MVC), using a two-dimensional surface-electrode matrix of sixty-four electrodes distributed in five rows and thirteen columns (no electrode in the left upper corner) [24], with rows positioned in the direction of muscle fibers (see Figure 1). Inter-electrode distance was 8 mm which satisfies the sampling theorem in space [27]. Single differential signals-given by the difference between two adjacent electrodes-were amplified and band-pass filtered (10Hz-750 Hz). Each signal s k (t) was acquired at a sampling frequency of 2,048 Hz per channel during 10s, and converted using a twelve-bit analog-to-digital converter. For processing, each 10s recording was divided into twenty 500 ms epochs.

EMG signals from the medial gastrocnemius muscle
One recording of 128 monopolar signals was obtained from a database from Laboratorio di Ingegneria del Sistema Neuromuscolare (LISiN), Politecnico di Torino, Italy [28]. The subject provided written informed consent before volunteering to the fatiguing plantarflexion protocol, which was approved by the local Ethics Committee. One healthy male subject was asked to isometrically increase his ankle plantar flexion torque in steps corresponding to twenty, forty, sixty and eighty percent of maximum voluntary contraction (MVC) force. Each contraction lasted approximately 5 s. These signals were recorded from the MG muscle with a two-dimensional surface-electrode matrix, with interelectrode distance of 10 mm. One hundred and twenty eight electrodes were distributed in eight rows and sixteen columns, with rows parallel to the longitudinal axis of the muscle, as shown in Figure 2. Each monopolar signal corresponded to one electrode.
Differently from the case of the trapezius muscle, these signals are mostly nonpropagating, because of the pinnate structure of the gastrocnemius muscle, and mostly due to the "end of fiber effect".
Signals were amplified 500 times and band-pass filtered (10Hz-750 Hz). Each signal was acquired at a sampling frequency of 2,048 Hz per channel, using a twelve-bit analog-to-digital converter. Additional variables-such as forces and torques-were also recorded during the experiments, but did not belong to the scope of this study and therefore were not considered in this work. The recording was then divided into Figure 1 Recording of upper trapezius single-differential signals. Example of the 64 contact electrode matrix applied to the upper trapezius muscle. 500 ms epochs. Those epochs at the transition between different contraction force levels were discarded, so that each contraction level was, in the end, represented by eight epochs of 500 ms each. For lossless compression, 127 single-differential signals s k (t) were computed by the difference between adjacent monopolar signals.

EMG signals from the biceps brachii muscle
Literature results [25] corresponded to EMG signals recorded from the BB muscle of seven subjects, at 50%MVC. A matrix of 61 electrodes-organized in thirteen rows and five columns without the four corner electrodes-was used. Inter-electrode distance was 5 mm. Signals were band-pass filtered from 10 Hz to 400 Hz, and acquired for 20 seconds at the rate of 1000 samples per second.

Signal arrangements in images
Epochs were positioned in matrices, in which each row represented one of the MG or UT signals and each column corresponded to a time instant. Signal values were coded using grey levels, so each matrix could be interpreted as an image that corresponded to a 500 ms epoch of multi-channel EMG signals. The number of columns M was 1,024. The number of rows N was 63 for propagating single-differential signals (UT muscle), 127 for non-propagating single-differential signals (MG muscle), and 128 for nonpropagating monopolar signals (MG muscle). The sequence in which signals were positioned in images followed two different orders-the "longitudinal arrangement" was parallel to the longitudinal axis of the muscle (see Figure 3), and the "transversal arragement" was perpendicular to it (as shown on Figure 4).

Signal differentiation in time
Single-differential signals were differentiated with respect to time in order to take advantage from their time correlation, due to the limited signal bandwidth (10 Hz to 750 Hz). Then, compression was applied to the signal differences Δ k (t) = z k (t)−z k (t−T), where T was the sampling interval, t = T, …, 1024 T and k = 1, 2, …, N. In this way, each image row k represented one time-differentiated signal Δ k (t). In order to reconstruct the original signals without errors, the first image column included the original-signal samples Δ k (0) = z k (0), at time t = 0 ms. Figure 5 shows single-differential S k signals and their time-differences Δ k , for 20% MVC and 80%MVC. Monopolar signals M k are also illustrated in Figure 5.
For compression purposes, multi-channel high-density EMG samples were represented by grey images. Two approaches were considered: lossless and lossy compression.

Lossless JPEG
A lossless image compression standard-established by the Joint Photographic Experts Group (JPEG)-was used in this work [29]. Since the source image could be reconstructed exactly from the decoding of the compressed image data, the original EMG samples could also be perfectly recovered.
In the lossless JPEG encoding, the value of the sample at position (r, c) is estimated by a predictorŷ r; c ð Þ based on the values of three neighbor samples y(r-1,c), y(r,c-1) and y(r-1,c-1), where r is the number of the current row and c is the number of the current column. This is a causal template, a subset of the available past data. The difference between the actual value of the sample y(r,c) and the estimateŷ r; c ð Þ is entropy coded by either Huffman or arithmetic coding, in a lossless fashion. This guarantees that the source image can be perfectly reconstructed from the decoding of the compressed image data. The decoding process occurs in an order that is reverse to the coding process [29].

Lossless ZIP compression
For comparison purposes, an alternative lossless method was used-the ZIP compression of files. ZIP is a public-domain standard that is widely used for file compression. It uses the DEFLATE algorithm [30] for lossless compression which, in turn, combines the Lempel and Ziv LZ77 algorithm [31] with Huffman coding [29]. In this work, samples from the A/D converter were initially represented by 12 bits. Since each byte has only 8 bits, a routine to convert two 12-bit samples into three 8-bit bytes was needed. The 212 format is a standard used in some PhysioBank data files [32] that represents two successive 12-bit samples- The computed bytes were then saved in Matlab® uncompressed format (version 6), as unsigned 8-bit integers. These .mat files were later compressed in ZIP standard to provide a reference value for comparison purposes.

Lossy compression
Lossy methods were applied to both longitudinal and transversal arrangements of the recorded signals.

Lossy JPEG
In lossy JPEG, the source image data are divided into blocks of 8-pixels by 8-pixels. Then the two-dimensional discrete cosine transform (DCT) is applied to each block, Figure 3 Longitudinal arrangement of signals. Longitudinal arrangement-signals are taken in the left-to-right (odd rows) and right-to-left (even rows) sequence from the electrode matrix. Rows are parallel to the longitudinal axis of the muscle. The beginning of the sequence and its end are indicated by triangles and the words "start" and "finish". Arrows indicate how single-differential signals are taken as the differences between adjacent electrodes, which are represented by points. Each electrode corresponds to a monopolar signal. The image is formed by positioning one signal above the other, in the same sequence that they are taken from the electrode matrix. resulting in sixty four DCT coefficients. Each one of the DCT coefficients goes through a process known as quantization, in which it is divided by a value retrieved from a quantization table and then rounded off to the nearest integer. This quantization process inserts losses.
In the JPEG still picture compression standard specifications [29], methods implementing the standard should provide a wide range of image quality ratings-"moderate", "good", "very good", "excellent" and "usually indistinguishable from the original".
The quality parameter (q) provided by Matlab's imwrite funtion is a number between 0 and 100, that allows the user to control the compressed-image characteristics by associating higher values with higher quality, smaller image degradation, and larger file sizes.
In lossy JPEG, the quantization-table values are modulated by a number that is directly related to the value of the quality parameter. Quantization-table values are lower for higher values of the quality parameter. DCT coefficients are divided by smaller quantization-table values, with the consequent reduction in quantization errors and "image degradation".
After quantization, coefficients are rearranged into a vector form, according to the order known as zig-zag order. For further compression, the resulting vector of DCT coefficients is entropy encoded by Huffman coding, according to a criterion provided in specific tables, referred to as "Table Specification" in [29].

Linear prediction
In previous research, Carotti and colleagues proposed a lossy compression technique based on linear prediction applied to single-channel EMG [10] and multi-channel EMG [25] signals (sixty one signals from a 5 × 13 matrix without the four corner electrodes).
In the case of modified Algebraic Code Excited Linear Prediction (ACELP), each EMG signal recorded from BB muscle was represented by parameters derived from an autoregressive model and a prediction residual signal. The residual signal was coded by a method that minimized the mean-squared reconstruction error. The quantization process was applied to the parameters and to the residual signal, so that a lossy compression was obtained [10,[30][31][32][33][34][35]. ACELP has been applied to independent coding of single-channel EMG signals or to the spectral components. It has also been used in spatial and temporal prediction [25].

Compression evaluation
Two compression aspects were evaluated in this work-data size and errors.

Compression performance
For UT muscle, the number of bytes required to store 500 ms of uncompressed singledifferential signals was 96,768 bytes (63 channels × 1,024 samples/channel × 12 bits/ sample/8 bits/byte). In the case of MG muscle, the uncompressed file size for each 500 ms epoch was 195,072 bytes for 127 single-differential signals, and 196,608 bytes for 128 monopolar signals.
Compression ratio (CR) is defined as the ratio between the uncompressed data size and the compressed data size: File size reduction (FSR) considers the size difference between original and compressed data, with respect to the original data size. It is usually given in percentage: For a specific experimental condition-muscle, contraction force level, arrangement type and compression method-compression performance parameters were computed Figure 4 Transversal arrangement of signals. Transversal arrangement-signals are taken in the top-down (odd columns) and bottom-up (even columns) sequence from the electrode matrix. Rows are parallel to the longitudinal axis of the muscle. The beginning of the sequence and its end are indicated by triangles and the words "start" and "finish". Arrows indicate how single-differential signals are taken as the differences between adjacent electrodes, which are represented by points. Each electrode corresponds to a monopolar signal. The image is formed by positioning one signal above the other, in the same sequence that they are taken from the electrode matrix.
for several individual epochs. In the case of UT muscle, each contraction force corresponded to forty 500 ms epochs, obtained from two 10s recordings. For MG muscle, eight 500 ms epochs were associated to each contraction force. For clarity reasons, instead of presenting results for all the individual epochs in the same experimental condition, we computed mean values and standard deviations of CR and FSR, and presented them in tables, alongside compression error measurements described below. However, to facilitate reading, only the mean values are mentioned in the text.

Compression errors
For lossy compression, the inverse process-decompression-results in reconstructed signalsŝ k t ð Þ that are not exactly equal to the EMG signals s k (t). This process introduces errors that are defined as The maximum absolute error (MAE) is the maximum value of the absolute error over all samples in the matrix: where k = 1,…N is the signal number, m = 1, …1024 is the sample number, and T is the sampling time (inverse of the sampling frequency). In this work, MAE is given in arbitrary units (A.U.). The number of A.U. could correspond to the number of quantization levels, where the quantization level ΔV of an A/D converter is given by the input voltage range divided by the total number of quantization levels. It can also be associated to the non-amplified EMG, by dividing ΔV by the amplifier's gain. For example, signals from both the UT and the MG muscles were converted using a twelve-bit A/D converter, whose input varied from -10 V to +10 V. Hence, the quantization level was 20 divided by 4,096 (2 12 ), i.e., ΔV = 4.88 mV. One A.U. could be made equivalent to one ΔV. If the amplifier's gain (500) is taken into account, one A.U. could also be associated to a value of (ΔV/gain) = 9.77 μV for the non-amplified EMG signal. However, the use of integers for A.U. is better suited for compression purposes than real voltage values. Therefore in this work, MAE may vary from 0A.U. to 4,096A.U.
The signal-to-error ratio (SNR) is given in decibels (dB) by: where N = 63 (for propagating EMG signals) or N = 128 (for non-propagating monopolar signals) is the number of signals, and M = 1024 is the number of samples per channel corresponding to a 500 ms epoch. Note that for lossless compression, maximum absolute error (MAE) is zero, while signal-to-noise error (SNR) is infinite, because the original signals can always be reconstructed without errors.

Results
For illustration purposes, a short segment of the original and reconstructed signals S 1 are shown on Figure 6, as well as reconstruction errors. For the longitudinal arrangement of the seventh 500 ms epoch at 80%MVC of MG muscle, the quality parameter (q) for lossy compression was chosen as 13, since it provides over 90% compression, while keeping a SNR around 20 dB. Considering all the 128 signals of the 500 ms epoch, the lossy compression performance was given by a FSR of 90.6%, a MAE of 101 A.U. and a SNR of 19.88 dB. Using lossless JPEG compression, FSR was 33.52% for this specific epoch. Table 1 presents FSR results for lossless compression techniques-ZIP and lossless JPEG-for both pinnate (MG) and non-pinnate (UT) muscles.

Lossless ZIP compression results
ZIP compression provided the worst results for the compression of propagating and nonpropagating single-differential signals. Figure 7a shows the ZIP compression results for the longitudinal and transversal arrangement of both non-pinnate and pinnate muscle signals.

Single-differential signals from UT muscle
For the longitudinal arrangement of propagating single-differential signals (UT muscle), average FSRs of 17.98% (for 20%MVC) and 14.69% (for 40%MVC) were obtained. Compared to the longitudinal arrangement, the transversal arrangement provided additional FSRs of 1.80% (for 20%MVC) and 2.00% (for 40%MVC) on average.

Lossless JPEG compression results
Lossless JPEG was applied to images of single-differential signals and their timedifferences. Figure 7b shows FSR for the longitudinal arrangement. For FSR values in the range below 55.0%, there is an improvement in FSR if time differentiation is applied to single-differential signals before the lossless-JPEG compression.
Single-differential signals from UT muscle and time differences Lossless JPEG was applied directly to images of propagating single-differential signals in the longitudinal arrangement. It resulted in average FSRs of 36.72% (for 20%MVC) and 31.79% (for 40%MVC). These values will be used as reference for the comparisons that follow. The transversal arrangement of single-differentiated signals did not bring any noticeable improvement on the FSR, for both contraction force levels. The process of performing time differentiation of single-differential signals, before applying the lossless JPEG compression, provided additional FSRs of 4.14% (for 20%MVC) and 6.34% (for 40%MVC) with respect to the mean values obtained for compressed singledifferential signals, in both longitudinal and transversal arrangements.
Single-differential signals from MG muscle and time differences Lossless JPEG was applied to the longitudinal arrangement of non-propagating singledifferential signals and resulted in average FSRs of 59.29% (for 20%MVC), 52.52% (for 40% MVC), 47.77% (for 60%MVC) and 45.40% (for 80%MVC). The transversal arrangement did not bring any significant improvement on the FSR. For the longitudinal arrangement, time differentiation caused a decrease on average FSR of 0.98% (for 20%MVC). It also caused increases of 0.88% (for 40%MVC), 2.11% (for 60%MVC), and 2.81% (for 80%MVC) on average. Similar results were obtained for the transversal arrangement.

Lossy JPEG compression results
The lossy JPEG quality (q) parameter was varied within the 1 to 100 range. As a consequence, for each 500 ms epoch, one hundred compressed files were generated. Each file corresponded to one quality value, contraction force and muscle. The mean values of file size and signal-to-noise ratio were computed for similar epochs (same quality, contraction and muscle). Figure 8 shows how FSR and SNR vary with the quality parameter, for different contractions and muscles. In this figure, the transversal arrangement was used, since it provided the best results for both pinnate MG and non-pinnate UT muscles. Table 2 shows the results for lossy JPEG compression-the FSR (%), the signal-to-noise ratio (dB) and the maximum absolute error (A.U.)-as well as the value of the quality parameter (q) used to obtain the corresponding mean FSR value. Signals were positioned in images, according to the longitudinal (L) or transversal (T) orders with respect to the muscle fiber direction. Signal types are non-propagating monopolar EMG signals from the MG muscle (N = 8 epochs), propagating single-differential EMG signals from UT  muscle (N = 40 epochs, i.e., twenty epochs from 2 subjects) and propagating singledifferential EMG signals from BB muscle. Even though the experimental parameters-muscle, sampling frequency, inter-electrode distance, amplifier's bandwidth and epoch size-are different from our work, results from [25] are used for comparison with ours, because they are the only values provided by the literature for compression of EMG signals recorded by two-dimensional electrode matrices. Literature results reported in [10] and [25] were obtained by linear prediction (ACELP), independent coding (IC), spectral prediction (SP), and space-and-time prediction (STP).
In lossy JPEG, reconstruction errors and compression ratios varied with the image quality. Lower qualities implied smaller files (greater FSRs) at the expense of lower SNRs. As a consequence, in order to obtain fair comparisons, lossy JPEG results were reported for the FSRs that were nearest to the three values provided by [10] and [25]-87.3%, 89.6% and 91.0%.

Comparisons between lossy JPEG and algebraic-code excited linear prediction
Literature results from [10] provide SNR results for an average FSR of 87.3%. Compression of propagating single-differential EMG signals from BB muscle by algebraiccode excited linear prediction (ACELP) provided mean SNR values of 10.38 dB (for 10%MVC), 11.81 dB (for 30%MVC), 12.25 dB (for 60% MVC), and 12.79 dB (for 70% MVC).
For the same FSR, lossy JPEG provided average SNR of 17.17 dB (for 20%MVC) and 18.63 dB (for 40%MVC) in longitudinally-arranged propagating single-differential signals from UT muscle. The transversal arrangement provided increases in SNR of  Lossless JPEG compression results are presented for single-differential upper trapezius signals before (filled circles) and after (empty circles) time differentiation, and for single-differential medial gastrocnemius signals before (filled diamonds) and after (empty diamonds) time differentiation.
(for 40%MVC), 1.07 dB (for 60%MVC) and 0.91 dB (for 80%MVC) on mean SNR values. Figure 9a presents mean SNR values provided by the two compression methods (ACELP and lossy JPEG), for a FSR of 87.3%.

Comparisons between lossy JPEG and independent coding
Literature results from [25] provide SNR results for a FSR of 89.6%. Compression of propagating single-differential EMG signals from BB muscle by independent coding (IC) provided an average SNR of 15.58 dB (for 50%MVC).
For the same FSR, lossy JPEG provided an average SNR of 15.81 dB (for 20%MVC) and 17.17 dB (for 40%MVC) in longitudinally-arranged signals from UT muscle. The transversal arrangement increased the average SNR by 1.85 dB (for 20%MVC) and 1.70 dB (for 40%MVC), in comparison to the longitudinal arrangement.

Comparisons between lossy JPEG and spectral prediction
Literature results from [25] also provide SNR results for a FSR of 91.0%. Compression of propagating single-differential EMG signals from BB muscle by spectral prediction (SP) provided a SNR of 15.55 dB (for 50%MVC).
For the same FSR, lossy JPEG provided mean SNR values of 14.72 dB (for 20% MVC) and 15.94 dB (for 40%MVC) in longitudinally-arranged signals from UT muscle. The transversal arrangement of these signals resulted in SNR increases of 1.72 dB (for 20%MVC) and 2.00 dB (for 40%MVC) on average, in comparison to the longitudinal arrangement.
For a 91.0% FSR, the SNR results are presented in Figure 9c. Compression methods are spectral prediction and lossy JPEG. Figure 9 Comparison with literature results. Signal-to-noise ratio (SNR) in decibels (dB) as functions of contraction level (%MVC). Lossy-JPEG compression SNRs are shown for medial gastrocnemius signals in transversal (empty diamonds) and longitudinal (filled diamonds) arrangements, and for upper trapezius signals in transversal (empty circles) and longitudinal (filled circles) arrangements. Literature results (stars) are given for biceps brachii signals, using the following compression methods: a) algebraic-code excited linear prediction (ACELP) for an 87.3% FSR, b) independent coding (IC) for an 89.6% FSR, c) spectral prediction (SP) for a 91.0% FSR, and d) spatial and temporal codebook-excited linear prediction (STP) for a 91.0% FSR.

Comparisons between lossy JPEG and space-and-time prediction
Literature results from [25] also provide SNR results for a different compression method for the same FSR of 91.0%. Compression of propagating single-differential signals from BB muscle by space-and-time prediction (STP) provided average SNR of 18.96 dB (for 50%MVC).
The results for lossy JPEG for the same FSR have already been presented in the subsection that showed comparisons with spectral prediction. Figure 9d shows the average SNR for a 91.0% FSR. The results are presented for space-and-time prediction and lossy JPEG.

Discussion
Compared to lossy compression, lossless methods provided lower compression ratios, as expected. However, they provide an important option whenever reconstruction errors are not admissible. Applications involving surface EMG decomposition into the constituent trains of motor unit action potentials require lossless compression, even at the expense of smaller FSR. On the other hand, applications concerning the display of EMG amplitude maps to identify regions of different activity levels can tolerate lower signal-to-noise ratios.
Lossy methods were applied only to the matrices of longitudinal and transversal arrangements of the original recorded signals, not to the signals obtained from differentiation. If differentiation had been used, decompression errors would have been introduced on the sample differences. Since the signals would be reconstructed by accumulating these sample differences, errors would increase as a function of time t or signal number k. For example, the last samples reconstructed from time differences would have an error whose variance would be over 1,000 times the variance for the first sample on the same 500 ms epoch.

Effect of time-differentiation on lossless compression
Time differentiation not only improved the FSR of lossless JPEG compression-regardless of the signal arrangement-but also delivered the highest FSR for propagating single-differential signals recorded from UT muscle at 20%MVC and 40%MVC.
The effect of time-differentiation on non-propagating single-differential signals was not favorable for the lowest contraction force (20%MVC) of the MG muscle. However, it showed its usefulness for higher contraction forces (40%MVC to 80%MVC). One possible explanation follows.
Before the beginning of the acquisition, the EMG amplifier gain was adjusted so that EMG signals would not saturate for any contraction level, up to 80%MVC. As a consequence, at 20%MVC, monopolar signals from MG muscle were small in comparison to the AD converter full range, as shown in Figure 5a. As single-differential signals were computed, their amplitudes became even smaller as seen in Figure 5b, while maintaining the high predictability between neighboring samples that is used by lossless JPEG. When time-differences were computed on single-differential signals, the amplitude decreased even more. Furthermore, the predictability in time and between channels was negatively affected. Figure 5c shows that time-differentiated signals have higher frequency components than single-differential signals. This effect would account for the increase in file sizes, as compared to the single-differential signals, for 20%MVC. On the other hand, for higher contraction forces, this effect would be counterbalanced by the significant decrease on the amplitudes, shown in Figure 5e and 5f, resulting in better compression performance.

Effect of transversal arrangement on lossless compression
For lossless JPEG compression, no significant improvement was attained by using the transversal arrangement in comparison to the longitudinal arrangement. For propagating signals in the longitudinal arrangement (UT muscle), S 2 (t) could be seen as a delayed version of S 1 (t). It could be expected that S 1 (t) would provide better estimates for its nondelayed version S 23 (t) -nearest neighbor signal in the transversal arrangement-than for its delayed version S 2 (t) -which is the nearest neighbor signal in the longitudinal arrangement.
However, results show thatŜ 2 t ð Þ is well determined by the weighted sum of S 2 (t − 1), S 1 (t) and S 1 (t − 1), which are the neighbor samples used by lossless JPEG in the longitudinal arrangement. This would be a plausible explanation for the indifference of lossless-JPEG compression to the longitudinal or transversal arrangements. However, other methods take profit from the transversal arrangement. Used in combination with lossless ZIP compression of propagating single-differential signals, the transversal arrangement improved the FSR by 1.80% (for 20%MVC) and 2.00% (for 40% MVC) in comparison to the longitudinal arrangement, without introducing noise. It also provided additional FSRs that varied from 0.79% (for 20%MVC) up to 1.47% (for 80%MVC), for non-propagating single-differential signals. The transversal placement of EMG signals on images increased the spatial correlation between neighbor signals and consequently reduced the differences between them. This fact improved the compression performance for lossless ZIP compression of both propagating and nonpropagating single-differential signals.

Effect of transversal arrangement on lossy compression
Compared to the longitudinal arrangement, the transversal arrangement caused improvements in the SNR, using lossy JPEG compression of EMG signals at all contraction forces. The transversal arrangement of EMG signals resulted in increases of the SNR that varied from 0.44 dB to 2.00 dB, as compared to the longitudinal arrangement of the same signals.
Results suggest that, in order to achieve the highest compression ratios with lossy JPEG compression, data should be placed in an image where each row represents one of the propagating single-differential signals varying in time, with the signal-placement order established by sweeping the electrode matrix in the direction perpendicular to the muscle fibers. Similarly, non-propagating monopolar signals should be placed in an image whose placement order is provided by the direction perpendicular to the muscle longitudinal axis.
For propagating single-differential signals, the increase in SNR was more marked than for non-propagating monopolar signals. The transversal arrangement of signals takes advantage of the high spatial correlation between the rows of the electrode matrix. For propagating signals, the transversal arrangement induces the clustering of similar signals in the image, with no delay between them. Since lossy JPEG is computed by the DCT, this clustering allows the concentration of the largest DCT components in the lowest frequencies. The low-frequency DCT components are less affected by quantization, so smaller reconstruction errors are obtained. Consequently, the transversal arrangement improves the FSR in lossy JPEG compression of propagating signals, as compared to the longitudinal arrangement. For non-propagating signals, the transversal arrangement would not bring such an advantage. Since the fibers of the MG muscle are not parallel to the skin or to the longitudinal axis of the muscle, the surface signals show no propagation in the direction of the rows of the electrode matrix. So, the correlation between channels is different with respect to the case where the muscle fibers are parallel to the rows of the electrode array. As a consequence, the transversal arrangement is expected not to achieve the same results as with the propagating signals. Indeed, the transversal arrangement resulted in SNR increases in the range of 0.44 dB to 1.11 dB for the non-propagating MG signals, as compared to increases in the range of 1.72 dB to 2.00 dB for the propagating UT signals.

Comparisons between lossy JPEG and literature results
Carotti and colleagues [10,25] reported compression results with acceptable reconstruction errors from the BB muscle (non-pinnate muscle with fibers parallel to the skin). Several compression techniques described in their work resulted in SNR values from 10.38 dB to 18.96 dB, for FSRs in the range of 87.3% to 91.0%, and contraction forces varying from 10%MVC to 70%MVC.
In our work, the transversal arrangement of EMG signals in images and their lossy-JPEG compression provided SNRs in the range of 16.44 dB to 24.24 dB, for FSR from 87.2% to 90.8%, for contraction forces varying from 20%MVC to 80%MVC.
Our results are therefore better than those provided by ACELP coding applied to individual EMG signals [10], to independent channels [25] and to spectral prediction [25]. Our values are also comparable to the results from spatial and temporal codebook-excited linear prediction [25], with the advantage of being obtained through a public-domain algorithm for image compression, whose computational time is smaller than for linear prediction methods.

Future work
As the technique of "EMG Imaging" evolves towards larger electrode arrays, the issue of wireless transmission of many signals using a limited bandwidth becomes more and more relevant.
This work showed the influence of pre-processing procedures in the compression performance, such as the order (longitudinal or transversal) in which signals are placed into images and the usefulness of space and time-differentiation. It also focused on the differences of propagating and non-propagating EMG signals (note that time and space differentiation are equivalent for propagating signals but not for non-propagating signals). In this work, several parameters were kept constant, in order to allow comparisons between UT and MG muscles.
The increase of sampling frequency in time and space (reduction of inter-electrode distance) above the Nyquist rate should improve the compression performance, at the expense of adding redundant information and increasing the original file sizes. Even though the FSR could benefit from such changes, they would increase not only the non-compressed-file sizes but also the compressed-file sizes. A comprehensive study on the effects of varying sampling frequency and inter-electrode distance could generate a future work, with the aim of determining the optimal choice of both parameters. This study would allow increasing the inter-sample interval and the inter-electrode distance, without compromising the EMG characteristics of interest such as spectral content or time resolution.
Another parameter that affects JPEG performance is the image size-for similar contents, larger images usually result in better compression performance. Recording signals for longer intervals before applying data compression and transmission could be profitable. As a consequence, the interplay between sampling frequency and epoch duration could be the focus of future research.
Furthermore, EMG-signal morphology varies with different muscles, subjects and pathologies. A signal compression technique must be suitable for all cases and conditions. Two very different types of healthy muscles have been considered in this work. Further work is warranted to verify the effectiveness of the technique in extreme cases.

Conclusions
This work provided SNR and FSR values for lossy compression of propagating and non-propagating EMG signals. For a FSR of 90.8%, SNRs of 17.94 dB (for propagating single-differential signals at 40%MVC) and 21.19 dB (for non-propagating monopolar signals at 80%MVC) were attained. For a smaller FSR of 87.2%, SNR reached even higher values-20.45 dB (for propagating signals at 40%MVC) and 24.24 dB (for nonpropagating signals at 80%MVC).
Whenever very high SNR values are the goal, one should consider the possibility of using lossless compression, at the expense of lower FSRs. Reference values of FSR for lossless JPEG compression of single-differential EMG signals in the transversal arrangement are provided for various contraction force levels, in Table 1. For UT singledifferential signals, the reference FSR values are 40.88% (for 20%MVC) and 38.15% (for 40%MVC). For MG single-differential signals before time-differentiation FSR is 59.30% (for 20%MVC), and after time-differentiation FSRs are 53.41% (for 40%MVC), 49.90% (for 60%MVC) and 48.22% (for 80%MVC).
The transversal placement of multi-channel EMG signals on images is a simple procedure that improves the compression performance of lossless-ZIP and lossy-JPEG methods, and causes no harm to lossless-JPEG compression. Furthermore, the timedifferentiation of single-differential signals before lossless-JPEG compression should be considered.
For online compression problems, the use of fast image-compression algorithms may be of significant help, as long as the methodological suggestions are followed.