ImgMod30.inverseXform2D(realSpect,imagSpect,
recoveredSpatialData);
The first two parameters in the above statement refer to array objects containing the complex spectral data to be transformed. The third parameterrefers to an array that will be populated with the results of the inverse transform.
To rearrange the spectral data for plotting, execute a statement similar to the following where the parameter refers to an array object containing thespectral data to be rearranged.
double[][]shiftedRealSpect =
ImgMod30.shiftOrigin(realSpect);
Digital signal processing (DSP)
This module will cover some technically difficult material in the general area of Digital Signal Processing, or DSP for short. As usual, the betterprepared you are, the more likely you are to understand the material. For example, it would be well for you to already understand the one-dimensionalFourier transform before tackling the 2D Fourier transform. If you don't already have that knowledge, you can learn about one-dimensional Fourier transforms bystudying the following modules :
- Java1478 Fun with Java, How and Why Spectral Analysis Works
- Java1482 Spectrum Analysis using Java, Sampling Frequency, Folding Frequency, and the FFT Algorithm
- Java1483 Spectrum Analysis using Java, Frequency Resolution versus Data Length
- Java1484 Spectrum Analysis using Java, Complex Spectrum and Phase Angle
- Java1485 Spectrum Analysis using Java, Forward and Inverse Transforms, Filtering in the Frequency Domain
- Java1486 Fun with Java, Understanding the Fast Fourier Transform (FFT) Algorithm
In addition, I strongly recommend that you study Java1490-2D Fourier Transforms using Java, Part 1 before embarking on this part.
Will use in subsequent modules
The 2D Fourier transform has many uses. I will use the 2D Fourier transform in several future modules involving such diverse topics as:
- Processing image pixels in the wavenumber domain
- Advanced steganography (hiding messages in images)
- Hiding watermarks and trademarks in images
Viewing tip
I recommend that you open another copy of this module in a separate browser window and use the following links to easily find and view the Figuresand Listings while you are reading about them.
Figures
- Figure 1. Two views of the same wavenumber spectrum.
- Figure 2. Numeric output.
- Figure 3. How to use the program named ImgMod31.
- Figure 4. An example test surface plot.
- Figure 5. An impulse in space.
- Figure 6. A displaced impulse in space.
- Figure 7. A box on the diagonal in space.
- Figure 8. Graphic output for Case 3.
- Figure 9. Graphic output for Case 4.
- Figure 10. Graphic output for Case 5.
- Figure 11. Graphic output for Case 6.
- Figure 12. Graphic output for Case 7.
- Figure 13. Graphic output for Case 9.
- Figure 14. Graphic output for Case 11.
- Figure 15. Graphic output for Case 12.
- Figure 16. Graphic output for Case 13.
Listings
- Listing 1. Beginning of the class named ImgMod30.
- Listing 2. The remainder of the xform2D method.
- Listing 3. The inverseXform2D method.
- Listing 4. The shiftOrigin method code.
- Listing 5. Beginning of the class named ImgMod31.
- Listing 6. Create and save the test surface.
- Listing 7. Display the test surface.
- Listing 8. Perform the forward Fourier transform.
- Listing 9. Display unshifted amplitude spectrum.
- Listing 10. Shift the origin and display the results.
- Listing 11. Perform an inverse transform.
- Listing 12. Display the result of the inverse transform.
- Listing 13. Display some numeric results.
- Listing 14. Beginning of the getSpatialData method.
- Listing 15. Code for Case 0.
- Listing 16. Code for Case 1.
- Listing 17. Code for Case 2.
- Listing 18. Code for Case 7.
- Listing 19. Code for Case 8.
- Listing 20. The end of the getSpatialData method.
- Listing 21. ImgMod30.java.
- Listing 22. ImgMod31.java.