Re: fft on square wave



Greg Heath <heath@xxxxxxxxxxxxxxxx> wrote in message <530b5762-c7ff-43c5-bd95-a10c347355bd@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...

F ?t(f(t));
% plot the coefficients (should be a real function)

Should never make that assumption always check
imag(F).


Tomas, since you're dealing with an even function (symmetric across t=0), the FFT will be real if you have an odd number N of samples and if t=0 is one of them.

Once you modified your time sampling axis to t=(-.2:.01:.2), this is now the case, so you can expect essentially real valued results. Of course, MATLAB doesn't know about the symmetry and will still return a complex result, but using imag(F) you should be able to verify that it contains zeroes up to numerical round-off.
.



Relevant Pages

  • Nonrenormalization vs Renormalization 12: Taylor and Laurent Series
    ... The Taylor series of a real function fwith real coefficients that ... Here the coefficients of the x - c powers are f^/n! ... The Laurent series is the complex analog which includes negative powers ... of and is especially useful in the Residue Theorem according to ...
    (sci.physics)
  • Finding radious of convergence of a series
    ... Consider the real function, with x>=0 and k a real parameter in, ... and its Taylor series ... The coefficients A_j in are polynomials in k^2. ...
    (sci.math)

Loading