Audio track subtraction with compensation to timing offset

Hello,

The use case is that I would like to compare two audio tracks that use different compression methods. For example, the first track is in FLAC, the second track uses AAC compression on the first track with some parameters. I would like to see if the parameters I choose is good enough.

The way to do that currently in Audacity is to invert the second track and then mix with the first track. Then analyze and listen to the result. However, in practice different compression method and parameters will result in a different timing offset in the second track, making precise line up of the two tracks almost impossible.

Suggested new feature will take two timing offsets as parameters. Within that range, it will find a delay so the error the two track (sum of the square of difference for each data point) is minimum and then create a new track of the difference of two original tracks with that delay applied to the second track.

Thank.