I am starting with an audio signal picked up from the microphone jack of my iPhone, generated by running a standard magnetic strip ATM card through a sensor.
On an old card, there will be a few degenerate bits:

Now filtering out this damage is one issue, which I have asked here: Removing noise from F2F signal
But how to determine the integrity of a particular section of track? How could I mark a particular area as being damaged?
I basically need some measure of smoothness for any given sample. My gut feeling is to work with derivatives. Taking the derivative amplifies noise.
But I can't see it clearly. Can anyone?