cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

bnsteel
Journeyman III

Zero Padding with clAMDfft not behaving as expected

Hello,

I am trying to use zero padding when fft'ing my data, but am not getting the expected results. 

Should it be possible to create my cl::Buffers (real and imaginary)  to be twice as long as my data, perform a R2C transform on the data size (half the length of my buffer), set the second half of my buffers to zeros (both Real and Imaginary parts), and then perform a C2C transform on that data to have the zero padded complex data? 

When I use the C2C transform on the original data length, the results are as expected.  When I do this using fftw, I get the expected results.

When I zero pad the real part of the extra data and C2C transform just the "data" part, the results are as expected: normal un-padded image.

When I zero pad the imaginary part of the extra data and C2C transform just the "data" part, the results are screwy: the (expected) image has a series of dark bands across it.

When I C2C transform the data +extra part ( with or without setting the extra parts to zeros)  the results are screwy: The image is mostly zero padded, but there is a series of dark bands it.

I am working on making a nice example code, but thought I'd just lead off with this query in case there is a simple explanation of why zero padding does not work.

Best,

Brooke

0 Likes
0 Replies