Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Matlab IFFT Problem - Help required

  • 11-11-2005 09: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