I know that in theory, when reconstructing a square wave from its Fourier coefficients, unless we have an infinite amount of them, the resulting reconstruction will have Gibbs ringing artifacts due to lack of enough harmonics.
On a computer, we can take the Fourier transform
X = fft(x) of a square wave
x, and reconstruct it without artifact with
x_rec = ifft(X), maybe with some rounding error of the order of 1e-17 or something but no visible ringing.
I don't have a satisfying answer for that? I guess there has to be something to do with the fact the "the square wave" x is a digitized version of a continuous wave, and my Fourier basis vectors (complex exponentials are also discretized of course since we are in a computer...) but still... how would you justify the absence of Gibbs ringing artefacts from Fourier reconstruction of the Fourier transform of a digital square wave ?
%%%%%%%%%%%%%%%%%%%% Tought experiment proposed by Dan Szabo fs=10;%sampling frequency t=0:(1/fs):1-(1/fs); s = [1 1 1 1 1 0 0 0 0 0]; sTr = imtranslate(s,[0.5 0]) sTr = 0.5000 1.0000 1.0000 1.0000 1.0000 0.5000 0 0 0 0