Path: news.mathworks.com!not-for-mail
From: "Erik Carlsten" <ecarlste@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Moving averages over a vector in MatLAB?
Date: Fri, 2 Nov 2007 19:38:26 +0000 (UTC)
Organization: Montana State University
Lines: 11
Message-ID: <fgfubi$hmg$1@fred.mathworks.com>
References: <fgcuei$32r$1@fred.mathworks.com> <1193935442.969959.94480@50g2000hsm.googlegroups.com>
Reply-To: "Erik Carlsten" <ecarlste@gmail.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 1194032306 18128 172.30.248.38 (2 Nov 2007 19:38:26 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 2 Nov 2007 19:38:26 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1169484
Xref: news.mathworks.com comp.soft-sys.matlab:435860



Thanks very much to everyone that responded. I ended up 
using filter() for my solution and it decreased the time 
in my running average by over a factor of 200. Needless to 
say this is exactly what I was looking for!

windowSize = avgWin*2+1;
avgFFTNoise = filter(ones(1,windowSize)/windowSize, 1, ...
        rangeMinusNoiseY(cutIndexRange+avgWin));

Thanks Randy for the suggestion to use filter() to take 
the running average it worked great!