<commit_before>import numpy as np
import scipy as sp
import matplotlib.pyplot as plt


def sweep(x, sweep_time, fs):

    t = np.arange(0, sweep_time, 1 / fs)
    p = 20 * np.log10(abs(sp.fft(x)))
    f = np.linspace(0, fs / 2, len(p))
    plt.figure(1)
    plt.subplot(211)
    plt.plot(t, x)
    plt.grid()
    plt.subplot(212)
    plt.plot(f, p)
    plt.xscale('log')
    plt.grid()
    plt.show()<commit_msg>Add axis label and change import<commit_after>import numpy as np
import matplotlib.pyplot as plt


def sweep(x, sweep_time, fs):

    plt.subplots_adjust(hspace=0.4)
    t = np.arange(0, sweep_time, 1 / fs)
    p = 20 * np.log10(abs(np.fft.rfft(x)))
    f = np.linspace(0, fs / 2, len(p))
    plt.figure(1)
    plt.subplot(211)
    plt.plot(t, x)
    plt.grid()
    plt.xlabel('t / s')
    plt.ylabel('x(t)')
    plt.title('time domain')
    plt.subplot(212)
    plt.plot(f, p)
    plt.xscale('log')
    plt.grid()
    plt.xlabel('f / Hz')
    plt.ylabel('A / dB')
    plt.title('frequency domain')
    plt.show()
{'fraction_non_alphanumeric': 0.16878048780487806, 'fraction_numerical': 0.03121951219512195, 'mean_word_length': 2.6512455516014235, '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': '4947535', 'n_tokens_mistral': 452, 'n_tokens_neox': 430, 'n_words': 92}