<< Chapter < Page
  Digital signal processing - dsp     Page 11 / 14
Chapter >> Page >
Figure 5. Filtering in the frequency domain.
missing image

Compare the results

The basic plotting format of Figure 5 is the same as Figure 4 .

Compare Figure 5 With Figure 4

The first difference to note between the two figures is that I moved the impulse in the input time series in the topmost plot sixteen samples further tothe right in Dsp038 .

(This has no impact on the final result, which you can verify by modifying the program to move the impulse to a different position and thencompiling and running the modified program.)

Compare the bandwidth of the pass band

The second difference to note is shown in the modified amplitude spectrum in the fourth plot in the two figures. The bandwidth of the pass band issignificantly narrower in Figure 5 than in Figure 4 . Also, the pass band in Figure 4 extends all the way down to zero frequency, while Figure 5 eliminates all energy below a frequency of three thirty-seconds of the sampling frequency.

Waveforms of filtered impulse

Finally, note the waveforms of the two filtered impulses. The overall amplitude of the filtered impulse in Figure 5 is less than in Figure 4 , simply because it contains less total energy. In addition, the filtered impulse in Figure 5 is broader than the filtered impulse in Figure 4 . This is because it has a narrower bandwidth.

(Pulses that are narrow in terms of time duration require a wider bandwidth than pulses that have a longer time duration. The time duration ofthe pulse tends to be inversely related to the required bandwidth for the pulse.)

Run the programs

I encourage you to copy, compile, and run the programs provided in this module. Experiment with them, making changes and observing the results of yourchanges.

Create more complex experiments. For example, use more complex input time series when experimenting with frequency filtering. Apply differentmodifications to the complex spectrum when experimenting with frequency filtering.

Most of all enjoy yourself and learn something in the process.

Summary

This module illustrates and explains forward and inverse Fourier transforms using both DFT and FFT algorithms.

The module also illustrates and explains the implementation of frequency filtering by modifying the complex spectrum in the frequency domain and thentransforming the modified complex spectrum back into the time domain.

Complete program listings

Complete listings of the programs discussed in this module are provided below.

Listings for other programs mentioned in the module, such as Graph03 and Graph06 , are provided in other modules. Those modules are identified in the text of this module.

