# Finding a Faster Way

Started by January 2, 2004
 Here is the code snipet i need help with... for i = 1:end_frame for j = 1:1024 fout(i,j) = ifft(Z(i,j)); end end As you can see, if the end_frame is large, the for loop would take so long. What alternatives can I do? I've tried fout = ifft(Z); but it doesn't seem to give out the right answer. I've also tried for i = 1:end_frame fout(i,:) = ifft(Z(i,:)); end but again it gives a different answer. Which one gives the right answer anyway? And could you help me out becuase this part takes very long in my program. By the way, the dimension of Z is Z(1:end_frame,1:1024)
 Hi, ifft(z) where z is a matrix gives inverse DFT of each column of the matrix. > for i = 1:end_frame > for j = 1:1024 > fout(i,j) = ifft(Z(i,j)); > end > end Here above, you are just taking one element of the matrix for computation of idft. I guess this is not what you wanted. and the other way you tried > for i = 1:end_frame > fout(i,:) = ifft(Z(i,:)); > end Here you are computing idft for each row of the matrix, so you get a different answer in all the three cases. Just check your input matrix and apply the appropriate method. regards, Ravi > Here is the code snipet i need help with... > > for i = 1:end_frame > for j = 1:1024 > fout(i,j) = ifft(Z(i,j)); > end > end > > As you can see, if the end_frame is large, the for loop would take > so long. What alternatives can I do? > > I've tried fout = ifft(Z); but it doesn't seem to give out the right > answer. > > I've also tried > for i = 1:end_frame > fout(i,:) = ifft(Z(i,:)); > end > but again it gives a different answer. > > Which one gives the right answer anyway? And could you help me out > becuase this part takes very long in my program. By the way, the > dimension of Z is Z(1:end_frame,1:1024) > V Ravi Chander 200211014 MTech (ICT) DA-IICT ________________________________________________________________________ "If everything seems under control, you're just not going fast enough." - Mario Andretti ________________________________________________________________________