Audio Spike Detection on Gamelan using Envelope Shape Pattern Analysis

Spike detection is important for the analysis of gamelan signal processing, in detecting the onset, transcription, and spikes occur on gamelan percussion instruments. Since the current methods: absolute value and NEO, could not detect spikes properly, we proposed to develop a new spike detection method. In this paper, the early stage of spike detection in gamelan music audio was the determination of the peak signal to obtain the form of a signal pattern (envelope like) which was then used as threshold for determining the spike locations. We also demonstrated the effectiveness of their method using shape pattern analysis to detect spikes.


Introduction
Indonesia is a nation with rich cultural diversity, including its traditional musical instruments.Gamelan which is a group of musical instruments played in Javanese orchestra is one example [1], consists of many instruments with specific functions.The uniqueness of gamelan is that it has different tone scale and the way to play it compared to that of the Western musical orchestra which is more popular.Therefore, a study in gamelan audio processing is more challenging than the Western one.A study of Gamelan recordings found, that some of its instruments produced spike's signals, especially the percussion instruments that affected the onset detection.Onset detection is a method to identify a location or the onset in a musical audio signal [2][3][4], that is required in the analysis and further processing of audio signals (beat tracking, setting the tone, structure songs, chords, etc.).Saeed V. Vaseghi [5] showed, that gamelan spike noise pattern was similar to the symptoms of impulsive noise events, and the natural spike was similar to that of the transient noise.So, the references used for this research were those related to spike, impulsive and transient noises.
Some of spike detection algorithms based on the detection of changes in the energy of the signal, The algorithm is absolute value (AV) and nonlinear energy operators (NEO), or also called Teager Energy Operator (TEO).As stated in J. F. Kaiser [6], this algorithm was used for the detection of spikes [7][8][9].The advantage of this method was that it could improve the spike location based on the increase of signal energy or amplitude, and relatively simpler to implement, in either digital or analog domain.Other spike detection algorithm was associated with the application of envelope detection [10], where the envelope was used to detect the presence of signal spikes.Some spike detection methods had been developed, including those that specifically utilize detection envelopes to determine the location [11].Spike detection that is typically used to detect the presence of a spike in biomedical signals, in this study is also tested with NEO and AV detection methods.From testing the detection of audio gamelan using NEO and AV methods, spike detection results show too much but less accurate detection, so it is necessary to develop a spike detection for the gamelan audio.
In this paper, we describe the process of spike detection in the gamelan audio, based on measurement experiments, and the process of forming an envelope pattern by applying spline interpolation to the audio signal.The paper is organized as follows, spike detection in Section 2, proposed method in section 3. Experimental results in section 4, and conclusion of the paper is in section 5.

Spike Detection
Spike detection is a proces to detect the location of the spike on a signal, Some spike detection methods such as by using absolute values method, using nonlinear energy operators (NEO) method and by using the envelope method.Figure 1 represent the image from audio signal gamelan and Figure 2 is an absolute signal of Figure 1, from the visible image containing the spike, to detect the presence of the spike, spike location detection is carried out.The goal this research is to determine of the spike position time.

Spike Detection by using Absolute Value (AV)
The detection of this method is based on finding the absolute value of a signal [7].To determine the spike existence, the presence of threshold is necessary, and only those that exceed the threshold will be considered as spikes.
From equation (1) the value of the spike signal sp(m) will be equal to one, if the value of x(m) exceeded or greater than the threshold Thr and will be zero if the value does not exceed x(m) equal to or less than the threshold value.[10]

The Spike Detection using NEO
The detection of the Nonlinear Energy Operator (NEO) or Teager Energy Operators (TEO) method is based on the multiplication of the previous value with the following value minus its squared value [6][8] [9].In this method, the determination of the threshold is similar to that of the absolute value.It will be considered a spike only if its value exceeds the threshold.
Equation ( 2) is a NEO equation.With xneo a symbol of Nonlinear Energy Operator signal, x is a symbol of the input signal, and the threshold obtained from the following equation, The value of the spike signal sp (m) will be equal to one (1) if the xneo value exceeds or is greater than the threshold Thr, and will be zero (0) if the xneo is the same or below the threshold value.

Detection through Envelope Shape Pattern
Envelope-based detection method is a signal detection method which is based on the shape of the signal envelope.There are several method can be used to get the signal envelope, including one that uses squared low pass filtering (LPF), and the Hilbert transform.
Signal envelope is equivalent to a signal envelope outline, and an envelope detector connects all the peaks in this signal.The envelope detection is widely used in the field of signal processing fields and communications.
This envelope detection method is applied by squaring the input signal and sends this signal through a low pass filter, in which the signal samples are lowered to reduce the sampling frequency.Down sampling can be done if the signal does not have a high frequency.Two additional operations must be performed to maintain the correct scaling.First, amplify the signal by a factor of two, only by keeping the bottom of the signal energy, the energy gain is adjusted to the original energy and takes the square root of the signal to reverse the distortion scale.
Envelope detection method is easy to implement and can be done with a low-order filter that minimizes the output location.Another envelope detection can be done through the analytic signal of the input using Hilbert transformation.An analytic signal is a complex signal, where the real part is the original signal and the imaginary part is the Hilbert-transform of the original signal.

Spikes Detection with Envelope
The method using envelope for the spike was introduced by Byunghwa Lee, Minsoo Hahn, Kwangki Kim, Jinsul Kim 2014 [10].This method utilizes the envelope to detect the presence of signal spikes, by using Equation ( 4) and ( 5) below as a reference, With λ as the envelope's decay coefficient, the value of spike signal sp(m) will be equal to one (1) if the value of the env(m) exceeded or greater than the threshold Thr and will be zero if the value does not exceed the env(m) equal to or less than the threshold value.

