Path: news.mathworks.com!newsfeed-00.mathworks.com!panix!bloom-beacon.mit.edu!news2.wam.umd.edu!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matlab FFT Calibration Routines
Date: Mon, 5 May 2008 20:43:02 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 32
Message-ID: <fvnrgm$g10$1@canopus.cc.umanitoba.ca>
References: <fvnqmf$5sv$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1210020182 16416 192.70.172.160 (5 May 2008 20:43:02 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Mon, 5 May 2008 20:43:02 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:466776


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