1
$\begingroup$

I see when I increase number of samples, the imaginary error part of the FFT growth due to the error of sin(n*pi)!=0 where n is the index of the sample in Matlab or octave. Is there anyway to force Matlab/Octave to perform FFT without these type of errors? for example I know if you have sin (sym(pi)*n) =0 in Matlab or octave. Why default FFT in matlab/octave does not use sym(pi) instead of pi?

How could I perform FFT that take care of such PI approximation error? Thanks

$\endgroup$
1
  • $\begingroup$ But if you want to have FFT algorithm and want to have exact values ( e.g. symbolic) what should we do? there is not any function in matlab / octave / python that does this? obviously, I do not want to write DFT and use symbolic as I do not have enough knowledge to write my own FFT and use symbolic $\endgroup$ – learner8059 Oct 21 '19 at 10:40
0
$\begingroup$

An FFT using symbolic math might be possible, but would be many orders of magnitude slower. (I'm guessing at least 10,000 times slower, except for a set of exact equation input signals). You would have to use a symbolic math package instead of Matlab. (Perhaps Mathematica, Maxima, or Maple?)

Instead you might be able pre- and post-process certain inputs to produce known outputs. For instance, you can check if the input is strictly symmetrical around input sample 0. If so, set all the imaginary components of the FFT output to zero. If strictly odd (anti-symmetric), set all the real result components to zero. If strictly real, set all the negative frequency outputs to be exact complex conjugates of the positive frequency ones. etc.

$\endgroup$
1
  • $\begingroup$ Actually I am using Octave. Still It looks in Matlab it is possible to use Symbolic fft but I am looking for octave version of it $\endgroup$ – learner8059 Oct 21 '19 at 18:27
0
$\begingroup$

If you can relax on pure orthogonality, there exist Integer Discrete Fourier transforms, like the Integer fast Fourier transform (INTFFT) (Integer FFT(Fast Fourier Transform) in Python).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.