# How can I implement a complex sinusoidal function?

The following is the 2d complex sinusoidal function,

$u_0$ and $v_0$ represent Fundamental Frequencies in $X$ and $Y$ directions respectively.

How can I represent $j$ (imaginary number)?

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.

• Your second question isn't something anyone else can answer. It's like asking, "I want to plot 'sin(ωx);', what should 'ω' be?" It depends on what you're trying to accomplish. You can set it to 1 to see what it looks like, and then try other values. Or, if you have a specific use-case in mind, explain that, and then maybe we can help you. Sep 17 '16 at 16:28
• @user1118321, Thank you very much for your response. OK. here is my use-case: ... ... I need to implement Gabor Filter using both spatial and frequency domain equations. In the link ... 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.
– user464
Sep 17 '16 at 16:41

One way to represent a complex-valued function in a bitmap is to use one color channel for the real component and one for the imaginary component. For example, rendering a complex plane wave (your equation) with R = real, G = imaginary looks like this (click for shadertoy):

• Just a beginner question, so sorry in advance. Is what you explained equivalent to taking real component as x-axis and imaginary as y-axis ? if not, then can we also do that to represent a complex function ?
– user3437
Sep 17 '16 at 17:47
• @A---B The input to the function is the position on screen, with x = real, y = imaginary. The output is the color, with red = real, green = imaginary. Sep 17 '16 at 20:52