Zero crossings across multiple tracks?


if I have two stereo tracks (or four tracks), would it be possible for Audacity to find points in the track where all four tracks cross the zero at once?

all four tracks cross the zero at once

I doubt there’s any such thing. I think mono is the only time that tools works well. In stereo the best we can do is guess at it. By the time we get to four, there are no common zero crossing points.

You can use a video trick. Video editors have to cut at even video frame boundaries no matter where the sound is, so they do very rapid fades rather than cutting. After you’ve been cutting video for a while you figure out the software is doing this and want more accurate sound cutting, but quite a number of video productions just go with the boundary fades. It’s a lot faster than exporting the track to a sound editor, recut it, import the track…etc, particularly if there’s a Producer huffing at you to hurry it up.


If all 4 tracks are selected, then Audacity will try to find a zero crossing point that is common to all tracks, but it only looks a short way forward / back from the cursor position, and chances are that no common zero crossing point will exist.

What does it do when it fails and how far off does it need to be? Does it just get as close as it can and it’s up to you to accept the cut or not? So it could be down to your speaker system or headphones? Correct me, but Audacity will not play four sound channels. Only mono or stereo.


I don’t recall the precise numbers, but the general idea is something like: it looks for the “best match to a zero crossing at the cursor position” within 10 ms either side of the cursor, where “best match” is weighted according to “absolute sample value” (closer to zero is better) and “distance from cursor position” (closer to zero is better). The maximum distance that the cursor will be moved is 5 ms. If no “close match” to a zero crossing is found within the detection window (+/- 10 ms) then it gives up and the cursor is not moved.

Obviously there are compromises regarding what is considered a “close match” and what is considered close enough to the original cursor position. The algorithm works very well for “normal audio” mono tracks, and “fairly well” with stereo tracks provided there is a high degree of phase correlation between the channels. For stereo (or more generally, multiple channels), where the phase correlation is low, zero crossing detection is doomed to failure regardless of the algorithm as there will usually be no zero crossing common to all channels close to the cursor position.