I am generating a 0.5Hz sine wave, to which I'm adding a ramp envelope, to get a signal that ramps its amplitude from 0 - 10 - 0 Vpp. I then did an FFT (DFT? sorry not that up on the exact terminology here).
The frequency domain graph is how I expected except, the little peaks surrounding the peak at 0.5Hz. Is this a result of the computation (code below) or is this an actual phenomena associated with amplitude modulation, if so what is that?
My code...
import numpy as np
from scipy import signal
from scipy.fft import fft, fftfreq
import matplotlib.pyplot as plt
f_sample = 10000 # sample rate (44100 for output to wave file)
freq = 0.5 # input frequency in Hertz
duration = 200 # length of input in seconds
samples = np.arange(duration * f_sample) / f_sample # sample time steps
amp_scaler = len(samples) / 10 # scale to 10Vpp
amp_1 = [i / amp_scaler for i in range(len(samples)//2)] # acending ramp
amp_2 = np.flip(amp_1) # decending ramp
amp = np.concatenate((amp_1, amp_2)) # concated ramp
inp_sig = amp * np.sin(2 * np.pi * freq * samples) # input signal
# FFT
N = len(inp_sig)
T = 1 / f_sample
yf = fft(inp_sig)
xf = fftfreq(N, T)[:N//2]
yf_plt = 2.0/N * np.abs(yf[0:N//2])
figure, ax = plt.subplots(2)
figure.suptitle("Input: Sine wave, 0.5Hz, amplitude sweep 0 - 10 - 0 Vpp", fontsize=16)
ax[0].plot(samples, inp_sig)
ax[0].title.set_text('Time domain')
ax[0].set_xlabel('Seconds (s)')
ax[0].set_ylabel('Voltage (V)')
ax[1].plot(xf, yf_plt)
ax[1].title.set_text('Frequency domain')
ax[1].set_xlabel('Frequency (Hz)')
ax[1].set_ylabel('Voltage (V)')
ax[1].set_xlim(0, 1)
ax[1].set_xticks([0, 0.25, 0.5, 0.75, 1.0])