Научная статья на тему 'Моделирование звука фортепьяно с использованием негармонического гребенчатого фильтра с потерями'

Моделирование звука фортепьяно с использованием негармонического гребенчатого фильтра с потерями Текст научной статьи по специальности «Медицинские технологии»

CC BY
88
105
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
полоса пропускания / полоса запирания / дисперсия / негармоничность
i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «Моделирование звука фортепьяно с использованием негармонического гребенчатого фильтра с потерями»

Electronic Journal «Technical Acoustics» http://www .ejta.org

2008, 17 Varsha Shah1, Rekha S.Patil2

1 Rizvi College of Engineering, Bandra, Mumbai, India, varsha_shah_1@rediffmail.com

2 Principal, D.Y.Patil College of Engineering, Talsande, Kolhapur, prekha46@yahoo.com

Virtual piano using inharmonic dispersion tunable comb filter

Received 25.08.2008, published 14.11.2008

An excitation/filter system of inharmonic sound synthesis signal is presented with an application to piano, a stiff string instrument. Specific features of the piano string important in wave propagation, dispersion due to stiffness, frequency dependent losses, presence of phantom partials and thump noise are included in the proposed model. The modified narrow bandpass filter is used as a basic building block in modeling the vibrating structure. The parallel banks of narrow band pass filters known as Inharmonic Dispersion Tunable Comb filter is used to model the dispersion. The center frequencies of narrow bandpass filters can be tuned to follow the same relation as the partial frequencies of piano tone. Novel loss filter is designed to implement frequency dependent losses. The resulting model is simulated using MATLAB which works as a Virtual Piano.

Keywords: bandpass, bandstop, dispersion, inharmonicity, synthesis

INTRODUCTION

Basic wave shape such as sine, square and triangle play an important role in digital signal processing applications. If we play a sine wave it is a pure tone. A real music is much more complex. A tone on a real instrument is not a single frequency but the sum of many frequencies with different amplitudes.

A complex tone can be harmonic or inharmonic. A complex signal is called the harmonic signal if all the frequencies are integer multiples of fundamental frequency f0 that is the

lowest frequency of the signal. Various harmonics of this signal can be calculated using following equation:

fn = nf0, (1)

where n is the number of harmonic.

In case of inharmonic signal the frequencies of harmonics are not exact integral multiples of the fundamental frequency. The stiffness of the strings results in inharmonic sound. For e.g. the sound waves generated from the struck or plucked type of musical instruments.

The sound of piano is inharmonic in nature [1]. Due to stiffness of the string the waves are dispersed. The partial frequencies of transverse vibration of piano string [2] are given by

fn = nfJ1 + Bn 2 , (2)

where B is known as inharmonicity coefficient given by

* = ^0^, (3)

64l T

where n is the partial number , Q is the Young’s modulus, dis the diameter of the string, lis the length of the string , T is the tension of the string.

Typical values of B for piano strings lie roughly between 0.00005 for low bass tones and

0.015 for the high treble tones.

The sound generated by the piano strings is very complicated. The sound builds up rapidly and decays slowly. Moreover, partials decay at different rates. The spectrum varies over time and differs from key to key; at the bass end over 50 partials can be extracted while at the treble end the corresponding number is only about 3 or 4. Other important phenomenon in the piano sound is the beating, which results from unison groups of strings. If multiple strings are tuned to exactly equal frequencies, no two stage decay occurs. If these are tuned to pitches more than 1 or 2 Hz apart they sound simply out of tune. In order to obtain two stage decay rate in the piano model output, one must set the tuning of the strings to some small fraction of a Hz apart (Kirk, 1959) [3]. Jaffe and Smith, 1983 used all pass interpolation method to obtain fractional tuning. Piano spectra for low-pitched notes also exhibit a number of partials known as phantom partials. These are caused by nonlinear coupling between the longitudinal and transverse vibrations of the strings and are perceptually important. [4].

This paper is primarily concerned with synthesis of inharmonic tones of piano. In this paper, a musical instrument will be said to be percussion instrument whenever the sound it produces results from the free vibration of a structure or medium that has been set into motion by a short excitation. Inharmonic dispersion tunable comb filter is presented to model stiff string of piano. Source signal for this model is assumed to be an impulse. Our contribution focuses mainly on dispersion due to stiffness, frequency dependent losses and presence of phantom partials.

