[R] Gaussian low-pass filter

Juan Carlos Borrás jcborras at gmail.com
Tue Jul 12 12:45:37 CEST 2011


gfcoeffs <- function(s, n) {
 t <- seq(-n,n,1) ## assuming 2*n+1 taps
 return ( exp(-(t^2/(2*s^2)))/sqrt(2*pi*s^2) )
}

2011/6/29 Martin Wilkes <m.wilkes at worc.ac.uk>:
> I want to filter my time series with a low-pass filter using a Gaussian smoothing function defined as:
>
> w(t) = (2πσ^2)^0.5  exp(-t^2/2σ^2)
>
> I was hoping to use an existing function to filter my data but help.search and Rsitesearch produced no useful results.
>
> Can anyone tell me if there is an existing function that will do the job?  If not, how would I begin to go about building such a filter?
>
> Thanks
>
> Martin Wilkes
> University of Worcester
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Cheers,
jcb!
_______________________
http://twitter.com/jcborras



More information about the R-help mailing list