This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / signal / _filter_design / band_stop_obj

function

scipy.signal._filter_design:band_stop_obj

source: build-install/usr/lib/python3.14/site-packages/scipy/signal/_filter_design.py:4109

Signature

def band_stop_obj(wp, ind, passb, stopb, gpass, gstop, type)

Summary

Band Stop Objective Function for order minimization.

Extended Summary

Returns the non-integer order for an analog band stop filter.

Parameters

wp : scalar

Edge of passband passb.

ind : int, {0, 1}

Index specifying which passb edge to vary (0 or 1).

passb : ndarray

Two element sequence of fixed passband edges.

stopb : ndarray

Two element sequence of fixed stopband edges.

gpass : float

Amount of ripple in the passband in dB.

gstop : float

Amount of attenuation in stopband in dB.

type : {'butter', 'cheby', 'ellip'}

Type of filter.

Returns

n : scalar

Filter order (possibly non-integer).

Notes

Band-stop filters are used in applications where certain frequency components need to be blocked while others are allowed; for instance, removing noise at specific frequencies while allowing the desired signal to pass through. The order of a filter often determines its complexity and accuracy. Determining the right order can be a challenge. This function aims to provide an appropriate order for an analog band stop filter.

Examples

import numpy as np
from scipy.signal import band_stop_obj
wp = 2
ind = 1
passb = np.array([1, 3])
stopb = np.array([0.5, 4])
gstop = 30
gpass = 3
filter_type = 'butter'
band_stop_obj(wp, ind, passb, stopb, gpass, gstop, filter_type)
✓
np.float64(-2.758504160760643)

Aliases

  • scipy.signal.band_stop_obj