ispra-44

4
Simulation and Spectral Analysis of Inharmonic Tones of Musical Instruments VARSHA SHAH 1 , Dr.REKHA S. PATIL 2 Asst. Prof., Rizvi College of Engineering 1 , Principal, J.J.Magdum College of Engineering 2 University of Mumbai 1, Shivaji University 2 INDIA Abstract: - Simulation and spectral analysis of harmonic and inharmonic pure tones of musical instruments is undertaken. It is shown how the basic wave such as sine can be used to simulate various harmonic and inharmonic sound signals of different instruments generating different timbres. It is shown that even the modest value of inharmonicity coefficient is sufficient to raise the frequency of inharmonic spectrum by a partial step more than that of the harmonic spectrum thus deviating the spectrum from strictly harmonic case. Listening tests of the simulated tones are also conducted which proves that the perception of inharmonicity depends on the number of partials present in the sound. Keywords: - Inharmonic Signal, Inharmonicity, Partial, Synthesis, Spectrum Analysis. 1. Introduction Basic wave shape such as sine, square and triangle play an important role in digital signal processing applications. Various synthesizing techniques use these waves to simulate the sound wave. Various synthesizing techniques are classified in the following manner [2] i) Additive Synthesis: In this method each sound signal is represented by linear combination of sinusoids i.e. with variable frequency and amplitude over time. ii) Frequency modulation synthesis (or FM synthesis): It is a form of audio synthesis where the timbre of a simple waveform is changed by frequency modulating it with a modulating frequency that is also in the audio range, resulting in a more complex waveform and a different- sounding tone.[3] iii) Subtractive synthesis: It is technique which creates musical timbres by filtering complex waveforms generated by oscillators. Subtractive synthesis is usually (but not exclusively) associated with analog voltage controlled synthesizers. It can produce very natural changes in a sound, owing to the intuitive way in which it works. iv) Wavetable Synthesis: It is used in digital musical instruments (synthesizers) to produce natural sounds. The sound of a existing instrument sampled and stored inside a wavetable. By repeatedly playing samples from this table in a loop the original sound is imitated Additive synthesis method is widely used in synthesizing musical simple musical tones. We have used the said method to generate simple as well as complex harmonic and inharmonic musical tones by incorporating the inharmonicity coefficient. 2 2 Difference Harmonic and Inharmonic Tones A simple tone has only one frequency, while the complex tone consists of one or more simple tones. A complex tone can be harmonic or inharmonic. A complex signal is called the harmonic signal if all the frequencies of partials are integer multiples of fundamental frequencies that is the lowest frequency of the signal. Various harmonics of this signal can be calculated using following equation: Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08) Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08) ISSN: 1790-5117 ISBN: 978-960-6766-44-2 261 University of Cambridge, UK, February 20-22, 2008

description

exp

Transcript of ispra-44

Page 1: ispra-44

Simulation and Spectral Analysis of Inharmonic Tones of Musical Instruments

VARSHA SHAH 1, Dr.REKHA S. PATIL 2

Asst. Prof., Rizvi College of Engineering 1, Principal, J.J.Magdum College of Engineering 2

University of Mumbai 1, Shivaji University 2 INDIA

Abstract: - Simulation and spectral analysis of harmonic and inharmonic pure tones of musical instruments is undertaken. It is shown how the basic wave such as sine can be used to simulate various harmonic and inharmonic sound signals of different instruments generating different timbres. It is shown that even the modest value of inharmonicity coefficient is sufficient to raise the frequency of inharmonic spectrum by a partial step more than that of the harmonic spectrum thus deviating the spectrum from strictly harmonic case. Listening tests of the simulated tones are also conducted which proves that the perception of inharmonicity depends on the number of partials present in the sound. Keywords: - Inharmonic Signal, Inharmonicity, Partial, Synthesis, Spectrum Analysis.

1. Introduction Basic wave shape such as sine, square and triangle play an important role in digital signal processing applications. Various synthesizing techniques use these waves to simulate the sound wave.

Various synthesizing techniques are classified in the following manner [2] i) Additive Synthesis: In this method each sound signal is represented by linear combination of sinusoids i.e. with variable frequency and amplitude over time. ii) Frequency modulation synthesis (or FM synthesis): It is a form of audio synthesis where the timbre of a simple waveform is changed by frequency modulating it with a modulating frequency that is also in the audio range, resulting in a more complex waveform and a different-sounding tone.[3] iii) Subtractive synthesis: It is technique which creates musical timbres by filtering complex waveforms generated by oscillators. Subtractive synthesis is usually (but not exclusively) associated with analog voltage controlled synthesizers. It can produce very natural changes in a sound, owing to the intuitive way in which it works.

