Image Denoising Accuracy MATLAB vs. CUDA

Hi all!

I’m doing a gauss filtering on image.

The steps of my goal are:

  1. read data from an image

  2. create a kernel

  3. applying FFT to image and kernel data

  4. pointwise multiplication

  5. applying IFFT to 4. results.

If I do the same operation in MATLAB I have best accuracy.

I have read in other topics, that I must normalize the IFFT results with 1/size_fft,

or use only Z2Z/C2C cufft type because matlab use double precision data type.

I have done it, but I haven’t improvements.

The only doubt come from the C2C use, my data are float and I convert them in Complex before call cufftExecC2C:


image_complex[i].x = image[i].x;

image_complex[i].y = 0;

//end for

cufftExecC2C(plan, (cufftComplex *)image_complex, (cufftComplex *)image_complex, CUFFT_FORWARD);

and on IFFT I need unsigned char data from complex:

cufftExecC2C(plan, (cufftComplex *)image_complex, (cufftComplex *)image_complex, CUFFT_INVERSE);



//end for

In the end I use filtered data for bitmap visualization.

thank you for support.

I’m curious if you’ve tried Jacket. The Jacket GPU version in MATLAB should be identical to the CPU version. Free 15-day trial is available here (to purchase is only a few hundred bucks):


I need to do Image Denoising in CUDA and compare results in execution time and accuracy with Matlab that use CPU.

So, I don’t know if Jacket is useful for my goal.


There are many people using a combination of Jacket’s core functions as well as Jacket’s Image Processing Library ( for these kinds of applications. I think it would do what you need it to. Feel free to email me (see my signature below) if I can help any further.

I report this to my tutor, but it says that matlab/freemat and cudaFFT using FFTW both, so the results can’t be too different.

I have solved!

The problem was the padding!

Is it normal that for hight equal value of kernel radius and gauss delta,

is accuracy better in Matlab than CUDA ?