<jupyter_start><jupyter_text>Load file and listen<jupyter_code>file = wavFiles[0]
x, fs = librosa.load(os.path.join(data_path, file), sr=None)
IPython.display.Audio(x, rate=fs)
S = librosa.feature.melspectrogram(x, sr=fs, n_mels=128)

# Convert to log scale (dB). We'll use the peak power (max) as reference.
log_S = librosa.power_to_db(S, ref=np.max)

# Make a new figure
plt.figure(figsize=(12,4))

# Display the spectrogram on a mel scale
# sample rate and hop length parameters are used to render the time axis
librosa.display.specshow(log_S, sr=fs, x_axis='time', y_axis='mel')

# Put a descriptive title on the plot
plt.title('mel power spectrogram')

# draw a color bar
plt.colorbar(format='%+02.0f dB')

# Make the figure layout compact
plt.tight_layout()
X = librosa.feature.mfcc(x, sr=fs)
print(X.shape)
X = sklearn.preprocessing.scale(X)
X.mean()
model = sklearn.decomposition.PCA(n_components=2, whiten=True)
model.fit(X.T)
Y = model.transform(X.T)
print(Y.shape)
model.components_.shape
plt.scatter(Y[:,0], Y[:,1])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.01229895931882687, 'mean_word_length': 5.825806451612904, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '135072', 'license': 'Apache-2.0', 'n_tokens_mistral': 431, 'n_tokens_neox': 412, 'n_words': 100, 'path': 'notebooks/pca_ica/exploratory_PCA.ipynb', 'repo_name': 'MariusDgr/AudioMining', 'size': '1057'}