The first method, as it is presented here, has a success rate of 25% on our known test cases. This is an improvement over randomly choosing a key signature for each song, but is not nearly what we'd like to see. We had attempted to improve on the algorithm in several ways, but the results were never as good as the second method in accuracy or runtime. The first way we attempted to improve this was by using Short-Time Fourier Transforms instead of FFTs, but figuring out how to use the data of each window to contribute to the overall categorization proved challenging. Also, we had thought that the impulses being at specific frequency values might be detrimental to the accuracy of the program, as not all instruments are tuned to the exact same frequencies, but this did not prove to be a factor that affected the accuracy in a non-negligible manner. Additionally, we noticed that the FFTs of the cosines were not all impulses of the same height, which was having an effect on the values of the coefficients for each key signature. Attempts to resolve this issue were devastating to the program's runtime, and as the full program with the computation of the MFCC coefficients already had a long runtime, so ultimately this method was abandoned for the final version of the project in favor of the second method.
We our second algorithm against 8 clips of known key signatures (some with accidentals for robustness testing) and it successfully named 7 out of 8 of them (87.5%). It appears to be pretty accurate overall. For algorithm drawbacks, navigate to Cross Correlation Method under the Algorithms Heading and scroll to the bottom.
Above is a table of our resulting tests. We were able to very accurately evaluate the key signature of a song using the cross correlation method. Our only failure was with the B Flat Major, which the algorithm believed was E Flat Major. Luckily, these Key Signatures only differ by one flat, where the program judged A Flat as more significant than A.
This method, I have found, is a bit finicky with certain songs. Tempo and length of song are huge factors when determining a key signature using our algorithm, and it has been known to not identify a real key signature from a song. If we play around with the sample note length, we can optimize the algorithm to output the correct frequency, but there is no perfect length for songs of all tempos. Currently, I cannot guarantee a correct key signature classification for a song.