<< Chapter < Page Chapter >> Page >
Proper use of the FFT  command can be done as in specsin1.m  (the top graph), which plots only the positive frequencies, or as in specsin2.m  (the bottom graph), which shows the full magnitude spectrum symmetric about f=0.
Proper use of the FFT command can be done as in specsin1.m(the top graph), which plots only the positive frequencies, or as in specsin2.m(the bottom graph), which shows the full magnitude spectrum symmetric about f = 0 .

The second solution requires more bookkeeping of indices, but gives plots that more closely accord with continuous-timeintuition and graphs. specsin2.m exploits the built in function fftshift , which shuffles the output of the FFT command so that the negative frequencies occur on the left, the positivefrequencies on the right, and DC in the middle. f=100; Ts=1/1000; time=10.0;               % freq, sampling interval, time t=Ts:Ts:time;                              % define a time vectorw=sin(2*pi*f*t);                           % define the sinusoid N=2^10;                                    % size of analysis windowssf=(-N/2:N/2-1)/(Ts*N);                   % frequency vector fw=fft(w(1:N));                            % do DFT/FFTfws=fftshift(fw);                          % shift it for plotting plot(ssf,abs(fws))                         % plot magnitude spectrum

specsin2.m spectrum of a sine wave via the FFT/DFT (download file)
[link] , which shows the complete magnitude spectrum for both positive and negative frequencies. It is also easy toplot the phase spectrum by substituting phase for abs in either of the preceding two programs.

Explore the limits of the FFT/DFT technique by choosing extreme values. What happens when:

  1. f becomes too large? Try f = 200, 300, 450, 550, 600, 800, 2200 Hz. Comment on the relationship between f and Ts .
  2. Ts becomes too large? Try Ts = 1/500, 1/250, 1/50. Comment on the relationship between f and Ts . (You may have to increase time in order to have enough samples to operate on.)
  3. N becomes too large or too small? What happens to the location in the peak of the magnitude spectrum when N = 2 11 , 2 14 , 2 8 , 2 4 , 2 2 , 2 20 ? What happens to the width of the peak in each of these cases? (You may have to increase time in order to have enough samples to operate on).

Replace the sin function with sin 2 . Use What is the spectrum of sin 2 ? What is the spectrum of sin 3 ? Consider sin k . What is the largest k for which the results make sense? Explain what limitations there are.

Replace the sin function with sinc . What is the spectrum of the sinc function? What is the spectrum of sinc 2 ?

Plot the spectrum of w ( t ) = sin ( t ) + j e - t . Should you use the technique of specsin1.m or of specsin2.m ? Hint: Think symmetry.

The FFT of a real sequence is typically complex, and sometimes it is important to look at the phase (as well asthe magnitude).

  1. Let For phi= 0, 0.2, 0.4, 0.8, 1.5, 3.14, find the phase of the FFT output at the frequencies ± f .
  2. Find the phase of the output of the FFT when

These are all examples of “simple” functions, which can be investigated (in principle, anyway) analytically.The greatest strength of the FFT/DFT is that it can also be used for the analysis of data when no functional form isknown. There is a data file on the website called gong.wav , which is a sound recording of an Indonesian gong (a large struck metalplate). The following code reads in the waveform and analyzes its spectrum using the FFT. Make sure that thefile gong.wav is in an active M atlab path, or you will get a “file not found” error. If there is a sound card (and speakers)attached, the sound command plays the .wav file at the sampling rate f s = 1 / T s . filename='gong.wav';                  % name of wave file goes here [x,sr]=wavread(filename);             % read in wavefile Ts=1/sr;                              % sample interval and # of samplesN=2^15; x=x(1:N)';                    % length for analysis sound(x,1/Ts)                         % play sound, if sound card installedtime=Ts*(0:length(x)-1);              % establish time base for plotting subplot(2,1,1), plot(time,x)          % and plot top figuremagx=abs(fft(x));                     % take FFT magnitude ssf=(0:N/2-1)/(Ts*N);                 % establish freq base for plottingsubplot(2,1,2), plot(ssf,magx(1:N/2)) % plot mag spectrum

specgong.m find spectrum of the gong sound (download file)
specgong.m results in the plot shown in [link] . The top figure shows the time behavior of the sound as it rises very quickly (when the gongis struck) and then slowly decays over about 1.5 seconds. The variable N defines the window over which the frequency analysis occurs. The middle plot shows the completespectrum, and the bottom plot zooms in on the low frequency portion where the largest spikes occur. This sound consists primarilyof three major frequencies, at about 520, 630, and 660 Hz. Physically, these represent the three largest resonant modesof the vibrating plate.

Questions & Answers

what is defense mechanism
Chinaza Reply
what is defense mechanisms
Chinaza
I'm interested in biological psychology and cognitive psychology
Tanya Reply
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
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, Software receiver design. OpenStax CNX. Aug 13, 2013 Download for free at http://cnx.org/content/col11510/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Software receiver design' conversation and receive update notifications?

Ask