Low Pass Filter using FFT up to the Nth overtone

67 Views Asked by At

I'm writing a program in c# that uses Meta.Numerics to calculate the FFT of a signal recorded during one cycle. The overtones are presented as complex numbers. Now I would like to reconstruct the signal but only using the first $N$th overtones. One way of doing this is to calculate the amplitude and phase of each complex numbers (overtones) and make a sum on each sample for the complete signal. Each sample would in this case have this value when it's reconstructed using the first 3 overtones ($A$=amplitude, $P$=phase):

$$A_0\cos(x+P_0)+A_1\cos(x+P_1)+A_2\cos(x+P_2)$$

Does anybody know if there is a smarter way so that it's no need to calculate the phase and amplitude before the signal is reconstructed? Thanks