Recreating time series data using FFT results without using ifft
问题 I analyzed the sunspots.dat data (below) using fft which is a classic example in this area. I obtained results from fft in real and imaginery parts. Then I tried to use these coefficients (first 20) to recreate the data following the formula for Fourier transform. Thinking real parts correspond to a_n and imaginery to b_n, I have import numpy as np from scipy import * from matplotlib import pyplot as gplt from scipy import fftpack def f(Y,x): total = 0 for i in range(20): total += Y.real[i]