2
votes

I recently tried to compute the Type-I DCT of an array in Julia using the r2r standard-library function, and got errors. I tried to execute the following minimal example:

dat = [5; 4; 3; 1];
r2r(dat, "FFTW.REDFT00")

I encountered this error message:

ERROR: r2r not defined

I can't figure out what this means. The r2r function is supposedly built-in to Julia 0.3.0, so how is it possible that it is giving a syntax error here? For comparison, the dct (Type-II discrete cosine transform) works properly on dat.

Or am I just doing a silly syntax error?

EDIT

I just tried it in Julia 0.2.1 and I got the same error. This significantly elevates the probability that I am simply being an idiot, and that the function is not broken. However, confirmation would be great! :)

1

1 Answers

2
votes

r2r is built-in, but that doesn't mean it's available under that name in the standard scope. As the docs you linked say:

The following functions are defined within the Base.FFTW module.

And so:

julia> dat = [5; 4; 3; 1];

julia> FFTW.r2r(dat, FFTW.REDFT00)
4-element Array{Float64,1}:
 20.0
  5.0
 -1.0
  2.0