<< Chapter < Page
  Digital signal processing - dsp     Page 2 / 14
Chapter >> Page >
  • ForwardRealToComplex01 - Class that implements the DFT algorithm for spectral analysis.
  • Graph03 - Used to display various types of data. (The concepts were explained in an earlier module.)
  • Graph06 - Also used to display various types of data in a somewhat different format. (The concepts were also explained in an earlier module.)

Discussion and sample code

The program named Dsp034 , when run in conjunction with either Graph03 or Graph06 computes and plots the amplitude, real, imaginary, and phase angle spectrum for a pulsethat is read from a file named Dsp034.txt . If that file doesn't exist in the current directory, the program uses a set of defaultparameters that describe a damped sinusoidal pulse. The program also plots the pulse itself in addition to the spectral analysis results listed above.

The order of the plotted results

When the data is plotted (see Figure 2 ) using the programs Graph03 or Graph06 , the order of the plots from top to bottom in the display is:

  • The pulse
  • The amplitude spectrum
  • The real spectrum
  • The imaginary spectrum
  • The phase angle in degrees

Parameter file format

Each parameter value must be stored as characters on a separate line in the file named Dsp034.txt . The required parameters and their order and type are as follows:

  • Data length as type int
  • Pulse length as type int
  • Sample number representing zero time as type int
  • Low frequency bound as type double
  • High frequency bound as type double
  • Sample values for the pulse as type double or int (they are automatically converted to type double if they are provided as type int )

The number of sample values for the pulse must match the value for the pulselength.

Format for frequency specifications

All frequency values are specified as a double representing a fractional part of the sampling frequency. For example, a value of 0.5specifies a frequency that is half the sampling frequency.

Sample parameters for testing

Figure 1 provides a set of sample parameter values that can be used to test the program. This sample data describes a triangular pulse. Be careful when youcreate the file containing these values. Don't allow blank lines at the end of the data in the file.

Figure 1. Sample parameters for testing.
400 110 0.00.5 00 045 90135 9045 00 0

The plotting programs

The plotting program that is used to plot the output data from this program requires that the program implement GraphIntfc01 .

(I explained the plotting programs and this interface in earlier modules.)

For example, the plotting program named Graph03 can be used to plot the data produced by this program. When it is used, the following shouldbe entered at the command-line prompt:

java Graph03 Dsp034

Spectral analysis

A static method named transform belonging to the class named ForwardRealToComplex01 is used to perform the actual spectral analysis.

(I explained this class and the transform method in the earlier module titled Spectrum Analysis using Java, Sampling Frequency, Folding Frequency, and the FFT Algorithm . However, I skipped over that portion of the method that computes the phase angle. I will explain that portion of the transform method in this module.)

Questions & Answers

how to study physic and understand
Ewa Reply
what is conservative force with examples
Moses
what is work
Fredrick Reply
the transfer of energy by a force that causes an object to be displaced; the product of the component of the force in the direction of the displacement and the magnitude of the displacement
AI-Robot
why is it from light to gravity
Esther Reply
difference between model and theory
Esther
Is the ship moving at a constant velocity?
Kamogelo Reply
The full note of modern physics
aluet Reply
introduction to applications of nuclear physics
aluet Reply
the explanation is not in full details
Moses Reply
I need more explanation or all about kinematics
Moses
yes
zephaniah
I need more explanation or all about nuclear physics
aluet
Show that the equal masses particles emarge from collision at right angle by making explicit used of fact that momentum is a vector quantity
Muhammad Reply
yh
Isaac
A wave is described by the function D(x,t)=(1.6cm) sin[(1.2cm^-1(x+6.8cm/st] what are:a.Amplitude b. wavelength c. wave number d. frequency e. period f. velocity of speed.
Majok Reply
what is frontier of physics
Somto Reply
A body is projected upward at an angle 45° 18minutes with the horizontal with an initial speed of 40km per second. In hoe many seconds will the body reach the ground then how far from the point of projection will it strike. At what angle will the horizontal will strike
Gufraan Reply
Suppose hydrogen and oxygen are diffusing through air. A small amount of each is released simultaneously. How much time passes before the hydrogen is 1.00 s ahead of the oxygen? Such differences in arrival times are used as an analytical tool in gas chromatography.
Ezekiel Reply
please explain
Samuel
what's the definition of physics
Mobolaji Reply
what is physics
Nangun Reply
the science concerned with describing the interactions of energy, matter, space, and time; it is especially interested in what fundamental mechanisms underlie every phenomenon
AI-Robot
what is isotopes
Nangun Reply
nuclei having the same Z and different N s
AI-Robot
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