cuFFT and FFTW 1D Transform Descrepancies cuFFT and FFTW Output Errors

I am trying to compare the results of a forward transfrom between cuFFT and FFTW. Transform is complex to complex 1D float. Problem is the output from the two have a larger than expected relative error. Any ideas as to why?? I’ve seen the normalization issue, but I though that was related to forward then reverse transforms, not a single forward transform? Any help would be appreciated.

Thanks

What is the size of your transform, is it single or double precision and what do you consider larger than expected error? I actually wouldn’t be surprised is CUFFT is MORE accurate than a cpu based transform due to the presence of the FFMA instruction on the GPU.

The size of the transform is 1024. I’m forced into using float because of my card. But I did use the float for FFTW.

Just for test purposes. Using (f1 - f2) / (abs(f1) - abs(f2)) / 2 as a measure of relative error I am seeing as much as 2. I would expect to see something in the 10e-4 range. There are many formulas for stnadard error. I was given this one by my professor. Basically it takes the difference of the two values and divides by their average.

Just for entertainmnet I put the same values in the Excell FFT function and get about the same error between the three. FFTW and Excell are slightly closer over all, but still shows a maximum relative error of 2. You’d think there would be less round off.

Thanks

John

With the formula you gave, if f1 = 1 and f2 = 1.000001, then the value would be either 2 or .5 depending on whether you actually meant (f1 - f2) / ( (abs(f1) - abs(f2)) / 2) or what you wrote. Which would explain you getting 2. In fact, for pretty much any values of f1 and f2, you should get 2 or .5. If you use the formula for what you SAID, which would be (f1 - f2) / ( (abs(f1) + abs(f2)) / 2) then the value would be ~-1e-6 which makes more sense (and the formula itself does too…)

Thanks should be the later formula. I left of a parens. Basically the difference divided by the average value of the two. If I undestand your reply correctly then I should be seeing something on the order of 1x10e-6, correct? I’ll check my formula.

Thanks
John

I’m pretty sure in your formula you are dividing by (a - b) / 2. Not (a + b) / 2 which would be the average. That’s your problem…