Path: news.mathworks.com!not-for-mail
From: "Travis Bland" <travisbland88@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: FFT -- sum( v(t))   /=  sum (v(t))
Date: Mon, 2 Nov 2009 23:39:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 27
Message-ID: <hcnqim$l20$1@fred.mathworks.com>
Reply-To: "Travis Bland" <travisbland88@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257205142 21568 172.30.248.38 (2 Nov 2009 23:39:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 2 Nov 2009 23:39:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2073693
Xref: news.mathworks.com comp.soft-sys.matlab:581932


Hi,
 I'm taking a course using Matlab, and i'm also doing data analysis for a job. Since i started using Matlab, i thought it might be easier to use than my program written in C++, and i was hoping to check the numbers against eachother.
I have a file data.dat with two columns, time and voltage. The sum  v(t)^2  should equal the sum of v(f)^2, correct? I should have the same total power in the frequency domain as the time domain? 
Well i can't get this to prove true. Here's what i tried

volt_t = data(:,2)

sum ( v(f)^2 )  --------->
>> sum(   (fft(volt_t))  .* (fft(volt_t))   )
ans = 7.6598

sum(  ( v(f)/ N )^2) ,where N = length volt_t-------->
>> sum(  abs( (fft(volt_t) / N)  .* (fft(volt_t) / N) ))
ans = 8.6741e-08

sum ( (v(t))^2)----------->
>> sum(volt_t .* volt_t)
ans = 0.0035




I notice when i read in the file to volt_t, the precision isn't very high. My values are #*e-06 , and matlab gives   0.0001 or 0.0000. Could this be my issue; if so, how do i fix it? If not, any suggestions on what to do?


 Thanks,
 Travis