No BSD License  

Highlights from
movave

1.33333

1.3 | 3 ratings Rate this file 4 Downloads (last 30 days) File Size: 1.12 KB File ID: #10115

movave

by Hazem Baqaen

 

22 Feb 2006 (Updated 24 Feb 2006)

Very efficient moving average filter

| Watch this File

File Information
Description

Very efficient moving average filter implemented using convolution.

Usage:

Smoothed Data = movave(Data Vector, Averaging Window Size in Samples)

See also: slidefilter.m by the same author

MATLAB release MATLAB 7.0.4 (R14SP2)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
23 Feb 2006 Duane Hanselman

This function is not much more than filter(ones(1,N)/N,1,data(:)). While this may be commonly done, this simple MATLAB statement is less confusing than the submission. Plus the simple MATLAB statement runs faster, which is important to this author. I do not see a need for this function. It could have marginal value if the help text conformed to MATLAB standards, which it clearly does not.

23 Feb 2006 Hazem Baqaen

Less confusing than Output = movave(input, window) ?? I submit that most people who need a moving average filter don't realize or don't know how to do it with convolution. This is a useful function. In this case, its simplicity is a strength, not a weakness.

23 Feb 2006 Jos van der Geest

movave has some arithmetic problems
A = [1 1 4 1 1 1 1 1] ;
a = movave(A,3)
% -> 0.33 0.67 2.0 2.0 2.0 1.0 1.0 1.0
% rounded, but if you take a close look:
fprintf('%.20f\n',a) % ->
0.33333333333333331000
0.66666666666666663000
2.00000000000000000000
1.99999999999999980000
1.99999999999999980000
1.00000000000000000000
1.00000000000000000000
1.00000000000000000000

where as it should be simply integers (besides the edges)
[. 1 2 2 2 1 1 1 .]

Take a look at <runmean> on the FEX

15 Feb 2009 Maciej Bartkowiak

Useless. Can be easily replaced by filter or smooth - the standard Matlab functions.

Please login to add a comment or rating.
Updates
24 Feb 2006

Credits

Tag Activity for this File
Tag Applied By Date/Time
dsp Hazem Baqaen 22 Oct 2008 08:16:35
moving average Hazem Baqaen 22 Oct 2008 08:16:35
smoothing Hazem Baqaen 22 Oct 2008 08:16:35
signal processing Hazem Baqaen 22 Oct 2008 08:16:35
convolution Hazem Baqaen 22 Oct 2008 08:16:35
filter Hazem Baqaen 22 Oct 2008 08:16:35
filter Paul Taylor 31 May 2012 09:03:26

Contact us at files@mathworks.com