Listing 14. Dsp035.java.
import java.util.*; class Dsp035 implements GraphIntfc01{final double pi = Math.PI; int len = 256;double[] timeDataIn = new double[len]; double[]realSpect = new double[len];double[] imagSpect = new double[len]; double[]angle = new double[len];//unuseddouble[] magnitude = new double[len]; double[]timeDataOut = new double[len];int zero = 0; public Dsp035(){//constructor//Create the raw data pulses timeDataIn[0]= 0; timeDataIn[1]= 50; timeDataIn[2]= 75; timeDataIn[3]= 80; timeDataIn[4]= 75; timeDataIn[5]= 50; timeDataIn[6]= 25; timeDataIn[7]= 0; timeDataIn[8]= -25; timeDataIn[9]= -50; timeDataIn[10]= -75; timeDataIn[11]= -80; timeDataIn[12]= -60; timeDataIn[13]= -40; timeDataIn[14]= -26; timeDataIn[15]= -17; timeDataIn[16]= -11; timeDataIn[17]= -8; timeDataIn[18]= -5; timeDataIn[19]= -3; timeDataIn[20]= -2; timeDataIn[21]= -1; timeDataIn[240]= 80; timeDataIn[241]= 80; timeDataIn[242]= 80; timeDataIn[243]= 80; timeDataIn[244]= -80; timeDataIn[245]= -80; timeDataIn[246]= -80; timeDataIn[247]= -80; timeDataIn[248]= 80; timeDataIn[249]= 80; timeDataIn[250]= 80; timeDataIn[251]= 80; timeDataIn[252]= -80; timeDataIn[253]= -80; timeDataIn[254]= -80; timeDataIn[255]= -80; //Create raw data sinusoidfor(int x = len/3;x<3*len/4;x++){ timeDataIn[x]= 80.0 * Math.sin( 2*pi*(x)*1.0/20.0);}//end for loop //Compute DFT of the time data and save it in// the output arrays. ForwardRealToComplex01.transform(timeDataIn,realSpect, imagSpect,angle, magnitude,zero, 0.0,1.0); //Compute inverse DFT of spectral data and// save output time data in output array InverseComplexToReal01.inverseTransform(realSpect, imagSpect,timeDataOut); }//end constructor//-------------------------------------------// //The following six methods are required by the// interface named GraphIntfc01. public int getNmbr(){//Return number of curves to plot. Must not // exceed 5.return 5; }//end getNmbr//-------------------------------------------// public double f1(double x){int index = (int)Math.round(x); if(index<0 || index>timeDataIn.length-1){ return 0;}else{ return timeDataIn[index]; }//end else}//end function //-------------------------------------------//public double f2(double x){ int index = (int)Math.round(x);if(index<0 || index>realSpect.length-1){ return 0;}else{ //scale for convenient viewingreturn 5*realSpect[index];}//end else }//end function//-------------------------------------------// public double f3(double x){int index = (int)Math.round(x); if(index<0 || index>imagSpect.length-1){ return 0;}else{ //scale for convenient viewingreturn 5*imagSpect[index];}//end else }//end function//-------------------------------------------// public double f4(double x){int index = (int)Math.round(x); if(index<0 || index>magnitude.length-1){ return 0;}else{ //scale for convenient viewingreturn 5*magnitude[index];}//end else }//end function//-------------------------------------------// public double f5(double x){int index = (int)Math.round(x); if(index<0 || index>timeDataOut.length-1){ return 0;}else{ return timeDataOut[index]; }//end else}//end function }//end sample class Dsp035

Questions & Answers

Discuss the differences between taste and flavor, including how other sensory inputs contribute to our  perception of flavor.
John Reply
taste refers to your understanding of the flavor . while flavor one The other hand is refers to sort of just a blend things.
Faith
While taste primarily relies on our taste buds, flavor involves a complex interplay between taste and aroma
Kamara
which drugs can we use for ulcers
Ummi Reply
omeprazole
Kamara
what
Renee
what is this
Renee
is a drug
Kamara
of anti-ulcer
Kamara
Omeprazole Cimetidine / Tagament For the complicated once ulcer - kit
Patrick
what is the function of lymphatic system
Nency Reply
Not really sure
Eli
to drain extracellular fluid all over the body.
asegid
The lymphatic system plays several crucial roles in the human body, functioning as a key component of the immune system and contributing to the maintenance of fluid balance. Its main functions include: 1. Immune Response: The lymphatic system produces and transports lymphocytes, which are a type of
asegid
to transport fluids fats proteins and lymphocytes to the blood stream as lymph
Adama
what is anatomy
Oyindarmola Reply
Anatomy is the identification and description of the structures of living things
Kamara
what's the difference between anatomy and physiology
Oyerinde Reply
Anatomy is the study of the structure of the body, while physiology is the study of the function of the body. Anatomy looks at the body's organs and systems, while physiology looks at how those organs and systems work together to keep the body functioning.
AI-Robot
what is enzymes all about?
Mohammed Reply
Enzymes are proteins that help speed up chemical reactions in our bodies. Enzymes are essential for digestion, liver function and much more. Too much or too little of a certain enzyme can cause health problems
Kamara
yes
Prince
how does the stomach protect itself from the damaging effects of HCl
Wulku Reply
little girl okay how does the stomach protect itself from the damaging effect of HCL
Wulku
it is because of the enzyme that the stomach produce that help the stomach from the damaging effect of HCL
Kamara
function of digestive system
Ali Reply
function of digestive
Ali
the diagram of the lungs
Adaeze Reply
what is the normal body temperature
Diya Reply
37 degrees selcius
Xolo
37°c
Stephanie
please why 37 degree selcius normal temperature
Mark
36.5
Simon
37°c
Iyogho
the normal temperature is 37°c or 98.6 °Fahrenheit is important for maintaining the homeostasis in the body the body regular this temperature through the process called thermoregulation which involves brain skin muscle and other organ working together to maintain stable internal temperature
Stephanie
37A c
Wulku
what is anaemia
Diya Reply
anaemia is the decrease in RBC count hemoglobin count and PVC count
Eniola
what is the pH of the vagina
Diya Reply
how does Lysin attack pathogens
Diya
acid
Mary
I information on anatomy position and digestive system and there enzyme
Elisha Reply
anatomy of the female external genitalia
Muhammad Reply
Organ Systems Of The Human Body (Continued) Organ Systems Of The Human Body (Continued)
Theophilus Reply
what's lochia albra
Kizito
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