<< Chapter < Page
  Digital signal processing - dsp     Page 13 / 25
Chapter >> Page >

To make a long story short, the class named Convolve01 provides a static method named convolve , which applies an incoming convolution operator to an incoming set of data and deposits thefiltered data in an output array whose reference is received as an incoming parameter.

This class could easily be broken out and put in a library as a stand-alone class, or the convolve method could be added to a class containing a variety of DSP methods.

The discrete Fourier transform (dft)

The entire class named Dft01 is shown in Listing 18 .

As with convolution, if you already understand the discrete Fourier transform, you will probably find the code in this class to be straightforward.If not, the code will probably still be straightforward, but the reasons for the code may be obscure. Since the purpose of this module is not to explain digitalsignal processing concepts, I won't attempt to provide a detailed explanation for the code in this method at this time.

Listing 18. The discrete Fourier transform (DFT).
class Dft01{ public static void dft(double[] data,int dataLen, double[]spectrum){ //Set the frequency increment to// the reciprocal of the data // length. This is convenience// only, and is not a requirement // of the DFT algorithm.double delF = 1.0/dataLen; //Outer loop iterates on frequency// values. for(int i=0; i<dataLen;i++){ double freq = i*delF;double real = 0; double imag = 0;//Inner loop iterates on time- // series points.for(int j=0; j<dataLen; j++){ real += data[j]*Math.cos( 2*Math.PI*freq*j);imag += data[j]*Math.sin(2*Math.PI*freq*j); spectrum[i]= Math.sqrt( real*real + imag*imag);}//end inner loop }//end outer loop}//end dft }//end Dft01

Once again, to make a long story short, this class provides a static method named dft , which computes and returns the amplitude spectrum of an incoming time series.

The amplitude spectrum is computed as the square root of the sum of the squares of the real and imaginary parts.

A DFT algorithm can compute any number of points in the frequency domain. In this case, the number of points computed in the frequency domain is equal to thenumber of samples in the incoming time series, which is a fairly common practice.

The method deposits the frequency data in an array whose reference is received as an incoming parameter.

As with convolution, this class could easily be broken out and put in a library as a stand-alone class, or the dft method could be added to a class containing a variety of DSP methods.

Two plotting programs

Now that you have examined the sample data-generator programs, some of you may be interested in an explanation of the plotting program itself.

If you are interested only in how to use the plotting programs, and are not interested in the programming details of the plotting programs, skip ahead tothe section titled Run the Program .

If you are interested in learning how the plotting programs do what they do, keep reading.

Questions & Answers

what is phylogeny
Odigie Reply
evolutionary history and relationship of an organism or group of organisms
AI-Robot
ok
Deng
what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
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