Here is my understanding of your problem:
- You have a set of recorded audio files stored using a lossless audio format.
- I will assume that no saturation/clipping occured during the recording process, and that initially, all recorded tracks had some headroom.
- A first subset of them, which I call "N", have been normalized, i.e. a constant gain was applied to the signal so that the maximum peak of amplitude reaches a target value. The normalization process does not change the perception of the sound, except for the volume.
- A second subset of them, which I call "L", have been hard limited, i.e. most of the signal is left untouched, except for the part near a target amplitude value. In that area, a dynamic gain was applied locally to prevent the signal from going over the target value. The hard limiting process can result in audible distortion in some cases.
- I will assume that the target value:
- is the same for all files;
- is the same for normalization and hard limiting.
- You want to:
- be able to determine if a file belongs to L or N by analysing its content;
- automate that task.
Among the L set, depending on the initial signal content, there are two kinds of files:
- the "L0" set : files whose signal was left unchanged because it was not "loud" enough to trigger the limiter.
- the "L1" set : files whose signal was altered by the limiter.
You should be able to determine if a file belongs to L0 by looking at files with a peak of amplitude below the target value. Other files belong either to N or to L1.
The tricky part is to distinguish L1 files from N files, and I would be tempted to say that there is no solution that would work in all cases. Especially as the signals involved here are "songs", which can be quite different from one another, and may have already undergone a number of processes, and may or may not exhibit saturation or limitation...
In a favourable case where the different signals have similar statistical characteristics, we could make the assumption that L1 signals, in the surroundings of the target amplitude, are more flattened/squashed than the N signals. As a consequence, we could try this:
- Put aside files belonging to L0, as seen above.
- For every other file, compute a histogram of the absolute amplitude of all audio samples whose amplitude is in the surroundings of the target amplitude (the "height" of the surroundings has to be chosen empirically, or by knowing how the hard limiter behaves).
- L1 files should have an histogram with more high amplitude values than N files.
The same idea could be rephrased that way: L1 files contain many "almost clipped" parts in their signal, compared to N files that do not (considering the assumptions made above).
So if we could "de-clip" all these files, the "de-clipped" version of the L1 files should have a new maximum peak of amplitude quite higher than the previous one, due to the reconstructed parts going clearly above the target limiting amplitude. On the contrary, the difference should be null or negligeable for files in N.
As the success of this method relies mostly on having a good/smart "de-clipping" algorithm, here are some leads:
Although I was not able to provide a turnkey solution for your problem, I hope the detailed approach I presented here will help you get to one.