I am new to signal preprocessing, I read about mel_spectrograms, MFCC's. Now I want to apply it and use the CNN model, But the data which I have for practice is having audio of different durations, now because of this, the mel_spectrograms will be of different shapes. for using them as inputs, the model requires inputs to have a fixed shape. So, what should I do to make them have a specific shape??
In this case, usually, Normalization is done. For example in your training and testing data, you need the same shape, so that you should try something like,
mean = np.mean(X_train_features, axis=0) std = np.std(X_train_features, axis=0) X_train_features = (X_train_features - mean)/std
X_train_features can be a data frame of spectrogram or mfcc features.
The same thing you can apply for testing features. One thing to remember is the number of columns in shape of training and testing should be the same.
You can also check some Kaggle kernels which are related to Audio processing.