<< Chapter < Page
  Digital signal processing - dsp     Page 4 / 21
Chapter >> Page >

The xform2D method

The beginning of the class and the beginning of the static method named xform2D is shown in Listing 1 .

This method computes a forward 2D Fourier transform from the space domain into the wavenumber domain. The number of points produced for the wavenumberdomain matches the number of points received for the space domain in both dimensions. Note that the input data must be purely real. In other words, theprogram assumes that there are no imaginary values in the space domain. Therefore, this is not a general purpose 2D complex-to-complex transform.

Listing 1. Beginning of the class named ImgMod30.
class ImgMod30{ static void xform2D(double[][] inputData,double[][]realOut, double[][] imagOut,double[][]amplitudeOut){ int height = inputData.length;int width = inputData[0].length;System.out.println("height = " + height);System.out.println("width = " + width);


The first parameter is a reference to a 2D double array object containing the data to be transformed. The remaining three parameters arereferences to 2D double array objects of the same size that will be populated with the following transform results:

  • The real part
  • The imaginary part
  • The amplitude (square root of sum of squares of the real and imaginary parts)

Listing 1 also determines and displays the dimensions of the incoming 2D array of data to be transformed.

I won't bore you with the details as to how and why the 2D Fourier transform does what it does. Neither will I bore you with the details of the code thatimplements the 2D Fourier transform. If you understand the material that I have previously published on Fourier transforms in one dimension, this code and these concepts should be astraightforward extension from one dimension to two dimensions.

The remainder of the xform2D method

The remainder of the xform2D method is shown in Listing 2 . Note that it was necessary to sacrifice indentation in order to force these very long equationsto be compatible with this narrow publication format and still be somewhat readable.

Listing 2. The remainder of the xform2D method.
//Two outer loops iterate on output data. for(int yWave = 0;yWave<height;yWave++){ for(int xWave = 0;xWave<width;xWave++){ //Two inner loops iterate on input data.for(int ySpace = 0;ySpace<height; ySpace++){for(int xSpace = 0;xSpace<width; xSpace++){//Compute real, imag, and ampltude. realOut[yWave][xWave] +=(inputData[ySpace][xSpace]*cos(2*PI*((1.0* xWave*xSpace/width)+(1.0*yWave*ySpace/height))))/sqrt(width*height);imagOut[yWave][xWave ]-= (inputData[ySpace][xSpace]*sin(2*PI*((1.0*xWave*xSpace/width) + (1.0*yWave*ySpace/height)))) /sqrt(width*height);amplitudeOut[yWave][xWave] =sqrt( realOut[yWave][xWave] * realOut[yWave][xWave] +imagOut[yWave][xWave]* imagOut[yWave][xWave]); }//end xSpace loop}//end ySpace loop }//end xWave loop}//end yWave loop }//end xform2D method

The inverseXform2D method

The inverseXform2d method is shown in its entirety in Listing 3 . This method computes an inverse 2D Fourier transform from the complex wavenumber domain into thereal space domain. The number of points produced for the space domain matches the number of points received for the wavenumber domain in both dimensions.

Questions & Answers

how do I set up the problem?
Harshika Reply
what is a solution set?
find the subring of gaussian integers?
hello, I am happy to help!
Shirley Reply
please can go further on polynomials quadratic
hi mam
I need quadratic equation link to Alpa Beta
Abdullahi Reply
find the value of 2x=32
Felix Reply
divide by 2 on each side of the equal sign to solve for x
Want to review on complex number 1.What are complex number 2.How to solve complex number problems.
yes i wantt to review
use the y -intercept and slope to sketch the graph of the equation y=6x
Only Reply
how do we prove the quadratic formular
Seidu Reply
please help me prove quadratic formula
hello, if you have a question about Algebra 2. I may be able to help. I am an Algebra 2 Teacher
Shirley Reply
thank you help me with how to prove the quadratic equation
may God blessed u for that. Please I want u to help me in sets.
what is math number
Tric Reply
x-2y+3z=-3 2x-y+z=7 -x+3y-z=6
Sidiki Reply
can you teacch how to solve that🙏
Solve for the first variable in one of the equations, then substitute the result into the other equation. Point For: (6111,4111,−411)(6111,4111,-411) Equation Form: x=6111,y=4111,z=−411x=6111,y=4111,z=-411
x=61/11 y=41/11 z=−4/11 x=61/11 y=41/11 z=-4/11
Need help solving this problem (2/7)^-2
Simone Reply
what is the coefficient of -4×
Mehri Reply
the operation * is x * y =x + y/ 1+(x × y) show if the operation is commutative if x × y is not equal to -1
Alfred Reply
An investment account was opened with an initial deposit of $9,600 and earns 7.4% interest, compounded continuously. How much will the account be worth after 15 years?
Kala Reply
lim x to infinity e^1-e^-1/log(1+x)
given eccentricity and a point find the equiation
Moses Reply
A soccer field is a rectangle 130 meters wide and 110 meters long. The coach asks players to run from one corner to the other corner diagonally across. What is that distance, to the nearest tenths place.
Kimberly Reply
Jeannette has $5 and $10 bills in her wallet. The number of fives is three more than six times the number of tens. Let t represent the number of tens. Write an expression for the number of fives.
August Reply
What is the expressiin for seven less than four times the number of nickels
Leonardo Reply
How do i figure this problem out.
how do you translate this in Algebraic Expressions
linda Reply
why surface tension is zero at critical temperature
I think if critical temperature denote high temperature then a liquid stats boils that time the water stats to evaporate so some moles of h2o to up and due to high temp the bonding break they have low density so it can be a reason
Need to simplify the expresin. 3/7 (x+y)-1/7 (x-1)=
Crystal Reply
. After 3 months on a diet, Lisa had lost 12% of her original weight. She lost 21 pounds. What was Lisa's original weight?
Chris Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Digital signal processing - dsp. OpenStax CNX. Jan 06, 2016 Download for free at https://legacy.cnx.org/content/col11642/1.38
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Digital signal processing - dsp' conversation and receive update notifications?