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

The class named Transform

Listing 2 presents the beginning of the class named Transform . Listing 2 also presents the beginning of an instance method of that class named doIt . The doIt method computes and returns the complex transform (via output parameters) of an incoming complex series.

Listing 2. The class named Transform.
class Transform{ void doIt(double[]realIn, double[]imagIn, double scale,double[] realOut,double[] imagOut){

The method parameters

The doIt method receives five incoming parameters. The first two parameters are references to two array objects of type double containing the real and imaginary parts of the input series.

The third parameter is a scale factor that is applied to the transform output in an attempt to keep the values in a range suitable for plotting if desired.

The last two parameters are references to array objects of type double . The results of performing the transform are used to populate these two arrays. This is the mechanism by which the object returns thetransform results to the calling program. It is assumed that all of the elements in these two array objects contain values of zero upon entry to the doIt method.

Performing the transform

The body of the doIt method is presented in Listing 3 . The code in Listing 3 iterates on the input arrays, passing each complex sample contained in those two arrays to a method named correctAndRecombine .

Listing 3. Performing the transform.
for(int cnt = 0;cnt<realIn.length;cnt++){ correctAndRecombine(realIn[cnt], imagIn[cnt], cnt,realIn.length, scale,realOut, imagOut);}//end for loop }//end doIt

The transforms of the complex input samples

Each complex value in the incoming arrays represents both a complex sample and the transform of that complex sample under the assumption that the complexsample appears at the origin of the input series.

Correct for actual position and recombine

The method named correctAndRecombine corrects the transform result for each of the complex samples in the series so as to reflect the actualposition of the complex sample in the original input series.

Then the method named correctAndRecombine adds the corrected transform result into a pair of accumulators, one for the real part and one forthe imaginary part. This accomplishes the recombination of the corrected transforms of the input samples in order to produce the transform of the entireoriginal complex input series.

The correctAndRecombine method

The correctAndRecombine method is shown in Listing 4 . Listing 4 also signals the end of the Transform class.

Listing 4. The correctAndRecombine method.
void correctAndRecombine(double realSample, double imagSample,int position, int length,double scale, double[]realOut, double[]imagOut){ //Calculate the complex transform values for// each sample in the complex output series. for(int cnt = 0; cnt<length; cnt++){ double angle =(2.0*Math.PI*cnt/length)*position; //Calculate output based on real inputrealOut[cnt] +=realSample*Math.cos(angle)/scale; imagOut[cnt]+= realSample*Math.sin(angle)/scale;//Calculate output based on imag input realOut[cnt]-= imagSample*Math.sin(angle)/scale;imagOut[cnt] +=imagSample*Math.cos(angle)/scale; }//end for loop}//end correctAndRecombine }//end class transform

Questions & Answers

what is microbiology
Nyoik Reply
What are antibodies?
Happy Reply
they are immune cells that are released by immune system to fight strangers like microbes
Ahmed
a blood protien produce in response to an counteracting a specific antigen
Pooja
Why salmonella typhi is harmful protozoan?
Saily Reply
because make typhoid that is considered as a food born illness
Ahmed
Name any five modes of transmission.
Happy
what are the scientific names and common names of some microbes
Rich Reply
Staphylococcus aureus - staph Streptococcus pyogenes - strep Botulism - Clostridium botulinum Rocky Mountain spotted fever - Rickettsia rickettsii Diphtheria - Corynebacterium diphtheriae Gonorrhea - Neisseria gonorrhoeae
Tammy
what are the limitations of the Koch's postulate
Naa
how a microorganism growth.
Zubair Reply
Is foetus a parasite to his or her mother? if yes and if no ho
Mashauri Reply
y
Yusri
yes
Yashkin
yes
Zubair
yes it a parasite to the mother because it feeds on the mother for survival
Beatrice
yes
Redwan
no
Elasha
definition of a parasite: an organism that lives in or on an organism of ANOTHER species (its host) and benefits by deriving nutrients at the other's expense
Elasha
no because an organism can inky be a parasite if it causes harm to its HOST. And the fetus does not cause harm to its mother under normal conditions
aliyu
yes
Naa
what is biosensor in microbiology
Raja Reply
What are biosensor
Raja
what's are biosensor
Raja
what is microbiology defination
Rinku Reply
microbiology is the study of small or manuit organisms which cannot be seen with our nacked eyes unless with the aid of the microscope
Brandina
is the study of living organisms which are not directly visible to a direct eye but can only be seen under a microscope
Ipa
ok
Ipa
microbiology is the study of living organisms of microscopic size it is also the study of micro organisms with their form structure reproduction psychology metabolism and classification
Priyanka
ok
Aminu
Microbiology are the study of microorganisms either microscopic or sub microscopic creaters mainly unicellulars, multicellulars and subcellulars. Such as protozoa,bacteria and viruses.
Rana
it is the biological study of viruses, fungi, protozoa, bacteria which in collective name are called micro organisms, unlike microscopic organisms being invisible, that requires a magnifications with the help of a microscope.
Mohamed
what are the importances of Microbiology?
Erick Reply
don't know
SINGLE
we obtained the insulin from the bacteria. and some microorganisms are decomposer in ecosystems.
Zubair
nitrogen in the air is fixed into the soil by microbes example is nitrobactor
Matilda
yes
Zubair
how a weak immune region where microorganisms attack easily?
Zubair Reply
with examples differentiate gram positive from gram negative bacteria
Mary Reply
Differentiate gram positive from gram negative
Mary
I have no idea
Zubair
hello
Kuonain
and example of gram negative is E. coli
Pooja
gram positive stain purple when subjected to gram stain whilst gram positive bacterial has thick wall composed of peptidoglycan
Matilda
ok
Zubair
what is a process of gene expression in eukaryotes ?
Nayyab Reply
pls help us with the answer
Abdussalam
spontaneous generation means
Siddhi Reply
hiii
Siddhi
Hello
eman
So, what's next 😂
eman
I have a problem with Micro
eman
I studying things and see question Some thing else
eman
Can u help me, please
eman
What i havta do
eman
firsfall when you studying understand things...
Siddhi
good afternoon dear Friends
yaya
Greeting to everyone in here.
Manka
There is a problem. I need a diagram of a virus with it functions.
Manka
structure of bacterial
Kuyiba
gghhhh
Zubair
group plz i need help in microbio
Kuonain
it really difficult fr me
Kuonain
kashur cha kah
suhail
sorry now I read in class 8th but I can help u
Zubair
Me too. It's very difficult for me
Angela
rod shape
Priyanka
helical
Priyanka
Hello
esike
spherical
Priyanka
peomorphic
Priyanka
I am ryt or not
Priyanka
hi
suhail
hello
DIPTI
Are we together pls what's the topic for the day?
esike
what is innate
Lizzy
innate means natural
Pooja
the genetic makeup of an individual
Matilda
pls i need the common names for the following parasites..ENTEROBIUS VERMICULARIS,NECATOR AMERICANUS,ASCARIES LUMBRICOIDES,TRICHURIS TRICHIURA,TRICHOMONAS VAGINALIS,GIARDIA LAMBLIA,ENTAMOEBA HISTOLYTICA,SCHISTOSOMA MANSONI,SCHISTOSOMAHEMATOBIUM,STROGYLOIDES STERCORALIS,AND TRAPANOSOMA BRUCI GAMBIENSE
timothy
ENTEROBIUS VERMICULARIS and STROGYLOIDES STERCORALIS have the same common name which is pin worm and thread worm
Chinedu
I didn't find the common names for TRICHOMONAS VAGINALIS, GIARDIA LAMBLIA, ENTAMOEBA HISTOLYTICA, TRYPANOSOMA BRUCEI GAMBIENSE
Chinedu
NECATOR AMERICANUS - New world hookworm ASCARIS LUMBRICOIDES- Ascarid TRICHURIS TRICHIURA- Whip worm
Chinedu
Hi guys
Chinedu
Why are myeloblasts not present in the bloodstream?
Chinedu
thank u
Dasaah
is blood from capillary puncture suitable for hormonal assays
NANCY Reply
Direct this question to a hematologist for a better answer please.
LAFIA
In most cases the blood is necessary but it's limited from my own Analysis
Lee
u can do but it depends on your sampling blood its enev or not
Ali
Control indications of cipro, doxicyclin, setracyclin, cloxacyclin, erythromycin
Oslen Reply
oo
babinthe
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?

Ask