Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7900235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:55:06+00:00 2026-06-03T08:55:06+00:00

recently I faced some problems concerning the use of fftw and it’s c2c transformation

  • 0

recently I faced some problems concerning the use of fftw and it’s c2c transformation (see: 3d c2c fft with fftw library). As I located my problems in the use of the fftw lib I created a new Question in order to discus this situation in a more concrete way.
Since I am doing a complex to complex transform with real data my transformed data in fourier space is supposed to be symmetric: F[n] = con(F[N-n])

Now I did some transformations with small blocks of test-data to check the transformed data for this symmetry. For 1D transform at every things worked as expected, but for higher dimensions I got real unexpected results.

I am using fftwf_plan_dft_2d to transform a 8×8 grayscale image into fourier space and the complex result is given by:

n 
0 real 7971 imag 0 
1 real -437.279 imag -802.151 
2 real -289 imag -566 
3 real -182.721 imag 15.8486 
4 real 31 imag 0 
5 real -182.721 imag -15.8486 
6 real -289 imag 566 
7 real -437.279 imag 802.151 
8 real -1499.79 imag -315.233 
9 real 182.693 imag -74.5563 
10 real 55.9239 imag -12.8234 
11 real -84.7868 imag -9.10052 
12 real -14.4264 imag 211.208 
13 real 289.698 imag 214.723 
14 real 452.659 imag -246.279 
15 real 1136.35 imag -763.85 
16 real 409 imag -134 
17 real -141.865 imag 42.6396 
18 real -33 imag 122 
19 real 129.075 imag -49.7868 
20 real 1 imag -150 
21 real 109.865 imag -84.6396 
22 real 95 imag -142 
23 real -841.075 imag -92.2132 
24 real -108.207 imag -89.2325 
25 real -127.213 imag 28.8995 
26 real -36.6589 imag -8.27922 
27 real -74.6934 imag 43.4437 
28 real 70.4264 imag 29.2082 
29 real -88.3545 imag -81.8499 
30 real -127.924 imag -190.823 
31 real 230.302 imag 8.7229 
32 real -53 imag 0 
33 real -73.1127 imag -22.8578 
34 real -85 imag -82 
35 real -10.8873 imag 51.1421 
36 real -65 imag 0 
37 real -10.8873 imag -51.1421 
38 real -85 imag 82 
39 real -73.1127 imag 22.8578 
40 real -108.207 imag 89.2325 
41 real 230.302 imag -8.7229 
42 real -127.924 imag 190.823 
43 real -88.3545 imag 81.8499 
44 real 70.4264 imag -29.2082 
45 real -74.6934 imag -43.4437 
46 real -36.6589 imag 8.27922 
47 real -127.213 imag -28.8995 
48 real 409 imag 134 
49 real -841.075 imag 92.2132 
50 real 95 imag 142 
51 real 109.865 imag 84.6396 
52 real 1 imag 150 
53 real 129.075 imag 49.7868 
54 real -33 imag -122 
55 real -141.865 imag -42.6396 
56 real -1499.79 imag 315.233 
57 real 1136.35 imag 763.85 
58 real 452.659 imag 246.279 
59 real 289.698 imag -214.723 
60 real -14.4264 imag -211.208 
61 real -84.7868 imag 9.10052 
62 real 55.9239 imag 12.8234 
63 real 182.693 imag 74.5563

Sorry for this long list of data, but it shows my problem.

For example for F[3]=-182.721 + 15.8486i I expected F[64-3] = F[61] = -182.721 - 15.8486i, but as you can see it is -84.7868 + 9.10052i. Instead the conjugate of F[3] is located at index 5. Same thing for other pairs.

If there is a system I cannot find it.

Here is the complete code:

QImage image("/Users/wolle/Desktop/wolf.png");
int w = image.width();
int h = image.height();
int size  = w * h;

cl_float *rawImage = imageToRaw(image); // converts a QImage into an rgb array [0..255]

fftwf_complex *complexImage = (fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex) * size);
fftwf_complex *freqBuffer = (fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex) * size);

// real data to complex data
for (int i = 0; i < size; i++)
{
    complexImage[i][0] = (float)rawImage[i];
    complexImage[i][1] = 0.0f;
}

fftwf_plan forward = fftwf_plan_dft_2d(w, h, complexImage, freqBuffer, FFTW_FORWARD, FFTW_ESTIMATE);

fftwf_execute(forward);

for (int y = 0; y < h; y++)
{
    for (int x = 0; x < w; x++)
    {
        int gid = y * w + x;
        qDebug() << gid  << "real" << freqBuffer[gid][0] << "imag" << freqBuffer[gid][1];
    }
}

I would appreciate some Help. 😀

Greetings

Wolf

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:55:08+00:00Added an answer on June 3, 2026 at 8:55 am

    For a 2D Fourier transform, it is still true that when x is real FFT(x) is conjugate-symmetric. But that’s in two dimensions. So the (x,y) element at index 16*x+y should be the conjugate of the (16-x,16-y) element at index 16*(16-x mod 16)+(16-y mod 16), which when y isn’t 0 is 272-16*x-y mod 256.

    BUT I think that although you said 16×16 you actually meant 8×8. So (x,y) at 8*x+y is conjugate to (8-x,8-y) at 8*(8-x mod 8) + (8-y mod 8).

    In particular, e.g., when x=0 the conjugate elements are y and 8-y — including, for instance, 3 and 5, as you found.

    (When x=0 or y=0, things like “8-y mod 8” above mean 0.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently faced an interview question related to LINQ. What is the use of
I recently faced a problem of presenting the output of simple genetic algorithm that
Recently I faced few interview questions.The interviewer asked the to give the detailed answer.
We have recently been faced with the problem of porting our C++ framework to
This is an interview question I faced recently. Given an array of 1 and
Recently I had faced compiling errors in a c++ code I wrote so I've
Recently i saw an open source javascript library have a line like : style
I develop Rails based website, enjoying using partials for some common components Recently, i
I recently faced a strange behavior using the right-shift operator. The following program: #include
Recently I faced a issue when using len() in a query to find out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.