0
$\begingroup$

I am building an one dimensional Convolutional Neural Network and wish to feed it raw audio but it turns out that the number of samples is very larger. The audio was sampled at 48 kHz and the duration is 20 sec each which makes the number of samples = 960000. I was wondering if there was a way to reduce the number of samples.

From what I understand, the Nyquist rate governs the maximum frequency in a signal content. If I were to reduce the number of samples by resampling, the sampling rate changes so does the maximum frequency cutoff. If I resample the audio, I think that I will lose the high-frequency content.

Is my thinking correct? Are there others things that I need to consider?

$\endgroup$
2
  • $\begingroup$ Please edit your question to cut down on the jargon. I.e. -- what is CNN? Convolutional Neural Network? If so, bytes aren't free, but they're very low cost, so you can spell that out. $\endgroup$
    – TimWescott
    Jun 20 at 19:36
  • $\begingroup$ I have expanded all the abbreviations. Cheers! $\endgroup$ Jul 1 at 2:38
1
$\begingroup$

I resample the audio, I think that I will lose the high-frequency content.

If you just resample you will get aliasing, i.e. the high frequency content will wrap around and added as noise to the low frequency content. The better procedure is to low pass filter first and control the way how the high frequency content is eliminated and than resample.

The best design for this low-pass filter is highly dependent on the specific requirements of your application.

Assuming that CNN refers to a Neural Network, you may be better off doing some sort of feature extraction from the audio before feeding it to a neural network. Could be different types of spectrograms, could be envelope, could be pitch, could be formant maps, etc. Raw audio data is rarely useful in machine learning since it contains huge amounts of information most of which is often irrelevant. Some application specific pre-processing can help a lot.

$\endgroup$
2
  • 1
    $\begingroup$ I was told thirty years ago that the key to a successful neural network solution is getting the preprocessing right. AFAIK, that hasn't changed. $\endgroup$
    – TimWescott
    Jun 20 at 19:38
  • 1
    $\begingroup$ I agree with you @TimWescott. I am performing an experiment to see if it is possible to use raw audio. $\endgroup$ Jul 1 at 2:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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