OneStopGate.Com
OnestopGate   OnestopGate
   Monday, April 29, 2024 Login  
OnestopGate
Home | Overview | Syllabus | Tutorials | FAQs | Downloads | Recommended Websites | Advertise | Payments | Contact Us | Forum
OneStopGate

GATE Resources
Gate Articles
Gate Books
Gate Colleges 
Gate Downloads 
Gate Faqs
Gate Jobs
Gate News 
Gate Sample Papers
Training Institutes

GATE Overview
Overview
GATE Eligibility
Structure Of GATE
GATE Coaching Centers
Colleges Providing M.Tech/M.E.
GATE Score
GATE Results
PG with Scholarships
Article On GATE
Admission Process For M.Tech/ MCP-PhD
GATE Topper 2012-13
GATE Forum




GATE 2025 Exclusive
Organizing Institute
Important Dates
How to Apply
Discipline Codes
GATE 2025 Exam Structure

GATE 2025 Syllabus
Aerospace Engg..
Agricultural Engg..
Architecture and Planning
Chemical Engg..
Chemistry
Civil Engg..
Computer Science / IT
Electronics & Communication Engg..
Electrical Engg..
Engineering Sciences
Geology and Geophysics
Instrumentation Engineering
Life Sciences
Mathematics
Mechanical Engg..
Metallurgical Engg..
Mining Engg..
Physics
Production & Industrial Engg..
Pharmaceutical Sciences
Textile Engineering and Fibre Science

GATE Study Material
Aerospace Engg..
Agricultural Engg..
Chemical Engg..
Chemistry
Civil Engg..
Computer Science / IT
Electronics & Communication Engg..
Electrical Engg..
Engineering Sciences
Instrumentation Engg..
Life Sciences
Mathematics
Mechanical Engg..
Physics
Pharmaceutical Sciences
Textile Engineering  and Fibre Science

GATE Preparation
GATE Pattern
GATE Tips N Tricks
Compare Evaluation
Sample Papers 
Gate Downloads 
Experts View

CEED 2013
CEED Exams
Eligibility
Application Forms
Important Dates
Contact Address
Examination Centres
CEED Sample Papers

Discuss GATE
GATE Forum
Exam Cities
Contact Details
Bank Details

Miscellaneous
Advertisment
Contact Us


Home » GATE Study Material » Electrical Engineering » Time and Frequency » FFT Example - Done Using Matlab

FFT Example - Done Using Matlab

Looking for GATE Preparation Material? Join & Get here now!

** Gate 2013 Question Papers.. ** CEED 2013 Results.. ** Gate 2013 Question Papers With Solutions.. ** GATE 2013 CUT-OFFs.. ** GATE 2013 Results.. **

FFT Example - Done Using Matlab

An FFT Example - Done Using Matlab

        In this note we are going to analyze a triangle signal using the FFT. Here is the signal.


  • The signal has 4000 samples, and the length of the record is 2 milliseconds.  (It goes from -.001 seconds to +.001 seconds.)

  • Since the length of the record is 2 milliseconds, if we compute the FFT for the entire record (which we would normally do), then the fundamental frequency in the computed results is going to be 1/.002 = 500 Hz.  We will refer to this as the fundamental frequency of the data record.

  • Within the data record is the triangle signal, and it has a period of 1 millisecond, so it has a frequency of 1 KHz.

Now, we need to examine what happens when we FFT this signal.  We will use the m-file below.  This basic m-file was discussed in another note.
    • Data=dlmread('5VoltSqWvDataInclT.txt','\t');

    • Time = Data(:,1);

    • VData = Data(:,2);

    • plot(Time,VData)

    • pause

    • SigFFT = fft(VData);

    • plot(abs(SigFFT))

Now, if we look at the plot of the absolute value of the SigFFT array, we get a plot like the one below.

        Now, the fundamental frequency of the data record is 500 Hz.  You need to be able to get from that to the actual frequency components of the signal.  Here is what you need to use.

  • The fundamental frequency of the data record is the reciprocal of the length (in seconds) of the data record.

  • In Matlab, the indices start from one.  So, ao, is going to be placed in SigFFT(1) in our m-file above.  Here is a short table of frequencies, indices, etc.

