<< Chapter < Page
  Digital signal processing - dsp     Page 11 / 24
Chapter >> Page >
Figure 3 . Program output in self-test mode.
Missing Figure.
(Remember, all six output images are displayed on top of one another in the upper-left corner of the screen. You must manually move them tosee all six images.)

A 3D parabola

The main method creates and displays a surface consisting of a 3D parabola. You can think of the surface as representing a one-quartersection of a bowl, or perhaps a satellite dish with the center of the dish in the upper left corner of the image. The top three images in Figure 3 are the images produced from the raw surface. The bottom three images are the imagesproduced by the log of the surface, (which is no longer a 3D parabola) .

The calibration scale

The calibration scale is displayed immediately below the image of each surface.

The images are stacked

When the program is executed, the six surfaces are stacked in the upper left corner of the screen. (You must physically move the images on the top to see the images on the bottom.) The stacking order of the surfaces from bottomto top is based on the values of the display parameter in the order 0, 1, 2, 3, 4, 5.

With and without axes

Some of the surfaces show axes and some do not. This is controlled by the value of the constructor parameter named axis . A true value for axis causes the axes to be drawn.

A window listener

The constructor defines an anonymous inner class WindowListener on the close button on the Frame (the X in the upper right hand corner of the Frame ) . Clicking the close button will terminate the program that uses an object of this class.

Testing

The program was tested using J2SE 8.0 and Win 7. Because the program uses Java features that were introduced in J2SE 5.0, it may not compile successfullywith earlier versions of Java.

The program named ImgMod29

The program named ImgMod29 is rather long, so as usual I will break it down and discuss it in fragments. You can view a complete listing of theprogram in Listing 29 near the end of the module.

The main method

The program consists of a top-level class named ImgMod29 , plus several inner classes. The class includes a main method that is use for self-testing the class. To put things in context, I will beginmy discussion with the main method.

The main method begins in Listing 1 .

Listing 1. Beginning of the main method.
public static void main(String[] args){int numberRows = 59; int numberCols = 59;double[][]data = new double[numberRows][numberCols];int blockSize = 2;

Local variables

The array for the surface elevation data

Listing 1 declares a 2D array of type double to contain the 3D surface elevation data values. This is a square array consisting of 59elevation values on each side. (However, there is no requirement for the surface to be square.)

The blocksize parameter

Listing 1 also defines a value of 2 for the blockSize parameter. This variable will be passed to the constructor for the ImgMod29 class, causing each elevation value to be plotted as a small square of four pixels, two pixels on each side of the square.

(The overall size of the display can be controlled by controlling the size of the array containing the surface elevation values and alsocontrolling the value of blockSize .)

Questions & Answers

what is mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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?

Ask