Created
April 26, 2020 12:27
-
-
Save pragatibaheti/8f60615a315e00f58ba6e47c1d9afcff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
y, sr = librosa.load(audio_file.wav, offset=30, duration=10) | |
y_filt = librosa.effects.preemphasis(y) | |
# and plot the results for comparison | |
S_orig = librosa.amplitude_to_db(np.abs(librosa.stft(y)), ref=np.max) | |
S_preemph = librosa.amplitude_to_db(np.abs(librosa.stft(y_filt)), ref=np.max) | |
librosa.display.specshow(S_orig, y_axis='log', x_axis='time') | |
plt.title('Original signal') | |
librosa.display.specshow(S_preemph, y_axis='log', x_axis='time') | |
plt.title('Pre-emphasized signal') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment