Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Matlab FFT Calibration Routines

Subject: Matlab FFT Calibration Routines

From: John Costello

Date: 05 May, 2008 20:29:03

Message: 1 of 3

Does Matlab have a canned set of data for FFT analysis?

What I am trying to find is a Matlab program that takes a
known set of data for a signal, computes the FFT and
extracts the spectral content and RMS equivalents of the
discrete sinusoids used to assimilate the signal...

For example, if we set up a known signal comprised of

f(t) = 5 + 2sin(2*pi*100*t) + 3sin(2*pi*1000*t)

what do we get from the Matlab FFT analysis?

thanks for any advice

john costello

Subject: Re: Matlab FFT Calibration Routines

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 05 May, 2008 20:43:02

Message: 2 of 3

In article <fvnqmf$5sv$1@fred.mathworks.com>,
John Costello <JohnCostello@ChampAero.com> wrote:
>Does Matlab have a canned set of data for FFT analysis?

>What I am trying to find is a Matlab program that takes a
>known set of data for a signal, computes the FFT and
>extracts the spectral content and RMS equivalents of the
>discrete sinusoids used to assimilate the signal...

>For example, if we set up a known signal comprised of

>f(t) = 5 + 2sin(2*pi*100*t) + 3sin(2*pi*1000*t)

>what do we get from the Matlab FFT analysis?

In my recent tests... what you get is something slightly different
than the theoretical results, due to round off errors in calculations
of the sines. The difference is particularily noticable if one computes
in degrees (e.g., 25-ish cycles in 720 degrees stepping by 0.1 degrees)
and almost seemed to suggest that the sind() routine was noticably
inaccurate (the errors I found were several orders of magnitude higher
than I could account for due to a simple constant multiplier.)
Stepping over the same range in radians was *much* cleaner but errors in
the 1e-15 range in the sine calculation result in detectable non-zero
phases.

If you back transform, ifft() from impulses with 0 phasing, then
the difference against the computed sines will be very small but
measurable.
--
  "The first draught serveth for health, the second for pleasure,
  the third for shame, the fourth for madness." -- Sir Walter Raleigh

Subject: Re: Matlab FFT Calibration Routines

From: Greg Heath

Date: 05 May, 2008 21:12:58

Message: 3 of 3

On May 5, 4:29=A0pm, "John Costello" <JohnCoste...@ChampAero.com> wrote:
> Does Matlab have a canned set of data for FFT analysis?
>
> What I am trying to find is a Matlab program that takes a
> known set of data for a signal, computes the FFT and
> extracts the spectral content and RMS equivalents of the
> discrete sinusoids used to assimilate the signal...
>
> For example, if we set up a known signal comprised of
>
> f(t) =3D 5 + 2sin(2*pi*100*t) + 3sin(2*pi*1000*t)
>
> what do we get from the Matlab FFT analysis?

What are you looking for?

Results depend on N and dt. The FFT imposed
period is

T =3D N*dt

Therefore, you should get the best results when
100*N*dt =3D integer.

t =3D dt*(0:N-1)';
df =3D 1/T
f =3D df*(0:N-1)';

Hope this helps.

Greg

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics