10
International Journal of Innovative Computing, Information and Control ICIC International c 2020 ISSN 1349-4198 Volume 16, Number 6, December 2020 pp. 2143–2152 TONE INSTRUMENT ESTIMATION USING SINGLE LAYER NEURAL NETWORK Yu Takitani and Toshiya Arakawa Department of Mechanical Systems Engineering Aichi University of Technology 50-2, Nishihasama-cho, Gamagori-shi, Aichi 443-0047, Japan [email protected]; [email protected] Received July 2020; revised October 2020 Abstract. Recently, numerous musical acoustic signals are stored on the Internet to enable widespread digital music distribution and autoscore technology, which can auto- matically detect acoustic signals. However, autoscore technology has not been practically applied because of the complexity and diversity of acoustic signals. Herein, a neural net- work is applied for sound identification and accuracy verification. Sounds of a piano, a synthesizer, an acoustic guitar, an electric guitar, and an electric bass were used, and fast Fourier transform (FFT) was applied to these sounds. The sound spectrum was used as the input of a single-layer neural network, and each sound was classified via the neural network. Electric bass exhibited the highest estimation accuracy followed by the synthesizer, electric guitar, piano, and acoustic guitar, in that order. Furthermore, the identification accuracy decreased with an increasing number of classified instruments. The identification accuracies of the classification of two and five types of instruments are 80% and 40%, respectively. Therefore, the classification of two types of instruments has better identification accuracy compared to five types of instruments. The accuracy difference in classification between each instrument is due to the compositions of each instrument, particularly the shape of the generated sound wave and its frequency. Keywords: Instrument sound, Estimation, Machine learning, Neural network 1. Introduction. Recently, multiple acoustic signals of music are stocked on the Internet owing to widespread digital music distribution. However, adding metadata corresponding to each acoustic signal, such as the name of artists and the music type, is effective in precisely and quickly searching for the expected music from these acoustic signals [1]. However, in terms of cost and labor, manually adding this metadata to each acoustic signal is expensive. Therefore, a technology that detects such information in the acoustic signals, particularly autoscore technology, needs to be developed. However, autoscore technology has not been practically applied because of the complexity and diversity of acoustic signals [2]. Herein, sound source identification, an elemental technology under autoscore technol- ogy, is used to tone the instrument. Sound source identification is part of the pattern recognition research field, and it is an estimation method that identifies the type of in- strument based on acoustic signals. Currently, we have less research on sound source identification compared to voice and character recognition, which have progressed in the pattern recognition field. In the acoustics field, various research is ongoing on corre- spondence analysis between the physical parameters of instrument tone, including the DOI: 10.24507/ijicic.16.06.2143 The first author has graduated from Aichi University of Technology. 2143

TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

International Journal of InnovativeComputing, Information and Control ICIC International c⃝2020 ISSN 1349-4198Volume 16, Number 6, December 2020 pp. 2143–2152

TONE INSTRUMENT ESTIMATION USING SINGLE LAYERNEURAL NETWORK

Yu Takitani† and Toshiya Arakawa

Department of Mechanical Systems EngineeringAichi University of Technology

50-2, Nishihasama-cho, Gamagori-shi, Aichi 443-0047, [email protected]; [email protected]

Received July 2020; revised October 2020

Abstract. Recently, numerous musical acoustic signals are stored on the Internet toenable widespread digital music distribution and autoscore technology, which can auto-matically detect acoustic signals. However, autoscore technology has not been practicallyapplied because of the complexity and diversity of acoustic signals. Herein, a neural net-work is applied for sound identification and accuracy verification. Sounds of a piano, asynthesizer, an acoustic guitar, an electric guitar, and an electric bass were used, andfast Fourier transform (FFT) was applied to these sounds. The sound spectrum wasused as the input of a single-layer neural network, and each sound was classified via theneural network. Electric bass exhibited the highest estimation accuracy followed by thesynthesizer, electric guitar, piano, and acoustic guitar, in that order. Furthermore, theidentification accuracy decreased with an increasing number of classified instruments.The identification accuracies of the classification of two and five types of instrumentsare 80% and 40%, respectively. Therefore, the classification of two types of instrumentshas better identification accuracy compared to five types of instruments. The accuracydifference in classification between each instrument is due to the compositions of eachinstrument, particularly the shape of the generated sound wave and its frequency.Keywords: Instrument sound, Estimation, Machine learning, Neural network

1. Introduction. Recently, multiple acoustic signals of music are stocked on the Internetowing to widespread digital music distribution. However, adding metadata correspondingto each acoustic signal, such as the name of artists and the music type, is effective inprecisely and quickly searching for the expected music from these acoustic signals [1].However, in terms of cost and labor, manually adding this metadata to each acousticsignal is expensive. Therefore, a technology that detects such information in the acousticsignals, particularly autoscore technology, needs to be developed. However, autoscoretechnology has not been practically applied because of the complexity and diversity ofacoustic signals [2].

Herein, sound source identification, an elemental technology under autoscore technol-ogy, is used to tone the instrument. Sound source identification is part of the patternrecognition research field, and it is an estimation method that identifies the type of in-strument based on acoustic signals. Currently, we have less research on sound sourceidentification compared to voice and character recognition, which have progressed in thepattern recognition field. In the acoustics field, various research is ongoing on corre-spondence analysis between the physical parameters of instrument tone, including the

DOI: 10.24507/ijicic.16.06.2143†The first author has graduated from Aichi University of Technology.

2143

Page 2: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

2144 Y. TAKITANI AND T. ARAKAWA

characteristic quantity of each instrument, computers, and sense of hearing [3]. How-ever, these research works are far from realizing the engineering model of sound sourceidentification.A sound wave comprises the sum of sine waves that gradually change amplitude and

phase. Amplitude information is an important factor for distinguishing sounds. Giventhat, sound waves generally transform to certain characteristics, such as a frequencyspectrum, which can help identify some sound features [4,5]. Further, a previous studyhas shown the efficiency of sound source identification among acoustic signals using aneural network [6]. As an effective method for sound source identification, a previousstudy has applied the hidden or embedded hidden Markov model [7,8] and Mel-frequencycepstral coefficients (MFCC) [9]. Especially, there are some previous researches thatMFCC is applied not only to instrument tone but to various sounds, such as forest sound[10], and heart sound [11]. In addition, nowadays, there are previous researches using adeep convolutional neural network [12].Herein, the sound source is identified using frequency spectrum data. First, a sound

source comprising a single instrument is prepared: e.g., a piano, a synthesizer, an acousticguitar, an electric guitar, and an electric bass. Next, the frequency spectra of theseinstruments are calculated via fast Fourier transform (FFT). Finally, these frequencyspectra are used for a feature value of machine learning, and the type of instrument isidentified using a neural network.There have been previous studies on the identification of instruments using neural

networks [13,14]. These previous studies have used frequency spectra as a feature, butthese previous studies have identified a single sound source. The key point of our studyis to identify sources from mixed sources using a single-layer neural network, which isrelatively easy to machine learning, and this is a major difference from previous studies.If a relatively simple model such as the single-layer neural network in this manuscriptcan be used to successfully identify sound sources, it is found that the identification ofsound sources can be achieved without using difficult models or high-specification PCs,suggesting that the realization of sound source identification and autoscore system will beeasy. In addition, it is difficult to create the sound dataset; thus, it is much better if thesound source can be identified with a small number of the sound dataset. In our study, itis also shown that the sound source can be identified with a small number of the sounddataset, and this is the second key point of our study.This article is organized as follows. Section 2 describes the experiment, focusing on

the preparation of sound data and the neural network used herein. Section 3 explains theresult of the experiment. Section 4 describes the discussion based on the result of theexperiment, and Section 5 summarizes the study.

2. Experiment.

2.1. Preparation of sound data. For acquiring the data used in the experiment, theloop sound source of “AppleLoops”, included in “Logic Pro X” by Apple Inc., was used.One loop of each sound source, i.e., the piano, synthesizer, acoustic guitar, electric guitar,and electric bass, was recorded in .wav file format. Sound data obtained from the piano,synthesizer, and acoustic guitar formed the stereo sound source, whereas the electric guitarand electric bass formed the monaural sound source. Figure 1 shows the sound wave ofeach instrument. In Figure 1, the dark gray line represents the sound of the left channel,and the light gray line represents the sound of the right channel. Figures 1(d) and 1(e)show only the light gray line because their sound sources are monaural. Next, to increasethe training data, we divided each .wav file into individual one-second data. Table 1

Page 3: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145

Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer(c) acoustic guitar, (d) electric guitar, and (e) electric bass

shows the data number of each instrument after being divided into individual one-seconddata. Next, FFT was applied to these prepared sound data. To analyze the signals fora short time, the signals were cut within a frequency range. Notably, the shape of thefrequency spectrum changed according to the time the signals were cut. Thus, the signalswere cut after the window function, whose amplitude gradually decreases, was multiplied.The Hamming window function was used for this purpose and the spectrum was analyzedaccordingly. The spectrum was accurately analyzed by applying the window function.Figure 2 shows the shape of the sound spectrum after FFT was applied to the soundsource of each instrument. The length of the time window was calculated by dividing thesampling FFT points by sampling frequency; the frequency resolution is the reciprocalof the length of the sampling window. Table 2 shows the details of the signal processingconducted in the experiment.

Page 4: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

2146 Y. TAKITANI AND T. ARAKAWA

Table 1. Number of files of each instrument

Instrument No. of files

Piano 1,898

Synthesizer 1,137

Acoustic guitar 782

Electric guitar 4,009

Electric bass 1,929

Figure 2. Shape of the sound spectrum

Page 5: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2147

Table 2. Signal processing specifications

Sampling frequency 44,100 [Hz]

Quantization bit # 16 [bit]

Frequency analysis method FFT

FFT sampling points 1,024 [points]

Length of the sampling window 23.2 [ms]

Frequency resolution 43.1 [Hz]

From the result of the calculation of the frequency spectrum, as presented above, itwas found that the maximum value of the spectrum is different among the various soundsources. Thus, the amplitude of the frequency spectrum was normalized, such that theminimum amplitude value is 0 and the maximum amplitude value is 1 in the frequencyspectrum. The normalized frequency spectrum of the sound source was calculated ac-cording to the above-described process, and the labels of instruments were attached toeach data. The above process for the preparation of sound data is summarized as follows.

1) Datasets of each instrument were created.2) The data were divided into individual one-second data.3) The data, recorded from the stereo sound source, were converted to a monaural

sound source.4) Then, they were divided into data for training and data for testing.5) The spectrum was analyzed via FFT, and the frequency spectrum was calculated.6) The amplitude of the frequency was normalized.7) Labels of each instrument were attached to the data.

2.2. Learning and estimation of the frequency spectrum via a single layer neu-ral network. A single-layer neural network was implemented to classify the sound sourceof each instrument using a normalized frequency spectrum, which is calculated by themethods introduced in Section 2.1, as training data. TensorFlow 1.4.0, by Google Inc.,was used for the open-source framework of machine learning. In the experiments, 1,024arrays calculated by normalizing the frequency spectrum were used as input data. Table 3shows the construction of the neural network. 200 data values, were picked up randomlyfrom each instrument data as shown in Table 1, and used for training data; 100 datavalues, picked up randomly from each instrument data shown in Table 1, were used fortesting data of the constructed single-layer neural network. Notably, only 200 data valuesfrom the total sound data of each instrument, shown in Table 1, were small for being usedas test data. However, creating the sound test dataset, as described in Section 2.1, is adifficult task. Therefore, it would be better to identify sound sources with only a smallnumber of sound data. Multiple instrument data, not single instrument data, are usedfor training and testing data because the estimation and distinction of each instrument

Table 3. Construction of the neural network

# of the intermediate layers 1

# of the nodes in the intermediate layer 4,096

Optimization method Adam

Learning rate 0.0001

Activation function sigmoid function

Page 6: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

2148 Y. TAKITANI AND T. ARAKAWA

Table 4. Calculation circumstances

PC macbook Pro

OS macOS High Sierra 10.13.2

CPU Intel Core i5 2.9GHz

Memory 8GB 2133 MHz LPDDR3

are the purposes of this study. In this study, the calculation was stopped after 2,000iterations. The calculation circumstances of this study are listed in Table 4.

3. Result.

