← Back to context

Comment by PaulDavisThe1st

2 hours ago

Theoretically, it makes sense (go look at any of the diagrams of what a "zero crossing" is online, and it totally does.

The problem is that sign(x[n-1]) != sign(x[n]) describes a place where two successive samples differ in sign, but no sample is actually has a value of zero. Thus, to perform an edit there, if your goal is to avoid a click by truncating with a non-zero sample value, you need to add/assign a value of zero to a sample. This introduces distortion - you are artifically changing the shape of the waveform, which implies the introduction of all kinds of frequency artifacts.

Zero crossings are not computed by finding a minimum between two consecutive samples - that would almost never involve a sign change. And if they are computed by finding the minimum between two consecutive samples that also involves a sign change, there's a very good chance that you'll be long way from your desired cut point, even if you ignore the distortion issue.

It really was a completely misguided idea. If the situation was:

     sign(x[n-2) != sign(x[n]) && x[n-1] == 0

then it would be great. But this essentially never happens in real audio.