Skip to content

Commit

Permalink
DomainError
Browse files Browse the repository at this point in the history
  • Loading branch information
wheeheee committed Feb 26, 2024
1 parent cc4e41e commit 5e30601
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
end

Expand Down

0 comments on commit 5e30601

Please sign in to comment.