Proposed Method
In the application test, both the absolute value and the NEO methods for audio signal spike detection, were unable to detect spikes well.Based on this experience, we proposed to use the shape of the envelope pattern as the reference.This step aims to develop a spike detection algorithm based on the envelope shape.
There are many spike detection algorithms employed to determine the location of the spike.This research tried to design a detection technique which is expected to be integrated in the existing algorithms.This method is expected to generate a new algorithm for spike detection that is applicable to detect spikes and dynamic to the envelope signal pattern.Figure 3 shows the spike detection steps, with the following explanation as follows: an audio recordings of gamelan music signals is used as the audio source, this input is then converted into its absolute form.The signal pattern is then formed through the detection of the signal peaks.Such signal, or envelope pattern applies as threshold in spike detection.In this research, the envelope formation is done by using peak detection and by applying the spline function, the signal envelope can be obtained.The word spline is adopted from the name of a flexible metal strip which is usually used to assist curved line drawing.Mathematically, spline is a numerical polynomial functions consists of polynomial function pieces (known as knots) [12].Like polynomial interpolation, spline interpolation incurs a smaller error than linear interpolation and the interpolate is smoother.The Spline interpolation is easier to evaluate than the high-degree polynomials used in polynomial interpolation.
In numerical mathematical analysis, spline interpolation is a special form of polynomial slices which is practically called as a spline.Spline interpolation is usually more preferred than the original polynomial interpolation since the interpolation error can be minimized, even by using the low-degree polynomial [13].
The signal envelope pattern through result spline function, is then used as a threshold, to determine the spike, a test is performed using Equation ( 6) if the value of s(m)-env(m) is greater than the threshold.The previous research activities related to spike detection so far, were unable to answer the present needs.The existing spike detection algorithms were relatively static, so that in some circumstances are not applicable if the magnitude were not uniform, which, in turn might cause errors in detecting spike locations.This research tries to solve such problem in oder to solve such problem.
Gamelan audio recordings that contain spikes were taken from gamelan owned by the Electrical Department of ITS, and used as the signal source in this experiment.In the first step, the input was used for detecting the peak-signal which was then used to generate a spline pattern for obtaining the threshold to determine the spikes.This envelope pattern was then used as a threshold referring to equation ( 6), and with the obtained thresholds, the signal spikes could be determined as shown in Figure 5 and 6.
From Figure 5, the source signal is then converted into its absolute form.The envelope formation is done by applying the spline function through peak detection of absolute signal data, and the signal envelope can be obtained.This signal envelope pattern, is then used as a threshold.After the envelope threshold obtained, this threshold then used to determine the spike, the result of spike location can be seen in Figure 6.

Experimental Results
As an experimental material, the tested audio recordings showed that it contained a lot of spikes, in this research to detect and determine the location of the spike.Gamelan audio recordings that contain spikes were taken from gamelan owned by the Electrical Department of ITS, and used as the signal source in this experiment.In the first step, the input was used for detecting the peak-signal which was then used to generate a spline pattern for obtaining the threshold to determine the spikes.
The AV and NEO methods, is excellent and easily implemented to detect the spikes in medical signals.To determine the performance of the method in detecting the audio signal spike in gamelan, conducted experiments to test with the audio gamelan music data.
In this test on Table 1, we used audio recordings of gamelan music that has 6 locations spike, with variations in threshold testing with 0.6, 0.4 and 0.2.The test results using these two methods as shown in Table 1, the first column to the method of absolute value, and second column for the method of NEO.The detections of both methods appear low at a high threshold (0.6).At the 0.4 threshold, detection increased to 33 spikes and the 0.2 threshold, detections increasingly redundantly, until 3300 spikes.From the spike detection testing in gamelan audio music, these methods perform poorly to be applied in the detection of spikes in gamelan music audio.For number of real spikes are presented in the column three, while the number of estimated spikes are presented in the column four.From the experimental results showed in Table 2 (part I and II), no error was found from three times tests.As seen in Table 2 part I, and several errors from Table 2 part II.The first visible result of 3 times the experiment error detection zero, while some errors were found in Table 2 part II.There were only 2 errors from of the total number of real spikes (10 + 47) = 57, from the estimated spikes of 10 + 45 = 55.Thus, the error percentage was only 3.6%, which implied that this method could be used to detect the spike location of audio gamelan in 96.4%.
The success of this method depends on the envelope formation patterns, and these patterns were determined by peak detection.So, the selection of the appropriate the parameters were important for determining the envelope pattern.

Conclusion
Spike detection tests were performed on the gamelan audio.The absolute value and NEO methods performed poorly for implementation in spikes detection of gamelan music audio.The envelope pattern approach through a spline, could be used to detect the presence of spikes, and by utilizing this pattern, the threshold could become more adaptive to the envelope.So that the spike pattern with small amplitude, also be well detected.Such method could detect 55 out of 57 spikes, which means 96.4 percent correct detections.

Figure 4 .
Figure 4. Spline illustrative examples of known data

Figure 5 .
Figure 5. Envelope shape pattern of signal Figure 6.Spike locations

Table 1 .
Detect audio spike using Absolute value and NEO method

Table 2 .
Detect audio spike using envelope pattern

Table 2 ,
this experiments using envelope pattern through spline, with a small number of spikes and the experiments on Table2were attempted to detect more spikes numbers.
Audio Spike Detection on Gamelan using Envelope Shape Pattern Analysis (Solekhan) 1437