Skip to content

Commit

Permalink
add quantization test
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Sep 3, 2024
1 parent 3f4f9f0 commit 07fe30c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ModelingToolkitSampledData
using ModelingToolkit
using Documenter
using Plots
gr(fmt=:png)
Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/noise.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ A signal may be quantized to a fixed number of levels (e.g., 8-bit) using the [`
```@example QUANT
using ModelingToolkit, ModelingToolkitSampledData, OrdinaryDiffEq, Plots
using ModelingToolkit: t_nounits as t, D_nounits as D
using ModelingToolkitStandardLibrary.Blocks
z = ShiftIndex(Clock(0.1))
@mtkmodel QuantizationModel begin
@components begin
Expand Down
3 changes: 2 additions & 1 deletion test/test_discrete_blocks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ end
sol = solve(prob, Tsit5(), dtmax=0.01)
y = sol[m.quant.y]
uy = unique(y)
@test length(uy) == 4
@test length(uy) <= 4
@test 0 uy
end


0 comments on commit 07fe30c

Please sign in to comment.