Viewing tip
I recommend that you open another copy of this module in a separate browser window and use the following links to easily find and view the Figuresand Listings while you are reading about them.
Figures
- Figure 1. Five pulses in the time domain.
- Figure 2. Spectral analyses of five pulses.
- Figure 3. Expanded spectral analyses of five pulses.
- Figure 4. Five pulses with two sinusoids each.
- Figure 5. Spectral analyses of five pulses.
- Figure 6. Five pulses with additive sinusoids.
- Figure 7. Spectral analyses of five pulses.
- Figure 8. Expanded spectral analyses of five pulses.
Listings
- Listing 1. Beginning of the class named Dsp031a.
- Listing 2. The constructor.
- Listing 3. Beginning of the class named Dsp031.
- Listing 4. Beginning of the constructor.
- Listing 5. Perform the spectral analysis.
- Listing 6. New code in the the program named Dsp032a.
- Listing 7. Computation of the frequencies.
- Listing 8. Create the pulses.
- Listing 9. Dsp031a.java.
- Listing 10. Dsp031.java.
- Listing 11. Dsp032a.java.
- Listing 12. File Dsp032.java.
- Listing 13. Dsp033a.java.
- Listing 14. File Dsp033.java.
Preview
Before I get into the technical details, here is a preview of the programs and their purposes that I will present and explain in this module:
- Dsp031 - Illustrates frequency resolution versus pulse length for pulses consisting of a truncated single sinusoid.
- Dsp031a - Displays the pulses analyzed by Dsp031.
- Dsp032 - Illustrates frequency resolution versus pulse length for pulses consisting of the sum of two truncated sinusoids with closely spacedfrequencies.
- Dsp032a - Displays the pulses analyzed by Dsp032.
- Dsp033 - Illustrates frequency resolution versus pulse length for pulses consisting of the sum of two truncated sinusoids whose frequencies arebarely resolvable.
- Dsp033a - Displays the pulses analyzed by Dsp033.
In addition, I will use the following programs that I explained in the module titled Spectrum Analysis using Java, Sampling Frequency, Folding Frequency, and the FFTAlgorithm .
- 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
Five pulses in the time domain
Let's begin by looking at the time series data that will be used as input to the first spectral analysis experiment. Figure 1 shows five pulses in the time domain. Figure 2 and Figure 3 show the result of performing a spectral analysis on each of these pulses.
(The display in Figure 1 was produced by the program named Dsp031a, which I will explain later.)
Figure 1. Five pulses in the time domain. |
---|
|
The lengths of the pulses
If you examine Figure 1 carefully, you will see that each pulse is twice as long as the pulse above it. (There is a tick mark on the horizontal axes every twenty-five samples.) The bottom pulse is 400 samples long while the top pulse is 25 samples long.