0

The following is the 2d complex sinusoidal function,

enter image description here

u0 and v0 represent Fundamental Frequencies in X and Y directions respectively.

I need to implement that sinusoidal function in this present form so that, I can plot it and save it in a Bitmap image file.

How can I represent j (imaginary number)?

What values should I assign to u0 and v0 respectively to plot that Sinusoidal Function?

Can anyone give me any hint?

Edit:

here is my use-case: ... ... I need to implement Gabor Filter using both spatial and frequency domain equations. In the link ... http://www.cs.utah.edu/~arul/report/node13.html ..., you can see that there are several equations. (14) is the equation of Gabor Filter in spatial domain. (15) is the equation of Gabor Filter in frequency domain. Hence, my question.

user366312
  • 16,949
  • 65
  • 235
  • 452
  • Why do you emphasize _in this present form_ ?? In the [sin](http://physics.stackexchange.com/questions/53005/how-to-get-complex-exponential-form-of-wave-equation-out-of-sinusoidal-form) form it would be a lot simpler to implement in c#.. – TaW Sep 17 '16 at 16:50
  • @TaW, here is my use-case: ... ... I need to implement Gabor Filter using both spatial and frequency domain equations. In the link ... http://www.cs.utah.edu/~arul/report/node13.html ..., you can see that there are several equations. (14) is the equation of Gabor Filter in spatial domain. (15) is the equation of Gabor Filter in frequency domain. Hence, my question. – user366312 Sep 17 '16 at 17:21
  • https://www.google.be/search?q=gabor+waves&rls=com.microsoft:en-US:IE-Address&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjej4njkZfPAhVXFMAKHXKPAYIQ_AUICCgB&biw=1680&bih=876#tbm=isch&q=gabor+wavelets&imgrc=_ –  Sep 17 '16 at 19:31

1 Answers1

1
  1. You need to actually compute the complex value with real math

    For that you can exploit this commonly used formula (usually used in DFT/DFFT):

    e^(j*x) = cos(x) + j*sin(x)
    

    Now as you do not have complex numbers so you need to handle complex value as 2 element vector cplx = re + j*im so:

    e^(-j*2*pi*(u0*x+v0*y)) = cos(-2*pi*(u0*x+v0*y)) + j*sin(-2*pi*(u0*x+v0*y))
    ---------------------------------------------------------------------------
    re(x,y) = cos(-2*pi*(u0*x+v0*y))
    im(x,y) = sin(-2*pi*(u0*x+v0*y))
    
  2. Plot the values

    Complex domain has 2 parts (re,im) and your function is 2D so that leads you to 4D graph. You need to convert it to something humans can comprehend there are many ways I would go for 3D graph where:

    • x,y is the position (same as input variables)
    • z is Real part re
    • color is Imaginary part im encoded as color scale (similar to IR images) or gray scale

    Do not forget to rotate project the graph so it is visible from side a bit tilted not hiding important features. Here see example of 3D graph with color coding:

    Of coarse the output style depends on your task what you need to see/emphasize what is important and what not. You can for example plot 2D power graph instead:

    • x,y is the position (same as input variables)
    • color is sqrt(re*re+im*im) encoded as color scale or gray scale

    Or you can create 2 separate plots one for re and one for im see some examples here:

Community
  • 1
  • 1
Spektre
  • 49,595
  • 11
  • 110
  • 380