# What is the correct inverse function of the Matlab function fft? [closed]

I used the Matlab function fft but I am not sure which function is the correct inverse to go back to the time domain.

• i think it's ifft(). – robert bristow-johnson Jan 23 '15 at 1:37
• @robertbristow-johnson: I would certainly upvote this gem if you made it an answer! – Matt L. Jan 23 '15 at 7:49
• you may also need to consider the real part of the ifft() for some situations if the imaginary part contains epsilon level residuals, provided that you know a-priori about the realness of the time domain signal. – Fat32 Jan 23 '15 at 9:36
• Hello @MWijnand, welcome to DSP.SE. To be on-topic here, questions involving MATLAB have to contain mostly signal processing content--not just be about MATLAB itself. – datageist Jan 25 '15 at 3:55
• @datageist Excuse me, this question was indeed for Stack Overflow. – Karlo Jan 26 '15 at 12:40

## 1 Answer

Yes it is ifft(). If it is non radix two, the algorithm that is implemented would be DFT.

You can write the equation of the IFFT with normalizing factor (1/sqrt(N)) instead of (1/N), then you have to multiply the time domain counterpart with sqrt(N).

• The DFT is never implemented directly when the function fft() is called. There are many special algorithms implemented for all possible FFT lengths. Some are slower (e.g. for prime lengths) and some are faster (e.g. powers of 2), but all are faster than a direct implementation of the DFT. – Matt L. Jan 23 '15 at 10:03
• @MattL.m=, thanks for the endorsement above. it's not worth an answer because maybe the question should be closed. anyway, just for the sake of semantics, i think you should change "directly" to "naïvely". all FFTs are DFTs. not all DFTs are FFTs. – robert bristow-johnson Jan 23 '15 at 21:12
• @robertbristow-johnson: Yeah, you know what I mean, just implementing the DFT sum as it is. I can't change the comment anymore, could just delete and re-write it, but I guess people know now what I meant. – Matt L. Jan 25 '15 at 9:43