<< Chapter < Page
  Digital signal processing - dsp     Page 2 / 24
Chapter >> Page >

Listings

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:

  • Dsp029 - Provides a visual illustration of the impact of the sampling frequency and the Nyquist folding frequency.
  • Dsp028 - Driver program for doing spectral analysis using a DFT algorithm.
  • ForwardRealToComplex01 - Class that implements the DFT algorithm.
  • Dsp030 - Driver program for doing spectral analysis using an FFT algorithm.
  • ForwardRealToComplexFFT01 - Class that implements the FFT algorithm (will defer explanation until a future module).
  • Graph03 - Used to display results of spectral analysis. (The concepts were explained in the earlier module titled Plotting Engineering and Scientific Data using Java .)
  • Graph06 - Used to display the impact of sampling frequency and the Nyquist folding frequency. Also used to display the results of spectralanalysis. (The concepts were explained in the earlier module titled Plotting Engineering and Scientific Data using Java .)

Discussion and sample code

This will be a long module involving lots of code and lots of explanations, so fill your cup with java and let's get started.

Sampling frequency and the Nyquist folding frequency

I will begin the discussion with the program named Dsp029 , which provides a visual illustration of the impact of the sampling frequency andthe Nyquist folding frequency. A complete listing of this program is shown in Listing 16 near the end of the module.

Display sinusoids

This program generates and displays up to five sinusoids having the same sampling frequency but having different sinusoidal frequencies and amplitudes.The program provides a visual illustration of the way in which frequencies above one-half the sampling frequency fold back into the area bounded by zero andone-half the sampling frequency.

(The frequency at one-half the sampling frequency is known as the Nyquist folding frequency.)

Input parameters

The program gets its input parameters from a file named Dsp029.txt . If that file doesn't exist in the current directory, the program uses a set ofdefault parameters.

Each parameter value must be stored as characters on a separate line in the file named Dsp029.txt . The required parameters are shown in Figure 1 .

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