Is this dct (FFTW.jl) behavior in julia normal?

I’m trying to do some exercises of Compressed Sensing on Julia, but i realize that the discrete cosine transformation (using FFTW.jl) of an identity matrix doesn’t looks as the result of other programming languages (aka. Mathematica and Matlab).

For example in Julia

using Plots, FFTW, LinearAlgebra
n = 100
Psi = dct(Matrix(1.0I,n,n))

results in this matrix (which is essentially an identity matrix with some noise)

Julia's dct for an identity matrix

But in Matlab


this is the result (as expected)

Matlab dct type 2 of an identity matrix

Finally in Mathematica

MatrixPlot[N[FourierDCTMatrix[100, 2]], PlotLegends -> Automatic]

returns this

Mathematica dct of an identity matrix

Why Julia behaves so differently?
And is this normal?

Read more here: Source link