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

what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
What would be the best educational aid(s) for gifted kids/savants?
Heidi Reply
treat them normal, if they want help then give them. that will make everyone happy
Saurabh
What are the treatment for autism?
Magret Reply
hello. autism is a umbrella term. autistic kids have different disorder overlapping. for example. a kid may show symptoms of ADHD and also learning disabilities. before treatment please make sure the kid doesn't have physical disabilities like hearing..vision..speech problem. sometimes these
Jharna
continue.. sometimes due to these physical problems..the diagnosis may be misdiagnosed. treatment for autism. well it depends on the severity. since autistic kids have problems in communicating and adopting to the environment.. it's best to expose the child in situations where the child
Jharna
child interact with other kids under doc supervision. play therapy. speech therapy. Engaging in different activities that activate most parts of the brain.. like drawing..painting. matching color board game. string and beads game. the more you interact with the child the more effective
Jharna
results you'll get.. please consult a therapist to know what suits best on your child. and last as a parent. I know sometimes it's overwhelming to guide a special kid. but trust the process and be strong and patient as a parent.
Jharna
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