Matlab incompatibility bug in ifft
Ben Abbott
bpabbott at mac.com
Wed Feb 27 11:20:17 CST 2008
On Wednesday, February 27, 2008, at 11:37AM, "Ryan Hinton" <iobass at email.com> wrote:
>Ben Abbott wrote:
>> On Monday, February 25, 2008, at 01:23PM, "Ryan Hinton" <iobass at email.com> wrote:
>>
>>> Matlab supports an extra argument to the ifft command to force Hermitian
>>> symmetry in the argument and so produce a real output. This should make
>>> the IFFT calculation faster and save an abs() call at the end. (I am
>>> implementing fast convolution of real signals, so I know the result must
>>> be real also.)
>>>
>>> Octave example:
>>> ret = abs(ifft([1 + eps*1j;1 + eps*1j], [], 1));
>>>
>>> Matlab-supported shortcut:
>>> ret = ifft([1 + eps*1j;1 + eps*1j], [], 1, 'symmetric');
>>>
>>> This seems like a simple fix/enhancement, but I got lost in the code. I
>>> am happy to provide more information. Or I can try a fix if someone can
>>> help me figure out generally what needs to be done to which files. I'm
>>> familiar with m-code, but not with all the conventions and internal data
>>> types of Octave's implementation.
>>>
>>> Thanks!
>>>
>>>
>>
>> I don't have the c/c++ skills need to do this, but I checked the FFTW website
>>
>> http://www.fftw.org/
>>
>> and it indicates that this functionality is available. All that is needed is to modify the fft/ifft routines to respect the 'symmetric' option.
>>
>> Ben
>>
>Yes, but how to do this? I see FFT-like functions in five files,
>
>CMatrix.cc
>CNDArray.cc
>dMatrix.cc
>dNDArray.cc
>oct-fftw.cc
>
>but I can't figure out the first order of business: where are the
>command line arguments? In other words, if I add a 'symmetric' argument
>at the end, where does this show up?
>
>---
>Ryan Hinton
>iobass at email.com
>
I'm unfamiliar with the code, but it looks like the right place to start is in fft.cc, fft2.cc, fftn.cc, etc.
Ben
More information about the Bug-octave
mailing list