3.1. Single classification. In this study, five types of instruments were used. First,to verify the estimation accuracy of the sound of each instrument, the sound of eachinstrument is applied to the neural network. Here, the sound data of a single instrumentwere used for testing data, and the accuracy of the classification was evaluated. The resultis shown in Figure 3. Considering Figure 3, the estimation accuracy of electric bass seemsto be the highest and followed by synthesizer, electric guitar, piano, and acoustic guitarin that order.

Figure 3. Result of a single classification

In this paper, the neural network used only 200 training data, which were randomlychosen, and the evaluated result of the single classification seems to be well appropriate.Thus, it is suggested that the classification of a single instrument needs not many soundsources to identify each instrument.

3.2. Classification of two types of instruments. Next, it was verified whether thesound data could be identified as two types of instruments by using the data of two typesof instruments for testing data. It was verified that the sound of each instrument was

Page 7: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2149

rightly estimated, and distinguished under sound data of some instruments were mixed.Here, the result of estimation and distinction under the sound of two mixed instrumentswere explained.

There are ten combinations of choosing two instruments from piano, synthesizer, acous-tic guitar, electric guitar, and electric bass. These classification experiments were doneconsidering all combinations, and the result is shown in Figure 4. In Figure 4, the esti-mation accuracy of the electric bass is the highest and followed by a synthesizer, electricguitar, piano, and acoustic guitar in that order. This result is the same as that shown inthe previous subsection.

Figure 4. Result of classification to two types of instruments

The relation of iteration and estimation accuracy was verified by classifying two differentinstruments as shown in Figure 5. This accuracy saturated after approximately 1,000times.

3.3. Classification accuracy. In the former subsection, the results on single classifica-tion and classification to two types of instruments were shown. Finally, the classificationof more than two instruments was verified. Figure 5 shows that the relation betweenthe combination of the instruments and the percentage of correct estimation could notbe described; thus, it verified the relation between iteration of learning and the averagepercentage of correct estimation. According to the result shown in Figure 5, it was foundthat the identification accuracy gets worse as the number of classified instruments in-creases. The identification accuracy of classification to two and five types of instrumentsis approximately 80% and 40%, respectively. Thus, the smaller the number of classifiedinstruments, the better the identification accuracy.

Page 8: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

2150 Y. TAKITANI AND T. ARAKAWA

Figure 5. Estimation accuracy of each classification

4. Consideration. From the result of the experiments, we found that the frequencyspectrum identifies the sound source of instruments after learning by neural networks.Though only the frequency spectrum was used for training data in the experiments ofthis paper, the shape of the frequency spectrum of piano and acoustic guitar, synthesiz-er, and electric guitar resembles. Thus, this resemblance in the shape of their frequencyspectrum makes it difficult to identify the sound of the instruments. Here, we discuss thecharacteristics and classification accuracy of each instrument from the following consid-erations.

4.1. Piano. The extent of the pitch of a piano is wide, and the sound of the bass rangeand high range is quite different. Thus, the sound identification of the piano was a goodresult.

4.2. Synthesizer. Synthesizer is the only electrical instrument used during the experi-ment. The voltage-controlled oscillator is a built-in synthesizer, and this oscillator createdthe basic waves, including sine wave, saw wave, triangle wave, square wave, white noise,and so on. Thus, the sound wave consists of regular waves, compared to other instru-ments’ sound waves, and it suggested that the classification accuracy of the synthesizerwas relatively high.

4.3. Acoustic guitar. In this paper, the classification accuracy of acoustic guitar wasrelatively low because the number of data sets of acoustic guitar was 782, which is relative-ly smaller than other instruments. This is due to the low acoustic guitar sound samplesof Apple Loops, compared to other instruments. Also, the low accuracy of the acousticguitar was due to the acoustic characteristics, caused by the wooden body of the acousticguitar.

Page 9: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2151

4.4. Electric guitar. In many cases, the effector is used for playing electric guitar to adddistortion component, like overdrive or distortion, to sound. In the experiment of this pa-per, there were a lot of sound sources, in which the effector like overdrive or distortion wasused. When the distortion of the sound is strengthened, the high-pitched components onthe double (overtone components) become stronger concerning the fundamentals. Thus,the graph of the frequency spectrum rises because the fundamentals and the frequenciesof the electric guitar were on the double. Considering this, the classification of the electricguitar is relatively done well.

4.5. Electric bass. From the frequency spectrum, the frequency of electric bass wasconcentrated on low frequency compared to other instruments. Thus, especially in thecase of binary classification, the classification between electric bass and other instrumentsseems to be done well.

5. Conclusions. Herein, a method of sound identification using neural network is intro-duced, and five sounds: piano, synthesizer, acoustic guitar, electric guitar, and electricbass sounds, were classified. From the result of experiments, the estimation accuracy ofthe electric bass is the highest, followed by synthesizer, electric guitar, piano, and acousticguitar, in that order.

In future research, the number of data of acoustic guitar could be increased, and thedeep neural network structure could be considered to improve the accuracy of identifi-cation. Additionally, we could verify how to improve the identification accuracy if thenumber of test data is increased.

REFERENCES

[1] K. Kanai, Metadata that satisfies end users’ search requests for music material: From the char-acteristics of music material to the application of FRBR, Journal of Japan Society of Library andInformation Science, vol.61, no.1, pp.18-28, 2015 (in Japanese).

[2] M. Goto and K. Hirata, Recent studies on music information processing, The Journal of the Acous-tical Society of Japan, vol.60, no.11, pp.675-681, 2004 (in Japanese).

[3] K. Ymamaguchi and S. Ando, Application of short-time spectral analysis to natural musical in-strument tones, The Journal of the Acoustical Society of Japan, vol.33, no.6, pp.291-300, 1997 (inJapanese).

[4] P. Masri, A. Bateman and N. Canagarajah, A review of time-frequency representations, with appli-cation to sound/music analysis-resynthesis, Organised Sound, vol.2, no.3, pp.193-205, 1997.

[5] P. Masri, A. Bateman and N. Canagarajah, The importance of the time-frequency representationfor sound/music analysis-resynthesis, Organised Sound, vol.2, no.3, pp.207-214, 1997.

[6] J. Klingseisen and M. D. Plumbley, Towards musical instrument separation using multiple-causeneural networks, Proc. of the International Workshop on Independent Component Analysis andBlind Signal Separation, Helsinki, Finland, pp.447-452, 2000.

[7] C. Wei and B. Vercoe, Folk music classification using hidden Markov models, Proc. of InternationalConference on Artificial Intelligence, 2001.

[8] K. Chen, S. Gao, P. Chai and Q. Sun, Music identification using embedded HMM, Proc. of 2005IEEE the 7th Workshop on Multimedia Signal Processing, Shanghai, China, pp.1-4, 2006.

[9] M. S. Nagawade and V. R. Ratnaparkhe, Musical instrument identification using MFCC, The 2ndIEEE International Conference on Recent Trends in Electronics, Information & CommunicationTechnology, pp.2198-2202, 2017.

[10] S. Segarceany, E. Olteanu and G. Suciu, Forest monitoring using forest sound identification, The43rd International Conference on Telecommunications and Signal Processing, pp.346-349, 2020.

[11] M. Deng, T. Meng, J. Cao, S. Wang, J. Zhang and H. Fan, Heart sound classification based onimproved MFCC features and convolutional recurrent neural networks, Neural Networks, vol.130,pp.22-32, 2020.

[12] A. Solanki and S. Pandey, Music instrument recognition using deep convolutional neural networks,International Journal of Information Technology, pp.1-10, 2019.

Page 10: TONE INSTRUMENT ESTIMATION USING SINGLE LAYER ...TONE INSTRUMENT ESTIMATION USING NEURAL NETWORK 2145 Figure 1. The sound wave of each instrument: (a) piano, (b) synthesizer (c) acoustic

2152 Y. TAKITANI AND T. ARAKAWA

[13] P. Singh, D. Bachhav, O. Joshi and N. Patil, Music instrument recognition using deep convolutionalneural networks, International Journal of Information Technology, pp.1-10, 2019.

[14] B. Toghiani-Rizi and M. Windmark, Implementing musical instrument recognition using CNN andSVM, International Research Journal of Engineering and Technology, vol.6, no.7, pp.1487-1493,2019.