I have a long audio file (in wav) and a short audio file (in wav) that has been copied from the long file. Now I need to find the correct location where the short signal has been copied from. I tried to compare the sample data but for some reason (possibly resampling or introduction of short fades) it doesn't match up. What is a good and fast way to solve this?
If you are trying to find a signal inside another signal, Correlation is a useful technique. You will get a large peak anywhere the signals match. The easiest way to do it is to flip the shorter signal, such that samples 0 & N-1 are swapped, 1 & N-2, etc, then convolve the two signals. This should attenuate any effects of noise or edge condition resulting from resampling or fades, unless the phase data got mangled, in which case you’ll probably need something more sophisticated.