4.66667

4.7 | 6 ratings Rate this file 46 Downloads (last 30 days) File Size: 1.71 KB File ID: #19998

Fast smoothing function

by Tom O'Haver

 

21 May 2008 (Updated 22 May 2008)

Fast smoothing function for time-series data

| Watch this File

File Information
Description

Fastsmooth is a function of the form s=fastsmooth(a,w, type, edge). The argument "a" is the input signal vector; "w" is the smooth width; "type" determines the smooth type: type=1 gives a rectangular (sliding-average or boxcar); type=2 gives a triangular (equivalent to 2 passes of a sliding average); type=3 gives a pseudo-Gaussian (equivalent to 3 passes of a sliding average). The argument "edge" controls how the "edges" of the signal (the first w/2 points and the last w/2 points) are handled. If edge=0, the edges are zero. (In this mode the elapsed time is independent of the smooth width. This gives the fastest execution time). If edge=1, the edges are smoothed with progressively smaller smooths the closer to the end. (In this mode the execution time increases with increasing smooth widths). The smoothed signal is returned as the vector "s". (You can leave off the last two input arguments: fastsmooth(Y,w,type) smooths with edge=0 and fastsmooth(Y,w) smooths with type=1 and edge=0). Compared to convolution-based smooth algorithms, fastsmooth typically gives much faster execution times, especially for large smooth widths; it can smooth a 1,000,000 point signal with a 1,000 point sliding average in less than 0.1 second.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
24 May 2008 Mingyang Yu

thank you for your help, it is great!

14 Jun 2008 Levent yüksek

Usefull and practical thanks.

30 Sep 2008 Ale Cappe

Very good job, useful and quite straightforward.

13 Oct 2010 Mark Shore

Just as advertised, fast, efficient and does what it says.

15 Sep 2011 Conny  
15 Sep 2011 gurpreet kaur

thanks a lot,its a grt help to me

04 Dec 2011 David Dijemeni

How can I apply fastsmooth to an image?

I am new to image processing in Matlab.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
filter design Tom O'Haver 22 Oct 2008 10:02:37
filter analysis Tom O'Haver 22 Oct 2008 10:02:37
smooth smoothing fast reduce noise Tom O'Haver 22 Oct 2008 10:02:37
smooth smoothing fast reduce noise Garry Fatakhov 02 Jun 2011 06:15:34

Contact us at files@mathworks.com