From f14e69b9afa7e94012e8960c1559d600c6087d84 Mon Sep 17 00:00:00 2001 From: Shailesh Giri Date: Thu, 14 Nov 2024 11:09:40 -0500 Subject: [PATCH] fixing the bugs in gaussian filter --- src/gaussian_filter.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gaussian_filter.jl b/src/gaussian_filter.jl index a59ca72..2fdf161 100644 --- a/src/gaussian_filter.jl +++ b/src/gaussian_filter.jl @@ -27,10 +27,10 @@ $(TYPEDFIELDS) length::T = 100. "the amount of standard deviations to cover in the gaussian window" - alpha::U = 1. + alpha::U = 3. "scaling factor" - beta::U = 100. + beta::U = 1. end export Gauss1DFilter @@ -67,8 +67,10 @@ function gaussian_coeffs(N::Int, sigma::V, alpha::U, beta::U xᵢ::T = -sigma*alpha Δx::T = abs(2*xᵢ)/(N-1) for i=Base.OneTo(N) - y[i] = beta*exp(-0.5*(xᵢ/alpha)^2) / N + y[i] = beta*exp(-0.5*(xᵢ/sigma)^2) xᵢ += Δx end - y + sum_arr=sum(y) + y_norm= y./sum_arr + y_norm end \ No newline at end of file