1. PROPOSED DESIGN

1.1. Theory

Band pass filter can be implemented using FIR as well as IIR filters. Several simple IIR filters can be designed with first order and second order function. Systems like Digital Oscillator or Digital Resonator can be used to generate a sinusoidal wave which is a basic building block of any sound wave. To achieve the band pass filter with extremely narrow band you need to have very high order of FIR filter. Using IIR filter the band pass filter can be designed with comparatively very low order but there are limitations on the narrow width of the pass band that can be achieved.

It is necessary to find the method to get the narrower pass band generating a sine wave as an impulse response which can be used as basic building block in synthesis process of

musical sound. Transfer function of bandpass filter is modified in the proposed method. Transfer function of bandstop filter is given by equation (4) [5].

HBS ( z) =

(1 + a)(1 - 2ßz - + z -2) 2(1 - ß(1 + a) z - + az ~2 )

®0 = COS 1 ß .

The pass band width is given by A® = cos-1

(1 + a)

(4)

(5)

(6)

Conventionally bandpass filter response is equivalent to the inverse response of bandstop filter. Using the fact that inverse system corresponding to a transfer function H (z) is denoted

by H _1(z) and is defined as

H -1( z ) =

H ( z)

(7)

The modified transfer function of the second order bandpass filter can be written as

H

mod ifiedBP

2(1 -ß(1 + a)z 1 +az 2) (1 + a)(1 - 2ßz - + z-2)

Figure 1 shows the structure of modified bandpass filter.

(8)

1.2. Design of inharmonic dispersion tunable comb filter and loss filter

The modified narrow bandpass filter is used in modeling vibrating string of piano. The model consists of bank of these filters. The center frequencies of Inharmonic Dispersion Tunable Comb Filter are tuned to follow the same relation as the partial frequencies of equation (2).

1

p

The partials of piano tone decay at different rates and the higher partials die down at a faster rate. Frequency dependent losses [6] are further incorporated using modified loss filter design.

The single pole loss filter is designed to generate a decaying envelope. The rate of decay depends on the relative partial number. The transfer function of novel single pole loss filter which is designed to have impulse response of decaying amplitude is

Hios = 1—"a-r , where a -1 (9)

1 — e z

Impulse response of every narrow band pass filter is multiplied with an impulse response of the modified single pole filter which is given in equation (9).

The value of ‘a’ is calibrated as

a = o.5( p—nd), (10)

wherep is the total number of partials, n is the number of partial of which envelope is to be obtained, d is the parameter which decides the decay rate.

The synthesized tone using above method is further processed to incorporate the effect of phantom partials. Phantom partials are obtained by multiplying the synthesized signal S (n) with one of its components Sc (n). The piano tone with phantom partials is synthesized using equation (11).

S (n) = S (n) + gS(n)Sc (n), (11)

where g is the gain.

Thump or knock noise is added using concatenating synthesis. An additional signal component is generated using FM synthesis technique. The duration of this segment is kept too small as compared to the above synthesized signal. This segment is concatenated in the beginning of the above synthesized signal.

Complete block diagram of the model of stiff string is as shown in figure 2.

Synthesized

signal

Figure 2. Block Diagram of the model of Single Stiff String

The designed Inharmonic Dispersion Tunable Comb filter with loss filter is driven by delta function which is used as a common excitation signal for generation of any piano tone. Impulse response and power spectrum of the filter are plotted to verify the inharmonic nature of the signal. Audibility test was conducted to know the quality of synthesized tones of piano. Subjects who knew about the timber quality of piano participated in the test.

2. RESULTS

Time domain representation and spectrum analysis of the synthesized tones is shown in figures 3 to 7. Fundamental frequency of the synthesized tone is set to 146.8 Hz. The effect of dispersion and frequency dependent losses present in the synthesized tones can be observed from the power spectrum and the time domain representation respectively. Figure 3 shows the decay rates of fifteen different partials of synthesized tone. Figure 4 and 5 show time domain and power spectrum of the synthesized tone without phantom partials respectively. Figure 6 and 7 show time domain and power spectrum of the synthesized tone with phantom partials respectively. Audibility tests were also conducted using synthesized inharmonic tones.

Figure 3.

