<commit_before>import numpy as np


def lin_sweep(fstart, fstop, sweep_time, fs):
    """Choose the excitation signal which you want to generate and fill
    in the parameters lin_sweep(fstart, fstop, sweep_time, fs),
    where:
    fstart is the start frequency
    fstop  is the stop frequency
    sweep_time is the total length of sweep
    fs is the sampling frequency

    Note that the stop frequency must not be greater than half the
    sampling frequency (Nyquist-Shannon sampling theorem)
    """

    if fstop > fs / 2:
        raise ValueError("fstop must not be greater than fs/2")
    t = np.arange(0, sweep_time, 1 / fs)
    x = np.sin(
        2 * np.pi * ((fstop - fstart) /
                     (2 * sweep_time) * t ** 2 + fstart * t))
    return x


def log_sweep(fstart, fstop, sweep_time, fs):
    """Choose the excitation signal which you want to generate and fill
    in the parameters log_sweep(fstart, fstop, sweep_time, fs),
    where:
    fstart is the start frequency
    fstop  is the stop frequency
    sweep_time is the total length of sweep
    fs is the sampling frequency

    Note that the stop frequency must not be greater than half the
    sampling frequency (Nyquist-Shannon sampling theorem).
    """

    if fstop > fs / 2:
        raise ValueError("fstop must not be greater than fs/2")
    t = np.arange(0, sweep_time, 1 / fs)
    x = np.sin(2 * np.pi * sweep_time * fstart / np.log(fstop / fstart) *
               np.exp(t / (sweep_time) * np.log(fstop / fstart) - 1))
    return x<commit_msg>pep257<commit_after>"""Signal Generation."""

import numpy as np


def lin_sweep(fstart, fstop, sweep_time, fs):
    """Generation of a linear sweep signal.

    Fill in the parameters lin_sweep(fstart, fstop, sweep_time, fs),
    where:

    fstart is the start frequency
    fstop  is the stop frequency
    sweep_time is the total length of sweep
    fs is the sampling frequency

    Note that the stop frequency must not be greater than half the
    sampling frequency (Nyquist-Shannon sampling theorem).

    """
    if fstop > fs / 2:
        raise ValueError("fstop must not be greater than fs/2")
    t = np.arange(0, sweep_time, 1 / fs)
    x = np.sin(
        2 * np.pi * ((fstop - fstart) /
                     (2 * sweep_time) * t ** 2 + fstart * t))
    return x


def log_sweep(fstart, fstop, sweep_time, fs):
    """Generation of a logarithmic sweep signal.

    Fill in the parameters log_sweep(fstart, fstop, sweep_time, fs),
    where:
    fstart is the start frequency
    fstop  is the stop frequency
    sweep_time is the total length of sweep
    fs is the sampling frequency

    Note that the stop frequency must not be greater than half the
    sampling frequency (Nyquist-Shannon sampling theorem).
    """
    if fstop > fs / 2:
        raise ValueError("fstop must not be greater than fs/2")
    t = np.arange(0, sweep_time, 1 / fs)
    x = np.sin(2 * np.pi * sweep_time * fstart / np.log(fstop / fstart) *
               np.exp(t / (sweep_time) * np.log(fstop / fstart) - 1))
    return x
{'fraction_non_alphanumeric': 0.08505070330389271, 'fraction_numerical': 0.009486424599280341, 'mean_word_length': 2.555813953488372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5848819', 'n_tokens_mistral': 983, 'n_tokens_neox': 940, 'n_words': 377}