# 4.2 Java1483-spectrum analysis using java, frequency resolution  (Page 3/19)

 Page 3 / 19

## 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

How we are making nano material?
LITNING Reply
what is a peer
LITNING Reply
What is meant by 'nano scale'?
LITNING Reply
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
Adin
why?
Adin
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
Maciej
characteristics of micro business
Abigail
for teaching engĺish at school how nano technology help us
Anassong
How can I make nanorobot?
Lily
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
how can I make nanorobot?
Lily
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

### Read also:

#### Get the best Algebra and trigonometry course in your pocket!

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?

 By By By By