<< Chapter < Page
  Digital signal processing - dsp     Page 3 / 19
Chapter >> Page >

Truncated sinusoids

Each pulse consists of a cosine wave that has been truncated at a different length. The frequency of the cosine wave is the same for every pulse. As youwill see when we examine the code, the frequency of the cosine wave is 0.0625 times the sampling frequency. If you do the arithmetic, you will conclude thatthis results in 16 samples per cycle of the cosine wave.

In all five cases, the length of the time series upon which spectral analysis will be performed is 400 samples. For those four cases where the length of thepulse is less than 400 samples, the remaining samples in the time series have a value of zero.

Will compute at 400 frequencies

When the spectral analysis is performed later, the number of individual frequencies at which the amplitude of the spectral energy will be computed willbe equal to the total data length. Therefore, the amplitude of the spectral energy will be computed at the same 400 frequencies for each of the five timeseries. That makes it convenient for us to stack the spectral plots up vertically and compare them (as in Figure 2 ) . This makes it easy for us to compare the distribution of energy across the frequency spectrum for pulsesof different lengths.

Graph03 and graph06

The plots in Figure 1 were produced using the program named Graph03 . Other plots in this module will be produced using the program named Graph06 . I explained those programs in earlier modules, and I provided the source code for both programs in the previous module titled Spectrum Analysis using Java, Sampling Frequency, Folding Frequency, and the FFT Algorithm . Therefore, I won't repeat those explanations or provide the source code for those programs in this module.

The program named Dsp031a

A complete listing of the program named Dsp031a is provided in Listing 9 near the end of the module.

This program displays sinusoidal pulses identical to those processed by the program named Dsp031 , which will be discussed later.

Time series containing sinusoidal pulses

The program named Dsp031a creates and displays five separate time series, each 400 samples in length. Each time series contains a pulse andthe pulses are different lengths.

Each pulse consists of a truncated sinusoid. The frequency of the sinusoid for each of the pulses is the same.

Frequency values are specified as type double as a fraction of the sampling frequency. The frequency of each sinusoid is 0.0625 times thesampling frequency.

The pulse lengths

The lengths of the five pulses are:

  • 25 samples
  • 50 samples
  • 100 samples
  • 200 samples
  • 400 samples

Beginning of the class named Dsp031a

This program is very similar to programs that I explained in previous modules in this series, so my explanation will be very brief. As usual, I will explainthe program in fragments.

The beginning of the class, along with the declaration and initialization of several variables is shown in Listing 1 . The names of the variables along with the embedded comments should make the code self explanatory.

Listing 1. Beginning of the class named Dsp031a.
class Dsp031a implements GraphIntfc01{ final double pi = Math.PI;int len = 400;//data length int numberPulses = 5;//Frequency of the sinusoids double freq = 0.0625;//Amplitude of the sinusoids double amp = 160;//Following arrays will contain sinusoidal data double[]data1 = new double[len];double[] data2 = new double[len]; double[]data3 = new double[len];double[] data4 = new double[len]; double[]data5 = new double[len];

Questions & Answers

if three forces F1.f2 .f3 act at a point on a Cartesian plane in the daigram .....so if the question says write down the x and y components ..... I really don't understand
Syamthanda Reply
hey , can you please explain oxidation reaction & redox ?
Boitumelo Reply
hey , can you please explain oxidation reaction and redox ?
Boitumelo
for grade 12 or grade 11?
Sibulele
the value of V1 and V2
Tumelo Reply
advantages of electrons in a circuit
Rethabile Reply
we're do you find electromagnetism past papers
Ntombifuthi
what a normal force
Tholulwazi Reply
it is the force or component of the force that the surface exert on an object incontact with it and which acts perpendicular to the surface
Sihle
what is physics?
Petrus Reply
what is the half reaction of Potassium and chlorine
Anna Reply
how to calculate coefficient of static friction
Lisa Reply
how to calculate static friction
Lisa
How to calculate a current
Tumelo
how to calculate the magnitude of horizontal component of the applied force
Mogano
How to calculate force
Monambi
a structure of a thermocouple used to measure inner temperature
Anna Reply
a fixed gas of a mass is held at standard pressure temperature of 15 degrees Celsius .Calculate the temperature of the gas in Celsius if the pressure is changed to 2×10 to the power 4
Amahle Reply
How is energy being used in bonding?
Raymond Reply
what is acceleration
Syamthanda Reply
a rate of change in velocity of an object whith respect to time
Khuthadzo
how can we find the moment of torque of a circular object
Kidist
Acceleration is a rate of change in velocity.
Justice
t =r×f
Khuthadzo
how to calculate tension by substitution
Precious Reply
hi
Shongi
hi
Leago
use fnet method. how many obects are being calculated ?
Khuthadzo
khuthadzo hii
Hulisani
how to calculate acceleration and tension force
Lungile Reply
you use Fnet equals ma , newtoms second law formula
Masego
please help me with vectors in two dimensions
Mulaudzi Reply
how to calculate normal force
Mulaudzi
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