Hi Ethan,

irfft and brfft take an additional argument d, which roughly speaking 
denotes the size of the transformed matrix. See also the docs on brfft and 
irfft 
<http://julia.readthedocs.org/en/latest/stdlib/base/?highlight=brfft#Base.brfft>

The following should work for you
julia> a = rand(64, 64);

julia> a_from_rfft = rfft(a);

julia> back_to_a = irfft(a_from_rfft, size(a,1));

julia> norm(back_to_a-a)
5.185263941656865e-15

Hope that helps,

Alex.

On Thursday, 19 June 2014 06:37:38 UTC+2, Ethan Anderes wrote:
>
> Does anyone have experience with brfft or irfft? I’m trying to optimize 
> some code and I noticed a huge performance gain if I use rfft over fft for 
> 2-d real matrices. However
> I need to filter in the Fourier domain, then use irfft (or brfft) to 
> return to spatial corridinates but I can’t seem to get irfft or brfft to 
> work.
>
> a = rand(1024, 1024);
>
> a_from_fft  = fft(a);
> a_from_rfft = rfft(a);
>
> ###  each one of these gives an error
> back_to_a = brfft(a_from_fft);
> back_to_a = brfft(a_from_rfft);
> back_to_a = irfft(a_from_fft);
> back_to_a = irfft(a_from_rfft);
>
> Here is my version info
>
> julia> versioninfo()
>
> Julia Version 0.3.0-prerelease+3730
> Commit 8f1fbec (2014-06-17 23:55 UTC)
> Platform Info:
>   System: Darwin (x86_64-apple-darwin13.2.0)
>   CPU: Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
>   WORD_SIZE: 64
>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
>   LAPACK: libopenblas
>   LIBM: libopenlibm
>
> ​
>

Reply via email to