Example #1
0
def demo_fft(sum_waves):
    num_samples, spacing, _ = utils.get_wave_timing()

    # TODO create a Fast Fourier Transform of the waveform using scipy.fftpack.fft
    # named 'y_fft'
    y_fft = scipy.fftpack.fft(sum_waves)

    x_fft = np.linspace(0.0, 1.0 / spacing, num_samples)
    return x_fft, y_fft
Example #2
0
def add_the_waves(freqs):
    """
    create three sinusoidal waves and one wave that is the sum of the three
    :param freqs: [int, int, int]
    :return: [np.array, np.array, np.array, np.array]
        representing wave1, wave2, wave3, sum of waves
        each array contains 500(by default) discrete values for plotting a sinusoidal
    """
    _, _, t = utils.get_wave_timing()
    w1, w2, w3 = utils.make_waves(t, freqs)

    # TODO sum the waves together to form sum_waves
    sum_waves = w1 + w2 + w3

    return [w1, w2, w3, sum_waves]