I am trying to find a way to compare the likeness of short 500 millisecond recordings using MATLAB of the same note played on different instruments.
Going into detail on this specific topic: I am a music student that has been given the task to objectively determine the tone of various modern low brass instruments to determine what instrument should replace the obsolete "ophicleide" or Bass keyed bugle. I first used a visual comparison of a spectrograph of it and 6 other instruments, but that approach was too subjective.
I recorded all of the instruments with the same microphone, equipment, gain levels, and the same notes. For this reason, I believe that the signals are similar enough to use MATLAB tools.
I believe that comparing the fft
is going to be the most accurate calculation. I tried at first a freq-domain correlation, and tested different segments of the same tone (eu
, and eu2
being variables)
>> corr(abs(fft(eu)),abs(fft(eu2)))
ans = 0.9963
Which is a step in the right direction, but I seem to get the opposite result when I compare different signals: (euphonium and ophicleide sound almost identical)
>> corr(abs(fft(eu)),abs(fft(ophi)))
ans = 0.5242
euphonium and bass clarinet sound completely different, but this shows higher correlation
>> corr(abs(fft(eu)),abs(fft(basscl)))
ans = 0.8506
I tried a normalized maximum cross-correlation magnitude formula that I found online, but I am getting the same results
>> norm_max_xcorr_mag = @(x,y)(max(abs(xcorr(x,y)))/(norm(x,2)*norm(y,2))); x =eu2; y = eu; norm_max_xcorr_mag(x,y)
ans = 0.9638
I get a similar result when comparing the other samples
>> norm_max_xcorr_mag = @(x,y)(max(abs(xcorr(x,y)))/(norm(x,2)*norm(y,2))); x = eu; y = basscl;
ans = 0.6825
compared to
>> norm_max_xcorr_mag = @(x,y)(max(abs(xcorr(x,y)))/(norm(x,2)*norm(y,2))); x = eu; y = ophi; norm_max_xcorr_mag(x,y)
ans = 0.3519
The Euphonium and Bass Clarinet (basscl) have a completely different sound, and completely different harmonic series, but these formulas are showing closer correlation than the Euphonium and Ophicleide, whose frequency bands look almost like an identical match.
I am worried that these correlations are showing the correlation of true pitch (I am playing the same note on all of these instruments, but the Ophicleide might be out of tune by up to 1 Hz) It could also be accounting for phase, or even total amplitude.
does anyone know of a better clear cut method in comparing the proportions of the harmonic overtones of these complex waveforms?
or am I barking up the wrong tree?