Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Matlab IFFT Problem - Help required

Options
  • 11-11-2005 9:39pm
    #1
    Closed Accounts Posts: 1,541 ✭✭✭


    Hello Forum,

    I am having trouble with ifft function in Matlab. Im converting C code into Matlab.
    y=complex(xreal,ximag);
        
      res=ifft(y,65536/2);
    

    xreal and ximag are both 65536 samples long as is y.

    When I go res=ifft(y,65536); I get totally wrong answers. When I use the above code I get every 2nd answer missing - ie same as C results except it is only half there. The imaginary is also wrong but I won't be using this anyway.

    Help - where am I going wrong.:confused: By the way I tried doubling the size of y and placing complex conjugates in but it made no difference to result.

    Any help most appreciated.

    Thanks.


Comments

  • Closed Accounts Posts: 2,046 ✭✭✭democrates


    It's a weak rusty area but, ifft(fft(y))=y and visa versa are supposed to work.

    Sadly nothing jumps into memory about vagaries of the n value, but obviously for (i)fft powers of two and if not pad.

    Clutching at straws here but in terms of breaking it down, how about trying a 1024 sinewave sample through fft and check the output spectrum is right both in size and values, then put that through ifft to see if you get your waveform back intact. At least fft should give you a spectrum you know should feed into ifft.

    PS if you solve the problem the real() function will return the real part of the signal amplitudes if that's all you need.


  • Closed Accounts Posts: 1,541 ✭✭✭finnpark


    Thanks, will keep working at it. :cool:


Advertisement