<commit_before># -*- coding: utf-8 -*-

from __future__ import unicode_literals

import matplotlib.pyplot as plt
import numpy as np

from dspy.filters import MelFilter


def main():
    sample_frequency = 44100
    size = 2048
    f = MelFilter(sample_frequency)
    f.create_filter(9, 200, size)
    frequencies = np.linspace(0, sample_frequency, size)
    plt.plot(frequencies, f.spectrum)
    plt.xlim([0, sample_frequency / 2])
    plt.show()


if __name__ == '__main__':
    main()
<commit_msg>Updated plot_filters example.<commit_after># -*- coding: utf-8 -*-

from __future__ import unicode_literals

import matplotlib.pyplot as plt
import numpy as np

from dspy.filters import MelFilterBank


def main():
    sample_frequency = 44100
    size = 2048
    filter_bank = MelFilterBank(sample_frequency, size)
    frequencies = np.linspace(0, sample_frequency, size)
    for mel_filter in filter_bank.filters:
        plt.plot(frequencies, mel_filter.spectrum)
    plt.xlim([0, sample_frequency / 2])
    plt.show()


if __name__ == '__main__':
    main()

{'fraction_non_alphanumeric': 0.10283018867924529, 'fraction_numerical': 0.02830188679245283, 'mean_word_length': 3.6535087719298245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '2920038', 'n_tokens_mistral': 373, 'n_tokens_neox': 353, 'n_words': 92}