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

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

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,\dots ,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 ${x}_{k}$ and ${y}_{k}$ for $k=1,\phantom{\rule{thinmathspace}{0ex}}\dots ,\phantom{\rule{thickmathspace}{0ex}}N$ are the samples of two signals, say, centroids of two pianos, their difference is

The cumulative sum of the difference ${c}_{k}$ is defined as

or

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.

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.