Maximum sample rate for CNN training #1184
|
Hello, By default, when training a custom CNN, without modifying the preprocessor, the native sample rate of the audio files is taken and therefore the spectrograms images are comprised between 0 and fs/2, am I correct? There is no resampling of band-pass filtering by default right? Does this hold even for ultrasonic recordings where fs can be up to 256kHz or even higher? Thank you, |
Replies: 2 comments
|
Hi Maxime, The current default behavior is no audio resampling, but cropping spectrograms to the frequency range 0-11,250 Hz The reasoning for this is that audio resampling is computationally expensive, but I have considered changing the default behavior since users may assume audio will be resampled to a constant rate. You can set the preprocessor to resample audio: model=CNN(...)
model.preprocessor.pipeline.load_audio.set(sample_rate=32000)and/or can modify or disable spectrogram bandpass similarly: model.preprocessor.pipeline.bandpass.set(min_f=0, max_f=16000)
# or turn off spectrogram cropping
model.preprocessor.pipeline.bandpass.bypass = TrueSee the preprocessing tutorial for more detailed work-through of customizing preprocessing, and let me know if you have further questions Best, |
|
Thank you Sam, Maxime |
Hi Maxime,
The current default behavior is no audio resampling, but cropping spectrograms to the frequency range 0-11,250 Hz
opensoundscape/opensoundscape/preprocess/preprocessors.py
Line 548 in 2f14a07
The reasoning for this is that audio resampling is computationally expensive, but I have considered changing the default behavior since users may assume audio will be resampled to a constant rate.
You can set the preprocessor to resample audio:
and/or can modify or disable spectrogram bandpass similarly: