Hall_Math - Department of Mathematics and Computer Science

Download Report

Transcript Hall_Math - Department of Mathematics and Computer Science

Christopher Hall
Department of Math and Computer Science
a n mod
c 1 a n1 
...
c d a nd , 128
The aim of this project is to find a linear recurrence relation that bestrepresents the tonality of a given piece of music. Beethoven’s Sonata No. 1,
Op. 12 in D Major is our example in this project.
•
•
•
an= c1an-1 + c2an-2 + … + cdan-d
d= degree and t= the number of training data (notes)
The assumption is that the notes in the piece are generated by a
recurrence relation. The goal is to find the coefficients (ci ’s).
Only the melodic line is used; no chords. This allows the counting
of only a single note at a time.
The range of notes used is restricted to the audible range as
determined by MIDI: Z128.
The value of a single note is determined by MIDI format with middle
C being 60. All notes are sequentially valued based on their pitch
relative to the pitch of the notes immediately above and below (i.e.
if E is 20, D# is 19 and F is 21).
For d=2, the range m=3, t=4, the leastsquares algorithm must check 32 gridpoints.

0, 0 
0, 1 
0, 2

1, 0 
1, 1 
1, 2

2, 0 
2, 1 
2, 2
The degree of the recurrence relation: remember d= degree.
The range for coefficients: case 1 is where choices for c’s are in R
and case 2 is when they are in {0,1,2,…,m}.
The number of training data: t= # of training data (notes).
The best-fit solution.
The standard deviation of the original set of notes is considered the maximum
allowable error for the notes being generated by the relation.
The square root of the average of error squares are used for comparison. Only those
errors below the standard deviation are considered acceptable.
The best results are considered to be acceptable results farthest below the standard
deviation.
User inputs the desired range for coefficients and number of
training data.
Only degrees two and three are used.
The square errors are calculated in arrays for all possible
combinations of the range of coefficients.
 Errors are stored in a square matrix that was
Range(C)xRange(C) for comparison.
 The output is the coefficient vector along with the least square
error.
A graph is also generated comparing original notes to those
generated.
The ci ‘s are real numbers.
Various degrees are investigated, where d= degree.
Various numbers of training data are used, where t= # of training data.
The Least-squares Algorithm is used to find the coefficients.
A MATLAB program is developed to generate the findings.
The user enters in the desired degree for the
recurrence relation, d.
More than one can be entered at a time.
Using the Least-squares Algorithm, the program
generates square errors for a range of training
data.
A graph is generated that compares the error along
range of training data to the standard deviation.
The least error is displayed along with the
corresponding ci ‘s.
The matrices are of full rank, so the least-square
solutions are unique.
The multivariable functions used are the sums of
the error squares, the Hessians of which are
always multiples of ATA. So, the critical point is an
absolute minimum point.
This piece of Beethoven’s music is likely not a linear recurrence relation.
However, we have been able to generate approximations that are well
below the standard deviation of the original note set. The results for the
case where the c's∈ℝ are significantly better than those in {0,1,2,….m},
although the second case suggests an interesting relationship between the
range of the original note set and the results of our algorithm. Namely, in
order to generate c's other than (1,0,0), the notes must have a greater
range than they do in this piece.
Future research in the discrete case should involve writing a program that can
expand the degree beyond three. Such an endeavor, we have found, would
require a more sophisticated means of storing calculated errors. In theory, each
expanded degree would require an m×m matrix, where m is the desired discrete
range of the coefficients, whose elements are m×m matrices accommodating
data of degree d-1, and so on until the matrix is composed of individual
elements.