<< Chapter < Page
  Digital signal processing - dsp     Page 11 / 27
Chapter >> Page >

Plot the data

The statement in Listing 3 calls the overloaded plotData method to cause all of the pages belonging to the plotting object titled "A" to be stacked in alocation where the upper left corner of the stack is 401 pixels to the right of the upper left corner of the screen.

Listing 3. Plot the data.

As described earlier, page 0 containing the earliest data fed to the plotting object is on the top of the stack. Figure 1 shows the two pages belonging to this plotting object after they have been manually rearranged to make them bothvisible.

Feed and plot the object titled "B"

Listing 4 feeds 2600 random white noise values to the object titled "B" and displays the pages in the default location in the upper left corner of thescreen. Listing 4 also signals the end of the main method.

Listing 4. Feed and plot the object titled "B".
for(int cnt = 0;cnt<2600;cnt++){ plotObjectB.feedData((Math.random() - 0.5)*25); }//end for loopplotObjectB.plotData();}//end main

Listing 4 (plus one of the statements in Listing 1 ) is much more typical of the amount of code required to use this plotting class than was thecase with Listing 2 .

(Almost all of the code in Listing 2 was required to set the special data values used to test the transitions discussed earlier.)

The three steps

To recap, the three steps required to use this class for plotting nearly unlimited amounts of data are:

  1. Instantiate a plotting object of the class named PlotALot01 , as in Listing 1 .
  2. Call the feedData method once for each data value that is to be plotted, as in Listing 4 .
  3. Call the plotData method on the plotting object afterall of the data has been fed to the plotting object, as in Listing 3 or Listing 4 .

Some instance variables

Continuing with the class definition for the class named PlotALot01 , Listing 5 shows several instance variables that belong to a plotting object instantiatedfrom this class.

Listing 5. Some instance variables.
String title; int frameWidth;int frameHeight; int traceSpacing;//pixels between tracesint sampSpacing;//pixels between samples int ovalWidth;//width of sample marking ovalint ovalHeight;//height of sample marking ovalint tracesPerPage; int samplesPerPage;int pageCounter = 0; int sampleCounter = 0;ArrayList<Page>pageLinks = new ArrayList<Page>();

The purpose of each of these instance variables is indicated by the name of the variable, and in some cases by the comments following the variabledeclaration. In addition, I will have more to say about some of these variables later when I discuss the code that uses them.

(Note the use of generics in the declaration and initialization of the variable named pageLinks . The use of generics dictates that this class requires J2SE 5.0 or later.)

The first overloaded constructor

As mentioned earlier, there are two overloaded versions of the constructor for this class. The overloaded version that begins in Listing 6 accepts several incoming parameters allowing the user to control various aspects of the plottingformat.

Questions & Answers

what is Nano technology ?
Bob Reply
write examples of Nano molecule?
The nanotechnology is as new science, to scale nanometric
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
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?