Jump to ContentJump to Main Navigation
Spectral Analysis of Musical Sounds with Emphasis on the Piano$

David M. Koenig

Print publication date: 2014

Print ISBN-13: 9780198722908

Published to Oxford Scholarship Online: January 2015

DOI: 10.1093/acprof:oso/9780198722908.001.0001

Show Summary Details
Page of

PRINTED FROM OXFORD SCHOLARSHIP ONLINE (www.oxfordscholarship.com). (c) Copyright Oxford University Press, 2017. All Rights Reserved. Under the terms of the licence agreement, an individual user may print out a PDF of a single chapter of a monograph in OSO for personal use (for details see http://www.oxfordscholarship.com/page/privacy-policy). Subscriber: null; date: 23 May 2017

(p.361) Appendix 3 Mathematical Basis for Part Three

(p.361) Appendix 3 Mathematical Basis for Part Three

Spectral Analysis of Musical Sounds with Emphasis on the Piano
Oxford University Press

Part 3 used the conversion between Hertz and cents extensively so I will spend some time deriving the conversion relation. The cumulative sum of the difference of spectral centroids was used to determine if there was a significant difference between two pianos. Consequently, some time will be spent on trying to demonstrate the power of this tool.

Conversion of Hertz to Cents

The concept of cents was used in Chapter 1 and again in Chapter 3. The fundamental frequency of each note in the equal temperament system (in Hz) is defined by


where n=1,,88 with n=1 denoting the lowest note on the piano, A0, and n=88 denoting the highest note, C8.

By definition there are 100 cents per semitone or 200 cents per two semitones; therefore, the number of Hz per cent, HpC, can be written as


Combining Eqs. A3.1 and A3.2 gives


Using Eq. A3.1 in Eq. A3.3 gives


Also, Eq. A3.1 can be solved for the note index when the frequency is given:


(p.362) Cumulative Sum of a Difference

If xk and yk for k=1,,N are the samples of two signals, say, centroids of two pianos, their difference is


The cumulative sum of the difference ck is defined as




The continuous time analog is


(In Chapters 1 and 3 the cumulative line spectra used a similar construction; however, it was normalized while the cumulative sum is not.)

Consider the following hypothetical example where there is a signal that could be the difference of spectral centroids for two pianos. The difference is zero for the first 40 keys (A0 to C4). For keys 41 to 60 (C4# to G5#) there is a constant difference of 0.2 Hz. Finally, keys 61 to 88 (A5 to C8) again have zero difference. Figure A3.1 looks at the noiseless signal while Figure A3.2 looks at the same signal with normally distributed noise added. The added noise has a standard deviation of 0.4 Hz, which is double the actual difference in the centroids for keys 41 to 60.

Appendix 3 Mathematical Basis for Part Three

Figure A3.1 (a) Noiseless difference of centroids, and (b) cumulative difference of the centroids

Appendix 3 Mathematical Basis for Part Three

Figure A3.2 (a) Noisy difference of centroids, and (b) cumulative difference of the centroids

When the difference between the spectral centroids is noiseless then it is clear from the plot of the difference itself when and what kind of changes have been made. When the difference is noisy (and the noise level is greater than the magnitude of the difference) it is sometimes not so clear and the cumulative sum plot can often be helpful in determining when changes take place.

In effect, the cumulative sum is a low pass filter that attenuates any signal that varies; the more it varies, the more it is attenuated. Since the sum operator and the integral operator are analogs, if the signal is constant (the difference is non-zero and constant), then the cumulative sum is a ramp. Furthermore, if the signal itself is a ramp, then the cumulative sum changes quadratically.

(p.363) (p.364) Azimuth and Elevation in Three-Dimensional Plots

Azimuth and elevation set the angle of the view from which an observer sees a three-dimensional plot. Azimuth is the horizontal rotation and elevation is the vertical elevation (both in degrees). Azimuth revolves about the z-axis, with positive values indicating counter-clockwise rotation of the viewpoint. Positive values of elevation correspond to moving above the object; negative values move below.