I am trying to implement a deep learning classification solution for (1 second long) audio signals recorded at a very high sample rate, i.e. 2 MHz. All the material and tutorials that I could find work mainly in the human audible range so they are mostly relevant for relatively low sample rates.

Since I am new to audio feature extraction and processing, I cannot wrap my head around all these parameters used in librosa. I don't have a lot of data either so I want to extract the maximum amount of non-redundant information from these signals.

  • n_mfcc, n_mels, n_fft
  • hop_length, win_length

In what ratio or relation to one another should these be used? Given the length (1s) and sample_rate (2MHz), what values for these parameters should I start with?

I have tried the often used values for n_mfcc (20, 40), n_mels (32, 64, 128), n_fft (1024, 2048, 4096), hop_length (256, 512, 1024, 2048) etc. but am not sure if I am getting the most out of these signals.

The primary focus is on spectral features like Mel Spectrogram and MFCCs to be used as inputs for the models. Please recommend what the most sensible values for these parameters in this context should be.

The log magnitude of the FFT spectrum of an example signal.

  • 1
    $\begingroup$ Why is audio sampled at 2 MHz? What is the audio source, and does it even have frequencies beyond the audio frequency range (about 20 kHz)? $\endgroup$
    – Justme
    Jun 29, 2023 at 13:35
  • $\begingroup$ @Justme because it's recorded by a HQ microphone (experimental R&D product). Although smaller in amplitude it does capture higher frequencies (like ultrasound). $\endgroup$
    – phydev
    Jun 29, 2023 at 13:59
  • 1
    $\begingroup$ @phydev: regardless of what the microphone can do: Does the signal actually contain ultrasound or is it "normal" audio. It's pointless trying to extract features from a spectrum that's mostly 0. $\endgroup$
    – Hilmar
    Jun 29, 2023 at 15:40
  • $\begingroup$ @Hilmar It's normal audio plus more (higher modes etc.). I wouldn't say it's mostly 0. I added a log plot of the frequency spectrum for reference. By ultra-sound, I meant high frequency (2Mhz) and the idea is, perhaps, the higher frequency modes differ in some subtle manner such that it can help classify the signals with reasonably good accuracy. That's what I am trying to capture from the features (whatever those might be). $\endgroup$
    – phydev
    Jun 29, 2023 at 22:05
  • $\begingroup$ I am definitely not an expert on Music Information Retrieval (MIR) or Machine Learning (ML) but I believe you should start with the usual values for your intended application. If it is speech for example, try to use the values suggested in the literature. These are supposed to be application dependent and not sampling rate dependent so they should act as a good starting point. If you come across technical difficulties, or after you get some initial results you may tweak the values. $\endgroup$
    – ZaellixA
    Jun 30, 2023 at 21:50


Your Answer

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