From 5e30601de35ee21ec8b7e43cd7d4e925a4d0ce1a Mon Sep 17 00:00:00 2001 From: wheeheee <104880306+wheeheee@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:47:31 +0800 Subject: [PATCH] `DomainError` --- src/Filters/design.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Filters/design.jl b/src/Filters/design.jl index 3472b1174..e13aff33b 100644 --- a/src/Filters/design.jl +++ b/src/Filters/design.jl @@ -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