{'fraction_non_alphanumeric': 0.024520480573315535, 'fraction_numerical': 0.009484999648703717, 'mean_word_length': 4.599527930763179, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Identical Instruments Detection using Least Mean Square Based Adaptive Filter

Gamelan is one of Indonesian traditional music instrument. It have variations in terms of fundamental frequency, amplitude, and signal envelope, due to its handmade construction and playing style. When playing gamelan instruments, many identical music is played simultaneously. Detection of identical instruments are needed to indicate the changes of Gamelan features. We can find how many identical instruments are played at the same time or separated by very short time. We applied Least Mean Square (LMS) adaptive filter to detect identical instruments. The reference signal can have a fundamental frequency shift from the original signal to 10 Hz. The synthetic saron signal is used as reference signal. The performance can separate the identical instruments in 0.03 ms.


Introduction
Gamelan is one of the traditional musical instruments. Gamelan, which is played together like an orchestra. The difference between Gamelan and Orchestra is a conductor, where no one in the Gamelan plays acts a conductor to lead the game, while in the Orchestra there is a conductor.
Gamelan consists of 10 groups of instruments, namely saron, kenong, kempul, kendang, boning, gong, and so on. Gamelan has two standard notations namely Slendro and Pelog. A Gamelan expert named Sindusawarno, has conducted research on the similarity of the Pelog-Slendro scale [1].
One of Gamelan set is Balungan. It consist Demung, Saron, and Peking. The fastest tempo of gamelan ensemble is 300 ms. Separating two or more signals is a very important to find signal features. In addition, separating identical signals is very important to know the number of identical instruments played. This process can be used for music tagging. Kitahara identified the polyphonic music instrument like piano, flute and guitar, and he used a synthetic music instrument. Their sounds are separated by more than 10 msecond time interval and he did not play two or more identical instruments simultaneously within the same music notations. He identify each instrument played with different music notations but not an identical instruments [2]. Separating two or more identical music instruments is an extraordinary thing because the time delay among Sarons sound is very short, it is about 10 ms [3].
Gamelan is produced manually by a craftsman. The craftsmen is greatly rely on the hearing sensitivity of gamelan's craftsmen themselves, while the hearing sensitivity of each gamelan craftsmen may different from one to another. So, the sound of gamelan from one craftman to another craftman can be different. It is because there is no standardization in manufacturing gamelan instrument [4]. The expression of each instrument was determined by its own particular characteristics. In other words, each component created its own specific melody, which could not be replaced or duplicated by others [5]. Fourier transform represents a signal in frequency domain, instead of in time domain. Wavelet does representing a signal in frequency domain too, but it still Gamelan is manually constructed and constructors tune the instrument with their own sense based on experience. As a result, fluctuation of frequency in each gamelan instrument is not set correctly [6]. Because of that, we need to synthesize a gamelan signal for make a signal for reference signal. Ayers uses amplitude modulation to synthesize Gong Ageng and it can produces a tone that is very similar to the original [7]. In this paper, we extract identical Saron signal using Least Mean Square (LMS), and use synthetic signal for the reference. Reference signals are made automatically using several parameters, namely frequency, amplitude, phase and signal length. Furthermore, these parameters will be varied so that the reference signal will be similar to the input signal [4].

Gamelan Signal
Gamelan is one of Indonesian traditional music instruments. It is made of iron, brass or bronze slabs. The gamelan spectrum varies greatly due to violence and hitting force although it still has the same basic frequency.
The frequency of saron tones is not always the same because the production of saron is different. Making saron depends on the gamelan master which affects the dissolution of saron, without any standards. This results in varied tones. In addition, the basic factors can also be different from the techniques used by the player and the beating power. Besides that, a gamelan can also change because of the gamelan instruments. Factors that are influenced by several factors, such as: very old and frequent gamelan instruments, occur in weathering in the original wood. In the Table 1, it can be seen that the frequency of saron tones is different. To find out about the elements contained in the signal, it is necessary to do digital signal processing. For example, by using FFT or STFT, it can be seen elements of balungan signals such as attack, decay, sustain, release, pitch, harmonic frequency, music color, sampling frequency and quantization level. During attack area the amplitude of the signal grows very fast. During decay period, the amplitude and frequency density is uncertain. The signal can not control. The signal swings irregularly and the amplitude become smaller within the time. After decay period, the signal goes to sustain area. During that period, the amplitude goes smaller exponentially and the frequency becomes stable. Based on its character, the beginning of signal can detect. If amplitude grows rapidly in very short time, we detect it as the beginning of signal or if we find an uncontrolled behavior, amplitude and frequency density, we detect it as decay area.

Fast Fourier Transform
Fourier transform is a process that is widely used to convert the domain of a function into the frequency domain. In digital signal processing, such as to analyze the signal of a gamelan, the basic frequency for each tone must be known. Equation (1) is the fourier transformation.
Where: FT (ω) is a function in the frequency domain, ω is the radial frequency, x (t) is the input signal from fourier transformation with t is the unit of time (seconds).
The result of Fourier transformation is the frequency spectrum. The frequency spectrum states the composition of the frequency arrangement of a signal. This aims to form a frequency table that can be used as a reference in the analysis of the next stage. One method used to determine the frequency of a signal is to use Fourier transform.

Reference Signal
Building a reference signal is an important part of the filter process using Least Mean Square. A reference signal is a signal that will be filtered to be similar to the original signal. The difference between the input signal and the output signal is called an error. The smaller error, will indicate that the input signal is close to the original signal, and vice versa.

Adaptive Filter
The Adaptive Filter is a computing device that model the relationship between two signals by way of real time. Adaptive filters are usually associated with the broader topic of statistical signal processing. The operation of signal filtering by definition implies extracting something desired from a signal containing both desired and undesired components. One of them, can be used as noise cancellation in the Gamelan [8].

Blind Signal
In the block diagram in Fig. 1, there is a blind signal which is the signal to be analyzed. In this study, the blind signal is an input signal in the form of a saron music signal instrument. This blind signal can be in the form of one or more saron signals, meaning that this blind signal is an identic signal that will be detected. Input signal is also called blind signal. Blind signal is the signal to be analyzed. Blind signal consists of several identical instruments. The first step is taking data from gamelan instruments. The gamelan instruments used in this study were saron. Because the tunes of the gamelan set are created with different basic frequencies so that later the gamelan will have a varied base tone, then the next step is the Fast Fourier Transform (FFT) analysis which is used to find out the basic frequency of the saron used as the research data, which then this basic frequency can be used as a reference to the reference signal which is a synthetic signal.

Reference Signal
The reference signal is generated following the rules regarding the gamelan tuner. The reference signal is formed by generating a sinusoidal signal with the desired frequency. Next, modulation of the standard envelope will be carried out [4].
Where X p (n) is standart envelope. A is a amplitude of signal, f is fundamental frequency of reference signal, θ is phase. Equation 2 only applies to saron. The difference in generating reference signals for saron with other gamelan devices is a multiplier. This multiplier factor is the value of the Gamelan signal reduction.

Least Mean Square Adaptive Filter
Adaptive digital filters are currently widely used for signal processing applications. The adaptive algorithm uses the value of the criterion of performace, the measurements of the input and desired signals so as to modify the parameters of the filter to improve the performance. This digital filter is widely used to obtain the desired signal spectral characteristics, eliminating unwanted signals (such as noise or interference signals). The adaptive digital filter structure is shown in Fig. 2.

Figure 2. Principle of adaptive filter
The block diagram in Fig. 2 indicates that, if the value of N(n) is known, then after subtracting this from the mixed signal d(n), the original signal X(n) is obtained. S(n) is synthetic signal as reference.

Experiments
This experiment uses the gamelan signal from the Balungan group, saron. Saron has 5 tones. The input signal is in the form of WAVE files (*.wav). Signal analysis needs to be done to find out the elements in a signal. The gamelan signal has several elements, namely attack, decay, sustain, release, pitch, harmonic frequency, sound color, sampling frequency and quantization level. Signal analysis can also  The characteristics of the saron signal, such as attack, decay, sustain and release. Attack is when the instrument first sounds so that the beginning of the signal appears, in this phase the wave moves up from zero to peak. Decay is a continuation of the attack where the wave will drop at the medium level. While sustain is when the waves will survive at the medium level. And the last is release where the volume drops again and then disappears.   Fig. 4 we can know the fundamental frequency. The fundamental frequency includes harmonics and non-harmonics frequency of Saron.
The synthesis signal is used as a reference signal. Furthermore, the twin signal extraction process will be carried out using Least Mean Square (LMS). Every music notation signal is separated from the ensemble and produces an output signal so that it represents a music notation. When music notation is played it can be detected using amplitude detection.
The saron signal used is in the form of a file.wav record which has a fs of 48000. In addition to the blind signal there is also a reference signal. The reference signal used is Saron's synthetic signal. The LMS adaptive filter has several parameters that can affect its performance. These parameters are step size (μ), signal length and iteration. Different parameters will produce different error values. In this research, these parameters become control variables. The step size used is 0.0003. The step size value is obtained after varying the step size value from 0.00005 to 0.0004. For each parameter changing, the Each error or remainder is squared. Then added up and added to the number of observations. The square of the difference between the results and values is actually called the quadratic loss function. MSE will produce a value that shows the average error and can easily distinguish between an error with another error.
Step size 0.0003 has the lowest MSE value. The graph of step size effects on MSE can be seen in Fig. 5.

Figure 5.
Step size vs MSE The next experiment is done to find out until the density of how many identic signals can be detected. This test is carried out with two blind signal saron1 using a reference signal synthetic saron 1. After testing by varying the value of time delay starting from 500 to 8500, then the MSE value is obtained as shown in Fig. 6. Fig. 6 show that the time delay affects the error value. The minimum MSE with time delay = 0.03 ms with MSE value is 0.015768. The maximum MSE is on time delay = 0.01 with MSE value is 0.040251. It conclude that the best detection for identical instrument when the distance is 1500. The performance gained with 0.03 ms accuracy.    Fig. 6, it can be seen that the value of MSE fluctuates but tends to fall. So that the greater the time delay, the MSE value will be lower, this happens because the signal density is very low, thereby reducing the mixing between the two signals and causing the detection process to be more accurate. Fig. 7 shows the coefficients of the adaptive filter with 60 times iteration. Then the identical instruments can be detect, it can be seen on Fig. 8.   This experiment is conducted to determine the effect of shifting the frequency of synthetic signals as a reference signal. This test is carried out by shifting the frequency of synthetic signals into frequencies higher or lower than the original frequency. From the Fig. 9 can be seen that the frequency of synthetic signal as reference signal is affects the error value. The minimum MSE is on frequency = 581 Hz with MSE value is 0.023539. The maximum MSE is on frequency = 600 Hz with MSE value is 0.026062. From the signal coefficient, after frequency=591 Hz we cannot detect the peak of identical instruments. So, from that experiments we know that the tolerance frequency is until 10 Hz.

Conclusion
By implementing LMS adaptive filter, the identical instrument can be detected and separated in 0.03 ms. The reference signal can have a fundamental frequency shift from the original signal to 10 Hz. Moreover, this method can also detect how many instrument played.