MATLAB Answers

FFT and IFFT of audio signal

80 views (last 30 days)
I was trying to take FFT of an audio and then take IFFT to get the same audio.But i didn't get the entire audio.There wasn't any noise in the resultant audio after taking IFFT.The only problem is its clipped.
why this happens?
how can i resolve this problem?


Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 7 Mar 2017
What does class() of the audio data show? If it is one of the integer classes like uint16, then the fft will be type double and the ifft of that would be type double, not the original data type. When you have data of type double that is outside of the range -1 to +1 then if you use one of the audio file writers then the data will be clipped.
If this is what is happening to you, that your original data is outside of the range -1 to +1 then you should convert your ifft results to that data class before writing it out. For, uint16(results)


thank you for your immediate answer.Actually i'm sorry...i made a mistake.
class of the audio data is is a 222208x2 matrix whose values lie between -1 and +1.But after taking FFT the class becomes complex double,gives a 44100x2 matrix whose values are outside of the range -1 to +1.
while taking fft,i was calculating fs-point dft!!
[sig,fs]=wavread('base song.wav');
fsig1 = fft(sig,fs);
I think that's where i went wrong.
Walter Roberson
Walter Roberson on 7 Mar 2017
Yes, fft(sig,fs) would often be wrong. If you had samples for more than 1 second, the fft would sort of summarize into one second; if you had fewer samples than 1 second, then fft would zero pad, which introduces a sinc signal effect in some situations.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Translated by