From b5ef30c9cd788fe4f89577316adfedb559dee6b9 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Fri, 6 Sep 2024 06:54:12 +0200 Subject: [PATCH 1/2] fix math typo --- src/discrete_blocks.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/discrete_blocks.jl b/src/discrete_blocks.jl index d764eb8..10b76f3 100644 --- a/src/discrete_blocks.jl +++ b/src/discrete_blocks.jl @@ -1010,7 +1010,7 @@ end """ ExponentialFilter(a = 0.1) -Exponential filtering (first-order filter) with input-output relation ``y(z) ~ (1 - a) y(z-1) + a u(z-1)``, transfer function +Exponential filtering (first-order filter) with input-output relation ``y(z) = (1 - a) y(z-1) + a u(z-1)``, transfer function ```math Y(z) = \\dfrac{a}{1 - (1 - a) z^{-1}} U(z) ``` @@ -1042,7 +1042,7 @@ end """ MovingAverageFilter(N = 3) -Exponential filtering with input-output relation ``y(z) ~ sum(u(z-i) for i in 0:N-1) / N``. +Exponential filtering with input-output relation ``y(z) = sum(u(z-i) for i in 0:N-1) / N``. Please note: this implementation of a moving average filter is not optimized for very large number of filter taps `N`. From 4f2690432ab2021265c2f487d31547b99d2ef81f Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Fri, 6 Sep 2024 06:55:17 +0200 Subject: [PATCH 2/2] print some t values to see if it is constant by mistake --- src/discrete_blocks.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/discrete_blocks.jl b/src/discrete_blocks.jl index 10b76f3..cf4ae09 100644 --- a/src/discrete_blocks.jl +++ b/src/discrete_blocks.jl @@ -194,6 +194,9 @@ end Internal function. This function seeds the seed parameter as well as the current simulation time. """ function seeded_randn(seed, t) + if rand() < 0.1 + @show t + end rng = StableRNGs.StableRNG(hash(t, hash(seed))) randn(rng) end