Skip to content

Commit

Permalink
add to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Sep 6, 2024
1 parent b5ef30c commit fdf8d57
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/src/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
## Noise and measurement corruption
- [`NormalNoise`](@ref)
- [`Quantization`](@ref)
- [`SampleWithADEffects`](@ref)
- [`UniformNoise`](@ref)

## Controllers
Expand All @@ -25,6 +26,7 @@

## Discrete-time filters
- [`ExponentialFilter`](@ref)
- [`MovingAverageFilter`](@ref)


## Docstrings
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/noise.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ plot(figy, figu, plot_title = "DC Motor with Discrete-time Speed Controller")
You may, e.g.
- Use [`ExponentialFilter`](@ref) to add exponential filtering using `y(k) ~ (1-a)y(k-1) + a*u(k)`, where `a` is the filter coefficient and `u` is the signal to be filtered.
No discrete-time filter components are available yet. You may, e.g.
- Add moving average filtering using [`MovingAverageFilter`](@ref) according to `y(k) ~ 1/N * sum(u(k-i) for i=0:N-1)`, where `N` is the number of samples to average over.
- Use [`MovingAverageFilter`](@ref) to add moving average filtering according to `y(k) ~ 1/N * sum(u(k-i) for i=0:N-1)`, where `N` is the number of samples to average over.

## Colored noise
Colored noise can be achieved by filtering white noise through a filter with the desired spectrum. No components are available for this yet.
Expand Down
2 changes: 1 addition & 1 deletion src/discrete_blocks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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) = \\dfrac{1}{N} \\sum_{i=0}^{N-1} u(z-i)``.
Please note: this implementation of a moving average filter is not optimized for very large number of filter taps `N`.
Expand Down

0 comments on commit fdf8d57

Please sign in to comment.