Path: news.mathworks.com!not-for-mail
From: "Travis Bland" <travisbland88@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: FFT -- sum( v(t))   /=  sum (v(t))
Date: Thu, 5 Nov 2009 03:05:19 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 44
Message-ID: <hctfdf$t47$1@fred.mathworks.com>
References: <hcnqim$l20$1@fred.mathworks.com> <hcsjpr$416$1@fred.mathworks.com>
Reply-To: "Travis Bland" <travisbland88@yahoo.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257390319 29831 172.30.248.37 (5 Nov 2009 03:05:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 5 Nov 2009 03:05:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2073693
Xref: news.mathworks.com comp.soft-sys.matlab:582599





Matt " <xys@whatever.com> wrote in message 
> No. To properly normalize the fft to obtain equivalent energies, you must divide by 
> sqrt(N), not by N. Try the following for any N:
> 
> 
> N=100;
> a=rand(1,N);
> 
> norm(a), 
> norm(fft(a)/sqrt(N)),



THANKYOU MATT!! This is what i was looking for. I wondered if it just wasn't normalized correctly. 
I had no clue what was going on in the other methods, i don't understand the need for all of the functions... i thought this was a simple thing... sum v(t) = sum v(f)


But interestingly enough, i wrote my own function to sum the two arrays, and when i used this code... i got the two values to be the same... and i normalized using N. There must be something going on internally somewhere that i don't understand.


load std000.txt
volt = std000(:,2);
v_s = 0;
for n = 1:40004
   v_s = (volt(n).* volt(n)) + v_s ;    %sum of v(t)
end

v_f = (fft(volt));
v_f_s = 0;

for b = 1:40004

   v_f_s = v_f_s + (abs((v_f(b) .* v_f(b))/ 40004));
end
v_s    %sum of v(t)
v_f_s   % sum of v(f)




but thanks to everyone