<jupyter_start><jupyter_text>Mouse USVsSource:- https://sites.google.com/view/rtachi/resources<jupyter_code>from pathlib2 import Path
import numpy as np 
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
import re
import IPython
from avgn.utils.paths import DATA_DIR, ensure_dir
from avgn.signalprocessing import spectrogramming as sg
import pdb
from joblib import Parallel, delayed
n_jobs = 10
verbosity = 5
from tqdm.autonotebook import tqdm
from librosa.core.time_frequency import mel_frequencies
from avgn.signalprocessing.spectrogramming_tf import spectrogram_tensorflow
from avgn.utils.audio import load_wav, float32_to_int16, int16_to_float32, write_wav
from avgn.visualization.spectrogram import visualize_spec, plot_spec
from avgn.signalprocessing.filtering import butter_bandpass_filter<jupyter_output><empty_output><jupyter_text>data locations<jupyter_code>DSLOC = DATA_DIR/"raw/rodent/zip_contents"
CSVs = list(DSLOC.glob('*/*.csv'))
CSVs[:2]
len(CSVs)
CSVs
'/mnt/cube/tsainbur/Projects/github_repos/avgn_paper/data/raw/rodent/zip_contents/'
len(CSVs)
all_vocs = []
for csv in CSVs:
    voc = pd.read_csv(csv,header=None)[[0,1]]
    voc.columns = ['start_time', 'end_time']
    voc['csv'] = csv
    all_vocs.append(voc)
    #print(len(voc))
voc_df = pd.concat(all_vocs)
len(voc_df)
voc_df[:3]
plt.hist(voc_df.end_time.values - voc_df.start_time.values, bins=50);
row = voc_df.iloc[0]
row
wav = row.csv.parent / (row.csv.stem + '.wav')
rate, data = load_wav(wav)
rate
syll = data[int(rate*row.start_time): int(rate*row.end_time)]
plt.plot(syll)
plt.plot(syll)
IPython.display.Audio(data=syll, rate=int(rate/10))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11561382598331346, 'fraction_numerical': 0.012514898688915376, 'mean_word_length': 6.429203539823009, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '411379', 'license': 'MIT', 'n_tokens_mistral': 678, 'n_tokens_neox': 647, 'n_words': 124, 'path': 'notebooks/00.1-data-exploration/rodent_usv/0.0-view-rodent-usv-data.ipynb', 'repo_name': 'xingjeffrey/avgn_paper', 'size': '1678'}