iv) Wavetable Synthesis: It is used in digital musical instruments (synthesizers) to produce natural sounds. The sound of a existing instrument sampled and stored inside a wavetable. By repeatedly playing samples from this table in a loop the original sound is imitated Additive synthesis method is widely used in synthesizing musical simple musical tones. We have used the said method to generate simple as well as complex harmonic and inharmonic musical tones by incorporating the inharmonicity coefficient.

2 2 Difference Harmonic and Inharmonic Tones A simple tone has only one frequency, while the complex tone consists of one or more simple tones. A complex tone can be harmonic or inharmonic.

A complex signal is called the harmonic signal if all the frequencies of partials are integer multiples of fundamental frequencies that is the lowest frequency of the signal. Various harmonics of this signal can be calculated using following equation:

Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08)Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08)

ISSN: 1790-5117 ISBN: 978-960-6766-44-2 261

University of Cambridge, UK, February 20-22, 2008

Page 2: ispra-44

fn = nf0 equation (1)

Where n = number of harmonic

In case of inharmonic signal the frequencies of harmonics are not exact integral multiples of the fundamental frequencies. Hence they are called as partials [7] .For e.g. the sound waves generated from the struck or plucked type of musical instruments such as piano. This is due to the stiffness of the strings of the instrument. The various partials can be calculated using the equation of the stretching partials of piano tones which relates the partial frequency, fn, with the fundamental frequency f0 in the presence of an inharmonicity coefficient B [1].

fn=nf0(1+Bn2)0.5 equation (2) B = π 3 Qd4/ ( 64l2T) equation (3)

Where n = partial number Q = Young’s modulus, d = the diameter l = the length T = the tension of the string f0 = fundamental frequency

Typical values of B for piano strings lie roughly between 0.00005 for low bass tones and 0.015 for the high treble tones.[7] Timber is that parameter of the sound wave which allows us to differentiate the sounds of two different instruments of same pith and the amplitude.

3 Implementation of Simulation of Musical tones Simulation of complex inharmonic tones: Harmonic and inharmonic signals were generated by varying number of partials, fundamental frequency & inharmonicity coefficient. Initially simple tones of single frequency are simulated. Equation 1 is used to simulate complex harmonic sound of a musical instrument viz. harmonium which consists of more than one frequency. Equation 2 is used to simulate complex inharmonic pure tones of musical instrument viz. piano. The inharmonicity

coefficient was varied in the range of 50. 10-6 to 600. 10-6. The numbers of partials present in the sound were also varied in the range of 5 to 25. Different fundamental frequencies in the range of 30 Hz to 1500Hz were used to simulate harmonic and inharmonic signals. To simulate and analyze signals and their spectrums MATLAB 6.5 software and its toolboxes are used.

4 Spectrum Analysis of Simulated Tones Various simulated sounds are analyzed by plotting their frequency spectrums using DSP technique. Graphical representation of various spectrums is shown. They are as follows: 1. Figure 1 to 4 show frequency spectrums of 2 different sets of harmonic and inharmonic signals. In this the tones are generated by keeping inharmonicity coefficient constant = 300*10^-6, number of partials=25 for two different fundamental frequencies of 100Hz and 200Hz.

b=300 * 10^-6; No. of partials: 25 Fig.1: Harmonic with fun.freq. = 100; Fig2: Inharmonic with fun.freq. = 100; Fig.3: Harmonic with fun.freq. = 200; Fig.4: Inharmonic with fun.freq. = 200; 2. Figures 5 to 8 show the spectrum of one harmonic and 3 inharmonic spectrums in which fundamental frequency is taken as 450Hz, inharmonicity coefficient is taken as 100 * 10^-6 and the number of partials are taken as 5, 15 and 30.

Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08)Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08)

ISSN: 1790-5117 ISBN: 978-960-6766-44-2 262

University of Cambridge, UK, February 20-22, 2008

Page 3: ispra-44

3. Figures 9-12 show the spectrums of 1 harmonic signal and 3 inharmonic signals. Inharmonicity coefficients of 3 different values are selected to generate inharmonic signals. In this number of partials are taken as 25 for all the four signals.

5 Perceptual Analysis Five subjects having musical training participated in listening tests of the simulated sounds. Different harmonic and inharmonic sounds were simulated and the wave files were played to find the effects of different inharmonicity coefficients, fundamental frequencies and number of partials present in the sound. Repeated tests were conducted to confirm the subjective effect of various sounds.

6 Observations and results 6.1 Results of Audibility test i.It is the opinion of all the subject listeners that the simple notes timber sound like a broken note of any wind instrument. ii. Subjects heard various harmonics sound and found them as the pure tones generated from the wind instrument like harmonium.

