Skip to content

Commit

Permalink
DomainError
Browse files Browse the repository at this point in the history
  • Loading branch information
wheeheee committed Mar 8, 2024
1 parent c422ab4 commit 9a2d9e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Filters/design.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ Elliptic(n::Integer, rp::Real, rs::Real) = Elliptic(Float64, n, rp, rs)
# returns frequency in half-cycles per sample ∈ (0, 1)
function normalize_freq(w::Real, fs::Real)
w <= 0 && throw(DomainError(w, "frequencies must be positive"))
f = 2*w/fs
f = 2 * w / fs
f >= 1 && throw(DomainError(f, "frequencies must be less than the Nyquist frequency $(fs/2)"))
f
end
function normalize_complex_freq(w::Real, fs::Real)
f = 2*w/fs
f >= 2 && error("frequencies must be less than the Nyquist frequency $(fs)")
f = 2 * w / fs
f >= 2 && throw(DomainError(f, "frequencies must be less than the Nyquist frequency $(fs)"))
f

Check warning on line 244 in src/Filters/design.jl

View check run for this annotation

Codecov / codecov/patch

src/Filters/design.jl#L244

Added line #L244 was not covered by tests
end

Expand Down

0 comments on commit 9a2d9e6

Please sign in to comment.