Per definition, only one of the arrays from which the cross-correlation is calculated needs to be zero-padded. The other array can be zero padded too, but it's not necessary.
Currently, the cross_correlation function zero-pads both arrays. Knowing that downloading the YouTube audio is usually faster than recording the desktop, this function could zero-pad only sample (the recorded audio), and use a full-length source.
With this change, the algorithm could theoretically be twice as fast, since it would be working with twice the size of source data.
Per definition, only one of the arrays from which the cross-correlation is calculated needs to be zero-padded. The other array can be zero padded too, but it's not necessary.
Currently, the
cross_correlation
function zero-pads both arrays. Knowing that downloading the YouTube audio is usually faster than recording the desktop, this function could zero-pad onlysample
(the recorded audio), and use a full-lengthsource
.With this change, the algorithm could theoretically be twice as fast, since it would be working with twice the size of source data.