Index

Harmonic of the fundamental frequency of the data record

 The actual frequency

 SigFFT(1)

 0

0 Hz (DC)

 SigFFT(2)

1

500 Hz

 SigFFT(3)

2

 1000 Hz

(1 KHz)

 SigFFT(4)

3

 1500 Hz

SigFFT(5)

4

2000 Hz

SigFFT(6)

5

2500 Hz

SigFFT(7)

6

3000 Hz

        Now, we can get at the frequencies in the FFT plot.  Notice the following.

  • The first "spike" in the FFT plot is at SigFFT(3).  That corresponds to 1000 Hz which is the fundamental of the signal.  It is not the fundamental of the data record.  It is, however, related to the fact that there are exactly two cycles of the signal in the length of the data record.

  • The second "spike" in the FFT plot is at SigFFT(7).  That corresponds to 3000 Hz which is the third harmonic of the signal.

  • and so on. . .

        With that, you should be able to interpret the horizontal scale of the FFT plot  - at least the plots that Matlab produces.

        Now, we need to address the vertical scale.  First, you should realize that the vertical plot is the absolute value of the c's in the Fourier expansion.  If you need to understand what the c's are, check these links.

        When we did the calculation, we found that the third element in the SigFFT array (That's the one that is the first, large value - somewhere over 8000 on the plot!.) has a value of 8,103.  That's not a number that we would expect from a triangle wave that has an amplitude of 5 volts.

        The explantion for the seemingly ridiculous value of over 8000 is this:

    • The calculation does not include the 2/N term.  Type "help FFT" (without the quote marks!) in the Matlab workspace for the explanation of what it actually calculates.  What is boils down to is that there is a missing 2/N term.  You have to compensate for that.  In a five volt triangle wave with 4000 data points, the first harmonic of the triangle wave should be 8A/(p2) (where A= 5 for our signal).Here are some links to pages with the expressions for the Fourier Series of a triangle wave signal.  That's where we got that amplitude for the first harmonic.

      • A page from Wolfram Research (the folks who make Mathematica).  There is a lot of information on this one web page.  You may want to print it out.

      • A Java Simulator

      • A nice derivation of the coefficients

    • The actual first harmonic (i.e., the fundamental) of a triangle wave of amplitude A is 8A/p2, and that would calculate out to about 4.053.  To get from 8,103 to 4.053 you need to multiply 8,103 by 2/4000 (that's 2/N).  Try it, and the result is very close to 4.053


What do you conclude from this?

        From the material above, you should be able to determine the actual Fourier Series components if you have a signal in a file.  You should be able to distinguish between the fundamental frequency of the data record and the fundamental frequency of the signal embedded in the data record - if that signal is periodic.  And, you should be able to determine the frequencies present in the signal, as well as the amplitudes.

 


What if the signal doesn't have an integral number of periods in the data record?

        Here is an example of a signal with 2.5 periods in the data record.  In this signal, we only have 2000 points, so we have to factor that in.

You can see that there is not an integral number of periods in the data record.  Now, let's see what happens when we FFT this data record.  That's shown below.

  • Generally, this can only be described as a mess.  There are no clear-cut lines in this FFT spectrum.  However, note the following table.
     

    Index

    Harmonic of the fundamental frequency of the data record

     The actual frequency

     SigFFT(1)

     0

     0 Hz

     SigFFT(2)

    1

    500 Hz

     SigFFT(3)

    2

     1000 Hz

    (1 KHz)

     SigFFT(4)

    3

     1500 Hz

    SigFFT(5)

    4

    2000 Hz

    SigFFT(6)

    5

    2500 Hz

    SigFFT(7)

    6

    3000 Hz

            Now, we can get at the frequencies in the FFT plot.  Notice the following.

    • The fundamental frequency of the signal embedded in the data record is 1250 Hz.  That is not a frequency found in the table.  Rather, the harmonics of the fundamental frequency of the data record are 1000 Hz and 1500 Hz, and they appear at indices of 2 and 3.

    • The largest spikes appear at indices of 2 and 3.

            All of that is well and good, but the third harmonic of the embedded signal is at 3750 Hz and that would appear between indices 8 and 9.



  • Discussion Center

    Discuss/
    Query

    Papers/
    Syllabus

    Feedback/
    Suggestion

    Yahoo
    Groups

    Sirfdosti
    Groups

    Contact
    Us

    MEMBERS LOGIN
      
    Email ID:
    Password:

      Forgot Password?
     New User? Register!

    INTERVIEW EBOOK
    Get 9,000+ Interview Questions & Answers in an eBook. Interview Question & Answer Guide
    • 9,000+ Interview Questions
    • All Questions Answered
    • 5 FREE Bonuses
    • Free Upgrades
    GATE RESOURCES
     
  • Gate Books
  • Training Institutes
  • Gate FAQs
  • GATE BOOKS
     
  • Mechanical Engineeering Books
  • Robotics Automations Engineering Books
  • Civil Engineering Books
  • Chemical Engineering Books
  • Environmental Engineering Books
  • Electrical Engineering Books
  • Electronics Engineering Books
  • Information Technology Books
  • Software Engineering Books
  • GATE Preparation Books
  • Exciting Offers



    GATE Exam, Gate 2009, Gate Papers, Gate Preparation & Related Pages


    GATE Overview | GATE Eligibility | Structure Of GATE | GATE Training Institutes | Colleges Providing M.Tech/M.E. | GATE Score | GATE Results | PG with Scholarships | Article On GATE | GATE Forum | GATE 2009 Exclusive | GATE 2009 Syllabus | GATE Organizing Institute | Important Dates for GATE Exam | How to Apply for GATE | Discipline / Branch Codes | GATE Syllabus for Aerospace Engineering | GATE Syllabus for Agricultural Engineering | GATE Syllabus for Architecture and Planning | GATE Syllabus for Chemical Engineering | GATE Syllabus for Chemistry | GATE Syllabus for Civil Engineering | GATE Syllabus for Computer Science / IT | GATE Syllabus for Electronics and Communication Engineering | GATE Syllabus for Engineering Sciences | GATE Syllabus for Geology and Geophysics | GATE Syllabus for Instrumentation Engineering | GATE Syllabus for Life Sciences | GATE Syllabus for Mathematics | GATE Syllabus for Mechanical Engineering | GATE Syllabus for Metallurgical Engineering | GATE Syllabus for Mining Engineering | GATE Syllabus for Physics | GATE Syllabus for Production and Industrial Engineering | GATE Syllabus for Pharmaceutical Sciences | GATE Syllabus for Textile Engineering and Fibre Science | GATE Preparation | GATE Pattern | GATE Tips & Tricks | GATE Compare Evaluation | GATE Sample Papers | GATE Downloads | Experts View on GATE | CEED 2009 | CEED 2009 Exam | Eligibility for CEED Exam | Application forms of CEED Exam | Important Dates of CEED Exam | Contact Address for CEED Exam | CEED Examination Centres | CEED Sample Papers | Discuss GATE | GATE Forum of OneStopGATE.com | GATE Exam Cities | Contact Details for GATE | Bank Details for GATE | GATE Miscellaneous Info | GATE FAQs | Advertisement on GATE | Contact Us on OneStopGATE |
    Copyright © 2024. One Stop Gate.com. All rights reserved Testimonials |Link To Us |Sitemap |Privacy Policy | Terms and Conditions|About Us
    Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | India Job Forum | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Free Classifieds | Jobs Assist | Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Web Hosting | Quick Site Kit | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Software Testing Interview Questions | Free Online Exams | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World
    C Interview Questions | C++ Interview Questions | Send Free SMS | Placement Papers | SMS Jokes | Cool Forwards | Romantic Shayari