Different decay rates of partials of the synthesized piano tone

Inharmonic Piano tone without phantom partials

Figure 4.

Synthesized piano tone without phantom partials with /0=146.8 Hz

Figure 5.

Power spectrum of synthesized piano tone without phantom partials with /0=146.8 Hz

Figure 6.

Synthesized piano tone with beating effect and phantom partials with fundamental /0=146.8Hz

Figure 7.

Power spectrum of synthesized piano tone without phantom partials with /0=146.8Hz

Figure 5 shows the spectrum of synthesized signal which is inharmonic and the frequency components of the spectrum are not equidistant. Figure 7 when compared with figure 5 shows the introduction of phantom partials in the synthesized tone.

Subjects who participated in the audibility tests also confirmed the effect of inharmonicity as well as phantom partials.

300 250 Inharmonic Piano tone with phantom partials

150

: -50 -100

0.5 1 1.5 2 2.5 3 3.5 4 4.5 x104

CONCLUSIONS

Inharmonic Dispersion Tunable Comb filter along with loss filter can be used to model stiff string of any musical instrument which generates inharmonic sound. The model is simulated as a virtual piano which can be used in general to study the behavior of the instrument for different parameters like inharmonicity coefficient, number of partials, decaying rate of partials, frequencies phantom components etc.

The inharmonic dispersion tunable comb filter can also be used to find the accurate onsets of the piano notes played during the song. The other application of the method is in development of automatic transcription system which extracts pitch, amplitude, duration of the note from the audio data.

REFERENCES

1. H. Fletcher, T. Rossing. The Physics of Musical Instruments, Berlin. Germany: SpringerVerlag, 1991.

2. H. Fletcher. Normal Vibration Frequencies of a stiff piano string. J. Acoust. Soc. Amer., vol. 3, pp. 203-209, 1964.

3. Kirk R. E. Tuning preferences for piano unison groups. J. Acoust. Soc. Amer., 31 pp. 1644-1648, 1959.

4. Balaz Bank, Laszlo Sujbert. A Piano model including longitudinal string vibrations. In Proc. 7th Int. Conf. Digital Audio Effects, October 2004, pp.89-94

5. S. K. Mitra. Digital Signal Processing. The McGraw Hill.

6. Balazs Bank and Vesa Valimaki. Robust Loss Filter Design for Digital waveguide Synthesis of String Tones. IEEE Signal Processing Letters, vol. 10, January 2003.

7. H. Fletcher, E. D. Blackham, R. Stratton. Quality of piano tones. J. Acoust. Soc. Amer., vol. 34, no. 6, pp. 749-761, 1962.

8. J. Chowning. The synthesis of complex audio spectra by means of frequency modulation. Journal of the Audio Engineering Society, vol. 21, no. 7, pp. 526-534, Sept. 1973.

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

9. Jean Laroche, Jean Louis Meillier. Multichannel Excitation /Filter Modeling of Percussive Sounds with Application to the Piano. IEEE Tran. on Speech and Audio Processing, vol.2, no. 2, pp 329-344, April 1994.

10. J. Rauhala, H.-M. Lehtonen, V. Valimaki. Multi-ripple Loss Filter for waveguide Piano Synthesis. in Proc. Int. Computer Music Conf., Barcelona, Spain, pp. 729-732, September 2005.

11. Julien Bensa, Kristoffer Jensen, Richard Kronald-Martinet. A Hybrid Resynthesis Model For Hammer String Interaction of Piano Tones. EURASIP Journal on Applied Signal Processing, pp 1021-1035, 2004.

12. S. C. Pei, C. C. Tseng. IIR multiple notch filter design based on allpass filter, IEEE Transactions on Circuits and Systems, vol. 44, No. 2, pp. 133-136, Feb. 1997.

13. Smith J. O., Van Duyne S. A. Commuted piano synthesis. Proc. Int. Computer Music Conf., 1995, pp. 319-326.

14. J. Rauhala, V. Valimaki. Tunable dispersion filter design for piano synthesis. IEEE Sig. Proc. Letters, vol. 13, no. 5, pp. 253-256, 2006.

15. Ashok Ambaradar. Analog And Digital Signal Processing, Thomson, 1999.

i Надоели баннеры? Вы всегда можете отключить рекламу.