I have a dataset that contains a lot of recordings sampled incorrectly. This incorrect resampling could be explained in two ways:

  1. A recording S, which was recorded with a sampling rate of 16kHz, was upsampled to a sampling rate of 48kHz. This upsampled recording S was mixed with other recordings in a dataset containing recordings originally sampled at 48kHz.
  2. A recording L was recorded with a sampling rate of 16kHz, processed and saved with a sampling rate of 48kHz without resampling. This recording L was mixed with other recordings of the dataset originally sampled at 48kHz.

Given a dataset containing such incorrectly sampled files, is there an existing automated way to identify files S and L from the dataset containing millions of recordings, all originally sampled at 48kHz?

It would also be interesting to know if there is a way to identify the correct sampling rate of the file L without having any prior meta-information about it.


1 Answer 1


You could start by applying a k-means or PCA on the spectrum of the audio files.

For the high frequencies, what I would expect from your description.

  • The S recordings should have a sharp cutoff at ~8kHz.

  • The L recordings should have a sharp cutoff at ~24kHz.

  • Supposing the 48kHz contains mostly speech those should have a gradual reduction of the spectral energy after 8kHz.

If that doesn't work you could label some files manually and apply a Gaussian Mixtrure Model.

In the low frequencies (only help to distinguish between L and S not the 48kHz recordings), you could look for 50Hz/60Hz hum, or hum filter (a notch in that frequency). Some recorders will have a high pass filter but I don't that could be any frequency, so it doesn't help.

If you want to put still more energy you could have a look on vocal tract length features

  • $\begingroup$ Thanks a lot for your answer @Bob, I agree to what you've mentioned. So in my case, I have created a small CNN based classifier that detects this sharp cut-off and returns the approximate sampling rate. But, I was thinking if there's an existing mathematical way or algorithm to this, that would have been really helpful. I am still not sure about your second point, how you are detecting L as all the files are sampled at 48kHz and will be having sharp cutoff at 24kHz freq. $\endgroup$
    – thanatoz
    Commented Dec 27, 2023 at 17:37
  • $\begingroup$ They will be different, because the L set will have the spectrum stretched. A natural speech recording would have little energy above say 10kHz, but the stretched spectrum will have a significant portion of the energy above 10kHz. $\endgroup$
    – Bob
    Commented Dec 27, 2023 at 17:42
  • $\begingroup$ Very reasonable. I totally get it now. Thanks for the response again. $\endgroup$
    – thanatoz
    Commented Dec 27, 2023 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.