[b=100 * 10^-6; fun.freq.=450Hz. Fig.5: Harmonic with no. of partials = 5; Fig 6: Inharmonic with no. of partials= 5; Fig.7: Harmonic with no. of partials=15; Fig.8: Inharmonic with no. of partials=30;

No.of partials=25; fun.freq.=80Hz. Fig.9 Harmonic signal Fig10:Inharmonic with b=50 * 10^-6; Fig.11:Inharmonic with b=200 * 10^-6; Fig.12:Inharmonic with b=600 * 10^-6; iii. After listening to the inharmonic sounds the opinion of the subjects were as follows: a. when the inharmonicity coefficient was varied by keeping the fundamental frequency constant and keeping the number of partials same the subjects heard the metallic touch to the sounds. b. They also felt that up to approximately 600*10^-6 of inharmonicity coefficient with the fundamental frequency of 50 to 450 Hz the inharmonic sound was pleasant to hear than harmonic one. 6.2 Results of Spectral Analysis of the Simulated Signals i. It is observed that even the modest b of 300*10^-6 increases the frequency of the inharmonic spectrum by a partial step. It is observed from figure 1 and figure 2 that due to inharmonicity the frequency of the inharmonic spectrum deviates in such a way that frequency of 20th partial of harmonic signal is shifted to 21st partial in case of inharmonic signal. ii. It is observed from figures 5 to 8 that as the fundamental frequency increases keeping the inharmonicity coefficient constant the deviation of the spectrum from the strictly harmonic case also increases. iii. It is observed in figures 9 to 12 that as the inharmonicity coefficient increases the deviation of the frequencies of the spectrum of inharmonic signal also increase & the

Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08)Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08)

ISSN: 1790-5117 ISBN: 978-960-6766-44-2 263

University of Cambridge, UK, February 20-22, 2008

Page 4: ispra-44

spectrum moves away from the strictly harmonic case.

7 Conclusion It was seen from the analysis of simulated musical tones that the inharmonic sound is found to be natural than the harmonic sound if adequate amount of inharmonicity is present. It is also observed that if inharmonicity is introduced the partial frequencies are deviated from their harmonic values. It is concluded that if the inharmonic signal is found to be unpleasant due to higher value of inharmonicity some method has to be adopted to reduce this deviation of spectrum from harmonic to inharmonic nature. Reference: [1] Robert W.Young, “Inharmonicity of Plain Wire Piano Strings” The Journal of the Acoustical Society of America, Volume 24, No. 3, MAY 1952 [2] http://en.wikipedia.org/wiki/synthesis [3]J. Chowning, "The Synthesis of Complex Audio Spectra by Means of Frequency Modulation," Journal of the Audio Engineering Society 21(7), 1973 [4] Askill, Jhon, “Physics of Musical Sounds”. [5]H.A.Conklin, “Generation of partials due to nonlinear mixing in stringed instruments”,J.Acoust.Soc.Am.,vol.105,no.1,pp.536-545,1999. [6]Alexander Galembo and Aders Askenfelt “Signal representation and Estimation of spectral parameters by inharmonic comb filter with application to the piano” IEEE Tran. on Speech and Audio Processing, vol.7, No.2, March 1999, 00 197-2020 [7] J. O. Smith, Physical Audio Signal Processing: Digital Waveguide Modeling of Musical Instruments and Audio Effects, http://ccrma.stanford.edu/~jos/pasp04/, August 2004. [8]Dai, H. (2000), ‘On the relative influence of individual harmonics on pitch judgment’, J. Acoust. Soc. Am 107(2), 953-959

[9] V. Valimaki, M. Karjalainen, T. Tolono, and C. Erkut, “Nonlinear modeling and synthesis of the kantele – a traditional Finnish string instrument,” in Proc. Int. Computer MusicConf., (Beijing, China), pp. 220–223, 1999. [10] Serra, X. and Smith, J. O., 1990. "Spectral Modeling Synthesis: A Sound Analysis/Synthesis System Based on a Deterministic plus Stochastic decomposition", Computer Music J., Vol. 14, No. 4, pp. 12-24. [11] Horner, A. 2000. "Low Peak Amplitudes for Wavetable Synthesis," IEEE Transactions on Speech and Audio Processing, 8(4), 467-470. [12] H. Fletcher, E. D. Blackham, and R. Stratton,“Quality of piano tones,” J. Acoust. Soc. Amer., vol. 34, no. 6, 1961.

Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08)Proceedings of the 7th WSEAS International Conference on SIGNAL PROCESSING, ROBOTICS and AUTOMATION (ISPRA '08)

ISSN: 1790-5117 ISBN: 978-960-6766-44-2 264

University of Cambridge, UK, February 20-22, 2008