Unfortunately, I found a bug in the code of my example provided at: octave-online.net/bucket~EP15mJvkgLCmzodFStNw3b This code will only work, if the DC part is zero or quite small. If it is not, it must be devided by a factor of 2 when reconstructing the function. On solution to fix the problem is to replace the lines: % reconstructed signal (in N) -> vector F_x_t_reconstructed=F_x_t_reconstructed+amplitude(n_harmonic)*cos(omega*t+phase_angle(n_harmonic)); with % reconstructed signal (in N) -> vector if frequency(n_harmonic)==0 F_x_t_reconstructed=F_x_t_reconstructed+amplitude(n_harmonic)/2; else F_x_t_reconstructed=F_x_t_reconstructed+amplitude(n_harmonic)*cos(omega*t+phase_angle(n_harmonic)); end
Unfortunately, I found a bug in the code of my example provided at:
octave-online.net/bucket~EP15mJvkgLCmzodFStNw3b
This code will only work, if the DC part is zero or quite small. If it is not, it must be devided by a factor of 2 when reconstructing the function.
On solution to fix the problem is to replace the lines:
% reconstructed signal (in N) -> vector
F_x_t_reconstructed=F_x_t_reconstructed+amplitude(n_harmonic)*cos(omega*t+phase_angle(n_harmonic));
with
% reconstructed signal (in N) -> vector
if frequency(n_harmonic)==0
F_x_t_reconstructed=F_x_t_reconstructed+amplitude(n_harmonic)/2;
else
F_x_t_reconstructed=F_x_t_reconstructed+amplitude(n_harmonic)*cos(omega*t+phase_angle(n_harmonic));
end
thank u very much
a good explanation for the reconstruction of a signal, it's completely solved my problem.
Thank you very much, quite useful.
You are welcome.