help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help-octave Digest, Vol 126, Issue 4


From: Dave Cottingham
Subject: Re: Help-octave Digest, Vol 126, Issue 4
Date: Tue, 6 Sep 2016 12:38:50 -0400

On Tue, Sep 6, 2016 at 10:37 AM, Yaowang Li <address@hidden> wrote:
Dear Dave, 

Thank you very much for your response.

I understand the Octave index starting from 1, not 0. and I did not find the what I want. That is why I ask this question. 

On the purpose of making it clearer. I enclosed my script and the example image. Hope to help you to find where is wrong. 

Best Regards,

Yaowang


On Tue, Sep 6, 2016 at 9:39 AM, Dave Cottingham <address@hidden> wrote:
Yaowang writes:

For a real function, for example, an image (u), Its Fourier transform
should follow the Friedel symmetry, I mean the U(s) = U*(-s). Here,
U(s) is the Fourier transform of u, and is a complex number. U*(s) is
its conjugate. I tested two images in imagej, and it works. However, it
is not happen in Octave, the real part is not equal and the imaginary
part is not opposite. They should have the magnitude and opposite
phase. That is what is my question. that is what I did in Octave.


img1=imread("fibers01.tif");
img2=imread("fibers02.tif");

%Fourier transform
img1_sf=fft2(double(img1));
img2_sf=fft2(double(img2));



Thank you very much. 



Best Regards,

Yaowang

 
The element for s = (0, 0) is stored at index (1, 1), and the indexing is modulo the size of the array.

For example, suppose your image is of size 64 x 64. Then s = (1, 2) is at index (2, 3), and s = (-1, -2) is at index (64, 63). If you use this indexing rule, you should see the complex conjugate relation you expect.

 - Dave Cottingham



Yaowang -

Your code indicates that your image is 256 x 256. And that you expected the element at (1, 1) to be the complex conjugate of (256, 256).

But the element at (1, 1) is the one for which s = (0, 0). Thus it should be the complex conjugate of itself, i.e., it should be real.

The element at index (2, 2), for example, corresponds to s = (1, 1). If you negate s, you get s = (-1, -1) and this is located at index (256, 256). So you should see the elements (2, 2) and (256, 256) being complex conjugates of each other.

The general rule is that, for each of x and y, the index = (s mod 256) + 1.

Hope this helps.

 - Dave Cottingham


reply via email to

[Prev in Thread] Current Thread [Next in Thread]