# 4.4 Java1485-spectrum analysis using java, forward and inverse  (Page 6/14)

 Page 6 / 14

There are more efficient ways to write this method taking known symmetry and asymmetry conditions into account. However, I wrote the method the way that Idid because I wanted it to mimic the behavior of an FFT algorithm. Therefore, the complex input must extend from zero to the sampling frequency.

The method does not implement an FFT algorithm. Rather, the inverseTransform method implements a straight-forward sampled-data version of the continuous inverse Fourier transform that is defined usingintegral calculus.

## Parameters for the inverseTransform method

The parameters to the inverseTransform method are:

• double[] realIn - incoming real data
• double[] imagIn - incoming image data
• double[] realOut - outgoing real data

The method considers the data length to be realIn.length , and considers the computational time increment to be 1.0/realIn.length .

## Assumptions

The method returns a number of points equal to the data length. It assumes that the real input consists of positive frequency points for a symmetric realfrequency function. That is, the real input is assumed to be symmetric about the folding frequency. The method does not test this assumption.

The method assumes that the imaginary input consists of positive frequency points for an asymmetric imaginary frequency function. That is, the imaginaryinput is assumed to be asymmetric about the folding frequency. Once again, the method does not test this assumption.

## A real output

A symmetric real part and an asymmetric imaginary part guarantee that theimaginary output will be all zero values. Having made that assumption, the program makes no attempt to compute an imaginary output. If the assumptionsdescribed above are not valid, the results won't be valid.

The program was tested using JDK 1.8 under Windows 7.

## Beginning of the inverseTransform method

The beginning of the class and the beginning of the static inverseTransform method is shown in Listing 5 .

Listing 5. Beginning of the class named InverseComplexToReal01.
```public class InverseComplexToReal01{ public static void inverseTransform(double[] realIn,double[] imagIn,double[] realOut){int dataLen = realIn.length; double delT = 1.0/realIn.length;double startTime = 0.0;```

Listing 5 declares and initializes some variables that will be used later.

The inverse transform computation

Listing 6 contains a pair of nested for loops that perform the actual inverse transform computation.

Listing 6. The inverse transform computation.
```//Outer loop interates on time domain // values.for(int i=0; i<dataLen;i++){ double time = startTime + i*delT;double real = 0; //Inner loop iterates on frequency// domain values. for(int j=0; j<dataLen; j++){ real += realIn[j]* Math.cos(2*Math.PI*time*j)+ imagIn[j]*Math.sin(2*Math.PI*time*j); }//end inner looprealOut[i] = real;}//end outer loop }//end inverseTransform}//end class InverseComplexToReal01```

If you have been studying the earlier modules in this series, you should be able to understand the code in Listing 6 without further explanation. Pay particular attention to the comments that describe the two for loops.

the art of managing the production, distribution and consumption.
what is economics
what is Open Market Operation
dominating middlemen men activities circumstances
what Equilibrium price
what is gap
mirwais
who is good with the indifference curve
Dexter
What is diseconomic
what are the types of goods
WARIDI
how can price determination be the central problem of micro economics
marginal cost formula
you should differentiate the total cost function in order to get marginal cost function then you can get marginal cost from it
boniphace
Foday
ok
Foday
how can price determination be the central problem if micro economics
simon
formula of cross elasticity of demand
what is ceteris paribus
what is ceteris parabus
Priyanka
Ceteris paribus - Literally, "other things being equal"; usually used in economics to indicate that all variables except the ones specified are assumed not to change.
Abdullah
What is broker
scor
land is natural resources that is made by nature
scor
What is broker
scor
what is land
kafui
What is broker
scor
land is natural resources that is made by nature
scor
whats poppina nigga turn it up for a minute get it
what is this?
Philo
am from nigeria@ pilo
Frank
am from nigeria@ pilo
Frank
so
owusu
what is production possibility frontier
owusu
it's a summary of opportunity cost depicted on a curve.
okhiria
please help me solve this question with the aid of appropriate diagrams explain how each of the following changes will affect the market price and quantity of bread 1. A
ok let me know some of the questions please.
Effah
ok am not wit some if den nw buh by tommorow I shall get Dem
Hi guys can I get Adam Smith's WEALTH OF NATIONS fo sale?
Ukpen
hello I'm Babaisa alhaji Mustapha. I'm studying Economics in the university of Maiduguri
Babaisa
okay
Humaira
my name is faisal Yahaya. i studied economics at Kaduna state university before proceeding to West African union university benin republic for masters
Faisal
Mannan
Wat d meaning of management
disaster management cycle
cooperate social responsibility
igwe
Fedric Wilson Taylor also define management as the act of knowing what to do and seeing that it is done in the best and cheapest way
OLANIYI
Difference between extinct and extici spicies
Researchers demonstrated that the hippocampus functions in memory processing by creating lesions in the hippocampi of rats, which resulted in ________.
The formulation of new memories is sometimes called ________, and the process of bringing up old memories is called ________.
Got questions? Join the online conversation and get instant answers! By Gerr Zen By  By By     By