Why does halving a floating point time series (audio) cause the noise shown in the spectogram to change?
From having a look, all the steps from getting the first half of X, stft() and amplitude_to_db() output the same values except in the last two frames closest to the halving point (which is expected but not expected to change specshow?).
So why does the graph show an increase in noise throughout the data?
Here is my code to create the two graphs:
audio_file = './nonvoice_snippets_stepvoices/t15_14steps.wav' X, sample_rate = librosa.load(audio_file) import matplotlib.pyplot as plt import librosa.display plt.figure(figsize=(15, 10)) D = librosa.amplitude_to_db(librosa.stft(X), ref=np.max) plt.subplot(4, 2, 1) librosa.display.specshow(D, y_axis='linear') plt.colorbar(format='%+2.0f dB') plt.title(audio_file)
#lets get the first half of that. half = len(X)/2 half_X = X[:half] plt.figure(figsize=(15, 10)) D = librosa.amplitude_to_db(librosa.stft(half_X), ref=np.max) plt.subplot(4, 2, 1) librosa.display.specshow(D, y_axis='linear') plt.colorbar(format='%+2.0f dB') plt.title(audio_file)
And the reason why I'm asking this is because I plan to get the Sum of absolute differences (SAD) for use in a Weiner filter to remove the noise you can see in both files. I figured that the first half of the file was a better representation of the noise in the file to get my SAD from but I need to know that this increase in noise won't cause unexpected effects.
Thanks community for being so helpful.