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

As the frequency of the sine wave continues to increase beyond that point, without a corresponding change in the sampling frequency, it is impossible todetermine from the samples so obtained whether the frequency is increasing or decreasing.

An ambiguity in the spectrum analysis

As a result, the spectrum analysis process was unable to determine if the peak in the frequency spectrum was below or above the folding frequency. Thus,the bottom trace in Figure 3 shows two peaks which are mirror images of one another with the folding frequency being half way between the two peaks.

(As a practical matter, when doing spectrum analysis, there is no point in computing the values above the folding frequency. I did that here just toillustrate that there is a folding frequency, which is equal to one-half the sampling frequency.)

Let's see some code

The class used to produce the data displayed in Figure 3 is named Dsp002 . A complete listing of this class definition is shown in Listing 38 near the end of the module.

I will break this class down into fragments and briefly discuss it to show how you can define significant classes and easily connect them to the generalizedplotting program named Graph01 .

As before, having compiled the class named Dsp002 , you would exercise it by entering the following at a command prompt:

java Graph01 Dsp002

Different from the previous example class

This class differs from the class named Graph01Demo in one very significant way. In that class, all the values returned by the methods named f1 through f5 were computed on the fly as the methods were called.

In this new class named Dsp002 , all the data is generated and stored in array objects when an object of the class named Dsp002 is instantiated. When the methods named f1 through f5 are called later, they simply retrieve the data from the array objects and return that data to the plotting program.

Basic operation of the program

As mentioned earlier, this program applies a narrow-band convolution filter to white noise, and then computes the amplitude spectrum of the filtered noiseusing a Discrete Fourier Transform (DFT) algorithm. The spectrum of the white noise is also computed. All of the processing occurs when an object of the classis instantiated, and the processed results are saved in arrays.

The input noise, the filter, the filtered output, and the two spectra are deposited in five arrays for later retrieval and display. The data in the fivearrays are returned by the methods named f1 , f2 , f3 , f4 , and f5 respectively.

The values that are returned by the methods are scaled for appropriate display in the plotting areas provided by the program named Graph01 .

Beginning of the class named Dsp002

The code in Listing 9 establishes the data lengths for the white noise, the convolution filter, the filtered output, and the spectrum.

Listing 9. Beginning of the class named Dsp002.
class Dsp002 implements GraphIntfc01{ int operatorLen = 33;int dataLen = 256+operatorLen; int outputLen = dataLen - operatorLen;int spectrumPts = outputLen;

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