why FFT result and IFFT result has diffrent in very small value? how to avoid this to increase precission?
9 visualizzazioni (ultimi 30 giorni)
nirwana il 15 Set 2023
I read from the book that IFFT from FFT result as ifft(ftt(signal)) wil give us the original signal. I try to substract both of them, but i get very small difference of both of them. Does it mean my coding is not corect or limitation in precission calculation by matlab (caused by rounded maybe).
here I provide my code, please help me to evaluate and show if there is a mistake that i make
srate=100; %sampling rate
xlim([0 15]), xticks(1:1:15)
David Goodmanson il 15 Set 2023
Modificato: David Goodmanson il 16 Set 2023
This is totally normal behavior, just computation being computation. Matlab uses double precision arithmetic with approximately 16 decmal digits. So you would expect some imprecision down around several parts in 10^16, which is what you get here. You can get more precision using vpa (variable precision arithmetic), but most people feel that once you know what is going on, precision at the level you are getting already is perfectly acceptable.
Of course there are situations such as obtaining a small result by subtracting two very large numbers, where the error can become unacceptable. Then you would have to change the method of calulation, but that's not the case here.