<jupyter_start><jupyter_text>Homework №1    In this homework you will need to implement the following stuff:        1) Discrete Fourier Transform        2) Fast Fourier Transform        3) Compare by performance        4) Short-time Fourier Transform based on (2) and hann window function        5) MelScale        6) Digit classification based on you melspectrograms            Note:        You should test your implementation with torchaudio functions        (e.g. torch.allclose(torchaudio.transforms.Spectrogram.__call__, your_function)) Main rules    1) All operations must be implemented with pytorch (don't use numpy)    2) Everything should support batch input    3) No cycles, only matrix multiplications    4) Clean and clear code<jupyter_code>import torch
import torchaudio<jupyter_output><empty_output><jupyter_text>Discrete Fourier Transform (1 pts)<jupyter_code># TODO<jupyter_output><empty_output><jupyter_text>Sanity Check<jupyter_code>wav_file = 'audio.wav'
wav, sr = torchaudio.load(wav_file)

torch.allclose(
    torch.stft,
    ...
)<jupyter_output><empty_output><jupyter_text>Fast Fourier Transform (3pts)    A common task for machine learning engineer is to take an paper and implement it.    So, just do it![Tap on me](http://www.robots.ox.ac.uk/~sjrob/Teaching/SP/l7.pdf)<jupyter_code># TODO<jupyter_output><empty_output><jupyter_text>A comparison of the performance (1e-7 pts)    Do pretty images :)<jupyter_code># TODO<jupyter_output><empty_output><jupyter_text>Short-time Fourier Transform (2 pts)     Use torch.hann_window<jupyter_code># TODO<jupyter_output><empty_output><jupyter_text>MelScale (2 pts)[Tap on me](http://practicalcryptography.com/miscellaneous/machine-learning/guide-mel-frequency-cepstral-coefficients-mfccs/)<jupyter_code># TODO<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09085872576177285, 'fraction_numerical': 0.010526315789473684, 'mean_word_length': 5.02, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '173020', 'license': 'MIT', 'n_tokens_mistral': 605, 'n_tokens_neox': 576, 'n_words': 151, 'path': 'week01/homework.ipynb', 'repo_name': 'NadyaStrogankova/dla', 'size': '1805'}