Spectral analysis is commonly used to distinguish lossless quality audio files from transcodes (the result of converting a compressed audio signal to a lossless format). This typically involves the use of software to generate a spectrogram, “a visual representation of the spectrum of frequencies of a signal as it varies with time” for further analysis. This is more of an art than a science, and it requires the user develop a sense of the telltale signs of compression algorithms, as well as various audio engineering techniques that may create confounding artifacts. Automated solutions exist—but these are prone to false positives, and should be avoided except as a means of whittling a collection down to a limited set of files to subject to individual visual inspection.
Why would anyone distribute a transcode? Although it may come about as a result of malice and deception—for example, when trading rare files—I believe that the most common cause is simply ignorance of audio formats. Although I have encountered transcodes via file-sharing applications like pretty much everyone else, I have also purchased transcodes from major download shops, likely a result of a label owner or content provider not having a good understanding of whatever source material they were working with. Although it seems ridiculous, music producers themselves are not always clear on what condition source material might be before sending it on to a label for release, and accidents certainly happen.
Whatever the cause, if you’re interested in verifying audio quality, you’ll need an application suitable for your operating system. Numerous examples exist for Windows systems but I’m a MacOS user—which greatly reduces the number of options. Spek is generally considered to be the best freeware option for spectral analysis on MacOS, but it hasn’t been updated in years and no longer works on recent versions of the operating system (although you might like to monitor the primary repo for updates). This fork provides a working version for later versions of MacOS (just check the “Releases”), but you’ll have to disable security precautions to install and use it. Using Spek is straight-forward: open the application, drag and drop audio files, and a spectrogram will be generated. If you can’t get Spek working (or don’t want to navigate disabling operating system security) you can also try your luck with Sonic Visualizer.
As for spectral analysis, transcodes will be missing the highest frequencies (approaching 22.5 kHz) and there should be obvious artifacts, depending on the quality of the original compressed audio signal. Plenty of mastering engineers cut high frequencies (as they might be inaudible anyway) so this alone is evidence of nothing; what you’re looking for is the combination of blocky, knocked-out areas of the spectrogram in addition to missing high frequencies. This guide on Reddit provides more information about frequency shelves and their relation to specific lossy algorithms. Generally speaking, I find that most transcodes really stand out, so if you’re not sure whether a track is a transcode, it’s probably safe to assume it isn’t.