<< Chapter < Page
  Digital signal processing - dsp     Page 12 / 14
Chapter >> Page >

This method accepts an incoming complex sample value and the position in the series associated with that sample. The method corrects the real and imaginarytransform values for that complex sample to reflect the specified position in the input series.

After correcting the transform values for the sample on the basis of position, the method updates the corresponding real and imaginary valuescontained in array objects that are used to accumulate the real and imaginary values for all of the samples.

References to the array objects are received as input parameters. Outgoing results are scaled by an incoming parameter in an attempt to cause the outputvalues to fall within a reasonable range in case someone wants to plot them.

The incoming parameter named length specifies the number of output samples that are to be produced.

Hopefully this explanation will make it possible for you to understand the code in Listing 4 .

Note in particular the use of the Math.cos and Math.sin methods to apply the cosine and sine curves in the correction of the transforms of the individual complex samples. This is used to produceresults similar to those shown in Figure 5 through Figure 7 .

A real FFT program would probably compute the cosine and sine values only once, put them in a table and extract them from the table when needed.

Note the use of the position and length parameters in the computation of the angle that is passed as an argument to the Math.cos and Math.sin methods.

Also note how the correction is made separately on the real and imaginary parts of the input. This produces results similar to those shown in Figure 7 after those results are added in the accumulators.

Back to the main method

Returning now to the main method, the code in Listing 5 prepares the input data and the output arrays for the first case that we will look at. This case islabeled as Case A.

Listing 5. The remainder of the main method.
System.out.println("Case A"); double[]realInA = {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1};double[] imagInA ={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; double[]realOutA = new double[16];double[] imagOutA = new double[16]; //Perform the transform and display the// transformed results for the original // complex series.transform.doIt(realInA,imagInA,2.0,realOutA, imagOutA);display(realOutA,imagOutA);

Note that for Case A, the input complex series contains non-zero values only in the real part. Also, most of the values in the real part are zero.

The graphic form of Case A

Case A is shown in graphic form in Figure 9 . As you can see, the input series consists of two non-zero values in the real part. All the values in theimaginary part are zero.

Figure 9. Case A. Transform of a real sample with two non-zero values.
missing image

The real part of the transform of the complex input series looks like one cycle of a cosine curve. All of the values in the imaginary part of thetransform result are zero.

The numeric output for Case A

As you saw in Listing 5 , the code in the main method calls a method named display to display the complex transform output in numeric form on the screen. The output produced by Listing 5 is shown in Figure 10 . (Note that I manually inserted line breaks to force the material to fit in this narrowpublication format.)

Questions & Answers

how does the planets on our solar system orbit
cheten Reply
how many Messier objects are there in space
satish Reply
did you g8ve certificate
Richard Reply
what are astronomy
Issan Reply
Astronomy (from Ancient Greek ἀστρονομία (astronomía) 'science that studies the laws of the stars') is a natural science that studies celestial objects and phenomena. It uses mathematics, physics, and chemistry in order to explain their origin and evolution.
Rafael
vjuvu
Elgoog
what is big bang theory?
Rosemary
what type of activity astronomer do?
Rosemary
No
Richard
the big bang theory is a theory which states that all matter was compressed together in one place the matter got so unstable it exploded releasing All its contents in the form of hydrogen
Roaul
I want to be an astronomer. That's my dream
Astrit
Who named the the whole galaxy?
Shola Reply
solar Univers
GPOWER
what is space
Richard
what is the dark matter
Richard
what are the factors upon which the atmosphere is stratified
Nicholas Reply
is the big bang the sun
Folakemi Reply
no
Sokak
bigbang is the beginning of the universe
Sokak
but thats just a theory
Sokak
nothing will happen, don't worry brother.
Vansh
what does comet means
GANGAIN Reply
these are Rocky substances between mars and jupiter
GANGAIN
Comets are cosmic snowballs of frozen gases , rock and dust that orbit the sun. They are mostly found between the orbits of Venus and Mercury.
Aarya
hllo
John
hi
John
qt rrt
John
r u there
John
hey can anyone guide me abt international astronomy olympiad
sahil
how can we learn right and true ?
Govinda Reply
why the moon is always appear in an elliptical shape
Gatjuol Reply
Because when astroid hit the Earth then a piece of elliptical shape of the earth was separated which is now called moon.
Hemen
what's see level?
lidiya Reply
Did you mean eye sight or sea level
Minal
oh sorry it's sea level
lidiya
according to the theory of astronomers why the moon is always appear in an elliptical orbit?
Gatjuol
hi !!! I am new in astronomy.... I have so many questions in mind .... all of scientists of the word they just give opinion only. but they never think true or false ... i respect all of them... I believes whole universe depending on true ...থিউরি
Govinda
hello
Jackson
hi
Elyana
we're all stars and galaxies a part of sun. how can science prove thx with respect old ancient times picture or books..or anything with respect to present time .but we r a part of that universe
w astronomy and cosmology!
Michele
another theory of universe except big ban
Albash Reply
how was universe born
Asmit Reply
there many theory to born universe but what is the reality of big bang theory to born universe
Asmit
what is the exact value of π?
Nagalakshmi
by big bang
universal
there are many theories regarding this it's on you believe any theory that you think is true ex. eternal inflation theory, oscillation model theory, multiple universe theory the big bang theory etc.
Aarya
I think after Big Bang!
Michele
from where on earth could u observe all the stars during the during the course of an year
Karuna Reply
I think it couldn't possible on earth
Nagalakshmi
in this time i don't Know
Michele
is that so. the question was in the end of this chapter
Karuna
in theory, you could see them all from the equator (though over the course of a year, not at pne time). stars are measured in "declination", which is how far N or S of the equator (90* to -90*). Polaris is the North star, and is ALMOST 90* (+89*). So it would just barely creep over the horizon.
Christopher
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