Help › Functions
Filters and systems
butterLowpass butterHighpass butterBandpass butterBandstop cheby1Lowpass cheby1Highpass cheby1Bandpass cheby1Bandstop cheby2Lowpass cheby2Highpass cheby2Bandpass cheby2Bandstop ellipLowpass ellipHighpass ellipBandpass ellipBandstop besselLowpass besselHighpass besselBandpass besselBandstop analogPoles analogZeros digitalPoles digitalZeros
butterLowpass(n, fc) MathMath’s own
The (b; a) coefficients of an IIR Butterworth low-pass filter.
A low-pass: passes frequencies below fc, using a Butterworth design, whose passband is as flat as possible and whose gain falls steadily, with no ripple. n is the order, a whole number from 1 to 20. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. The gain is −3.01 dB (1/√2) at each edge. The order sets the steepness: the gain falls 20·n dB for each factor of 10 in frequency.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
H≔butterLowpass(2,0.1)
ampToDb(freqResponse(H,0.1))=−3.01
butterHighpass(n, fc) MathMath’s own
The (b; a) coefficients of an IIR Butterworth high-pass filter.
A high-pass: passes frequencies above fc, using a Butterworth design, whose passband is as flat as possible and whose gain falls steadily, with no ripple. n is the order, a whole number from 1 to 20. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. The gain is −3.01 dB (1/√2) at each edge. The order sets the steepness: the gain falls 20·n dB for each factor of 10 in frequency.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
H≔butterHighpass(2,0.1)
ampToDb(freqResponse(H,0.1))=−3.01
butterBandpass(n, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR Butterworth band-pass filter.
A band-pass: passes frequencies from f1 to f2, using a Butterworth design, whose passband is as flat as possible and whose gain falls steadily, with no ripple. n is the order, a whole number from 1 to 20. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. The gain is −3.01 dB (1/√2) at each edge. The order sets the steepness: the gain falls 20·n dB for each factor of 10 in frequency.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
H≔butterBandpass(2,0.1,0.2)
ampToDb(freqResponse(H,0.1))=−3.01
butterBandstop(n, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR Butterworth band-stop filter.
A band-stop: rejects frequencies from f1 to f2, using a Butterworth design, whose passband is as flat as possible and whose gain falls steadily, with no ripple. n is the order, a whole number from 1 to 20. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. The gain is −3.01 dB (1/√2) at each edge. The order sets the steepness: the gain falls 20·n dB for each factor of 10 in frequency.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
H≔butterBandstop(2,0.1,0.2)
ampToDb(freqResponse(H,0.1))=−3.01
cheby1Lowpass(n, rp, fc) MathMath’s own
The (b; a) coefficients of an IIR Chebyshev type I low-pass filter.
A low-pass: passes frequencies below fc, using a Chebyshev type I design, which ripples in the passband and falls steadily in the stopband. n is the order, a whole number from 1 to 20. rp is the passband ripple in dB. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rp is the ripple in dB allowed in the passband (above 0). The edges are the ends of the passband, where the gain has fallen by rp dB. It falls faster than a Butterworth of the same order, at the cost of the ripple.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- A ripple or attenuation of 0 or less.
H≔cheby1Lowpass(2,1,0.1)
ampToDb(freqResponse(H,0.1))=−1
cheby1Highpass(n, rp, fc) MathMath’s own
The (b; a) coefficients of an IIR Chebyshev type I high-pass filter.
A high-pass: passes frequencies above fc, using a Chebyshev type I design, which ripples in the passband and falls steadily in the stopband. n is the order, a whole number from 1 to 20. rp is the passband ripple in dB. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rp is the ripple in dB allowed in the passband (above 0). The edges are the ends of the passband, where the gain has fallen by rp dB. It falls faster than a Butterworth of the same order, at the cost of the ripple.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- A ripple or attenuation of 0 or less.
H≔cheby1Highpass(2,1,0.1)
ampToDb(freqResponse(H,0.1))=−1
cheby1Bandpass(n, rp, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR Chebyshev type I band-pass filter.
A band-pass: passes frequencies from f1 to f2, using a Chebyshev type I design, which ripples in the passband and falls steadily in the stopband. n is the order, a whole number from 1 to 20. rp is the passband ripple in dB. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rp is the ripple in dB allowed in the passband (above 0). The edges are the ends of the passband, where the gain has fallen by rp dB. It falls faster than a Butterworth of the same order, at the cost of the ripple.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
- A ripple or attenuation of 0 or less.
H≔cheby1Bandpass(2,1,0.1,0.2)
ampToDb(freqResponse(H,0.1))=−1
cheby1Bandstop(n, rp, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR Chebyshev type I band-stop filter.
A band-stop: rejects frequencies from f1 to f2, using a Chebyshev type I design, which ripples in the passband and falls steadily in the stopband. n is the order, a whole number from 1 to 20. rp is the passband ripple in dB. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rp is the ripple in dB allowed in the passband (above 0). The edges are the ends of the passband, where the gain has fallen by rp dB. It falls faster than a Butterworth of the same order, at the cost of the ripple.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
- A ripple or attenuation of 0 or less.
H≔cheby1Bandstop(2,1,0.1,0.2)
ampToDb(freqResponse(H,0.1))=−1
cheby2Lowpass(n, rs, fc) MathMath’s own
The (b; a) coefficients of an IIR Chebyshev type II low-pass filter.
A low-pass: passes frequencies below fc, using a Chebyshev type II design, which is flat in the passband and ripples in the stopband. n is the order, a whole number from 1 to 20. rs is the stopband attenuation in dB. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rs is the attenuation in dB of the stopband (above 0). The edges are where the stopband starts, where the gain has fallen to −rs dB. Beyond the edges the gain stays at or below −rs dB.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- A ripple or attenuation of 0 or less.
H≔cheby2Lowpass(2,40,0.1)
ampToDb(freqResponse(H,0.1))=−40
cheby2Highpass(n, rs, fc) MathMath’s own
The (b; a) coefficients of an IIR Chebyshev type II high-pass filter.
A high-pass: passes frequencies above fc, using a Chebyshev type II design, which is flat in the passband and ripples in the stopband. n is the order, a whole number from 1 to 20. rs is the stopband attenuation in dB. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rs is the attenuation in dB of the stopband (above 0). The edges are where the stopband starts, where the gain has fallen to −rs dB. Beyond the edges the gain stays at or below −rs dB.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- A ripple or attenuation of 0 or less.
H≔cheby2Highpass(2,40,0.1)
ampToDb(freqResponse(H,0.1))=−40
cheby2Bandpass(n, rs, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR Chebyshev type II band-pass filter.
A band-pass: passes frequencies from f1 to f2, using a Chebyshev type II design, which is flat in the passband and ripples in the stopband. n is the order, a whole number from 1 to 20. rs is the stopband attenuation in dB. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rs is the attenuation in dB of the stopband (above 0). The edges are where the stopband starts, where the gain has fallen to −rs dB. Beyond the edges the gain stays at or below −rs dB.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
- A ripple or attenuation of 0 or less.
H≔cheby2Bandpass(2,40,0.1,0.2)
ampToDb(freqResponse(H,0.1))=−40
cheby2Bandstop(n, rs, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR Chebyshev type II band-stop filter.
A band-stop: rejects frequencies from f1 to f2, using a Chebyshev type II design, which is flat in the passband and ripples in the stopband. n is the order, a whole number from 1 to 20. rs is the stopband attenuation in dB. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rs is the attenuation in dB of the stopband (above 0). The edges are where the stopband starts, where the gain has fallen to −rs dB. Beyond the edges the gain stays at or below −rs dB.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
- A ripple or attenuation of 0 or less.
H≔cheby2Bandstop(2,40,0.1,0.2)
ampToDb(freqResponse(H,0.1))=−40
ellipLowpass(n, rp, rs, fc) MathMath’s own
The (b; a) coefficients of an IIR elliptic (Cauer) low-pass filter.
A low-pass: passes frequencies below fc, using an elliptic design, which ripples in both bands and has the steepest fall for its order. n is the order, a whole number from 1 to 20. rp is the passband ripple in dB. rs is the stopband attenuation in dB. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rp is the passband ripple in dB and rs the stopband attenuation in dB, both above 0 and rs more than rp. The edges are the ends of the passband, where the gain has fallen by rp dB. For a given order, no other design here falls as fast between the bands.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- A ripple or attenuation of 0 or less.
- A stopband attenuation that is not more than the passband ripple.
H≔ellipLowpass(2,1,40,0.1)
ampToDb(freqResponse(H,0.1))=−1
ellipHighpass(n, rp, rs, fc) MathMath’s own
The (b; a) coefficients of an IIR elliptic (Cauer) high-pass filter.
A high-pass: passes frequencies above fc, using an elliptic design, which ripples in both bands and has the steepest fall for its order. n is the order, a whole number from 1 to 20. rp is the passband ripple in dB. rs is the stopband attenuation in dB. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rp is the passband ripple in dB and rs the stopband attenuation in dB, both above 0 and rs more than rp. The edges are the ends of the passband, where the gain has fallen by rp dB. For a given order, no other design here falls as fast between the bands.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- A ripple or attenuation of 0 or less.
- A stopband attenuation that is not more than the passband ripple.
H≔ellipHighpass(2,1,40,0.1)
ampToDb(freqResponse(H,0.1))=−1
ellipBandpass(n, rp, rs, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR elliptic (Cauer) band-pass filter.
A band-pass: passes frequencies from f1 to f2, using an elliptic design, which ripples in both bands and has the steepest fall for its order. n is the order, a whole number from 1 to 20. rp is the passband ripple in dB. rs is the stopband attenuation in dB. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rp is the passband ripple in dB and rs the stopband attenuation in dB, both above 0 and rs more than rp. The edges are the ends of the passband, where the gain has fallen by rp dB. For a given order, no other design here falls as fast between the bands.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
- A ripple or attenuation of 0 or less.
- A stopband attenuation that is not more than the passband ripple.
H≔ellipBandpass(2,1,40,0.1,0.2)
ampToDb(freqResponse(H,0.1))=−1
ellipBandstop(n, rp, rs, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR elliptic (Cauer) band-stop filter.
A band-stop: rejects frequencies from f1 to f2, using an elliptic design, which ripples in both bands and has the steepest fall for its order. n is the order, a whole number from 1 to 20. rp is the passband ripple in dB. rs is the stopband attenuation in dB. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. rp is the passband ripple in dB and rs the stopband attenuation in dB, both above 0 and rs more than rp. The edges are the ends of the passband, where the gain has fallen by rp dB. For a given order, no other design here falls as fast between the bands.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 20.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
- A ripple or attenuation of 0 or less.
- A stopband attenuation that is not more than the passband ripple.
H≔ellipBandstop(2,1,40,0.1,0.2)
ampToDb(freqResponse(H,0.1))=−1
besselLowpass(n, fc) MathMath’s own
The (b; a) coefficients of an IIR Bessel low-pass filter.
A low-pass: passes frequencies below fc, using a Bessel design, whose delay is as flat as possible, so a signal in the passband keeps its shape. n is the order, a whole number from 1 to 15. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. The edges are not −3 dB points: they are where the phase response is half-way, so the gain there is below −3 dB, and falls further as the order rises (about −4.8 dB at order 2). The orders go up to 15, not 20. The fall in gain is gentler than any of the other designs of the same order.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 15.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
H≔besselLowpass(2,0.1)
∣freqResponse(H,0)∣=1
besselHighpass(n, fc) MathMath’s own
The (b; a) coefficients of an IIR Bessel high-pass filter.
A high-pass: passes frequencies above fc, using a Bessel design, whose delay is as flat as possible, so a signal in the passband keeps its shape. n is the order, a whole number from 1 to 15. fc is the cutoff frequency.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. The edges are not −3 dB points: they are where the phase response is half-way, so the gain there is below −3 dB, and falls further as the order rises (about −4.8 dB at order 2). The orders go up to 15, not 20. The fall in gain is gentler than any of the other designs of the same order.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 15.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
H≔besselHighpass(2,0.1)
∣freqResponse(H,0.5)∣=1
besselBandpass(n, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR Bessel band-pass filter.
A band-pass: passes frequencies from f1 to f2, using a Bessel design, whose delay is as flat as possible, so a signal in the passband keeps its shape. n is the order, a whole number from 1 to 15. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. The edges are not −3 dB points: they are where the phase response is half-way, so the gain there is below −3 dB, and falls further as the order rises (about −4.8 dB at order 2). The orders go up to 15, not 20. The fall in gain is gentler than any of the other designs of the same order.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 15.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
H≔besselBandpass(2,0.1,0.2)
∣freqResponse(H,0.2)∣=0.577
besselBandstop(n, f1, f2) MathMath’s own
The (b; a) coefficients of an IIR Bessel band-stop filter.
A band-stop: rejects frequencies from f1 to f2, using a Bessel design, whose delay is as flat as possible, so a signal in the passband keeps its shape. n is the order, a whole number from 1 to 15. f1 and f2 are the band edges, with f2 above f1.
How the frequency is written decides the kind. A plain fraction of the sample rate, from 0 to 0.5, gives a digital filter (the bilinear transform, with its frequencies warped to match): typing fc/fs with both in Hz gives that fraction. A frequency in Hz, such as 1·kHz, gives an analog filter, with coefficients of s in radians per second. All the edges must be of one kind.
The result is a vector of two vectors, b over a, with the constant term first and a₀ = 1; feed it to applyFilter, freqResponse, stepResponse, digitalPoles or analogPoles. The edges are not −3 dB points: they are where the phase response is half-way, so the gain there is below −3 dB, and falls further as the order rises (about −4.8 dB at order 2). The orders go up to 15, not 20. The fall in gain is gentler than any of the other designs of the same order.
Units
A frequency is a plain fraction of the sample rate (digital), or in Hz (analog). Ripple and attenuation are plain numbers in decibels.
Refused
- An order that is not a whole number from 1 to 15.
- An edge that is a plain number outside 0 to 0.5, or one with units that is not a frequency, or edges of mixed kinds.
- An upper edge that is not above the lower one.
H≔besselBandstop(2,0.1,0.2)
∣freqResponse(H,0)∣=1
analogPoles(H) MathMath’s own
The poles of an analog system H(s): the roots of its denominator.
The system is a vector of coefficients b, or a pair (b; a), as butterLowpass and the other design functions give, with the constant term first. The coefficients are those of s, so (b; a) is H(s) = (b₀ + b₁s + …) / (a₀ + a₁s + …). The poles are sorted by real part and given as a column. A system is stable when every pole has a negative real part.
Units
The poles are in 1/s. A coefficient with units must carry s^k for the k-th one, as R·C and L·C do.
Refused
- A denominator that is a constant, which has no poles.
- Coefficients with mixed units, or complex ones.
b≔(1)
a≔⎝⎛651⎠⎞
analogPoles((ba))=(−3−2) s1
analogZeros(H) MathMath’s own
The zeros of an analog system H(s): the roots of its numerator.
The system is a vector of coefficients b, or a pair (b; a), as butterLowpass and the other design functions give, with the constant term first. The coefficients are those of s, so (b; a) is H(s) = (b₀ + b₁s + …) / (a₀ + a₁s + …). The zeros are sorted by real part and given as a column.
Units
The zeros are in 1/s. A coefficient with units must carry s^k for the k-th one, as R·C and L·C do.
Refused
- A numerator that is a constant, which has no zeros.
- Coefficients with mixed units, or complex ones.
b≔(21)
a≔⎝⎛651⎠⎞
analogZeros((ba))=(−2) s1
digitalPoles(H) MathMath’s own
The poles of a digital filter H(z): the roots in z of its denominator.
The system is a vector of coefficients b, or a pair (b; a), as butterLowpass and the other design functions give, with the constant term first. The coefficients are those of z⁻¹, so H(z) = (b₀ + b₁z⁻¹ + …) / (a₀ + a₁z⁻¹ + …). Both polynomials are brought to the same length first, so a numerator longer than the denominator adds poles at 0. The filter is stable when every pole is inside the unit circle, with magnitude below 1.
Units
The coefficients must be plain numbers, and so are the poles.
Refused
- A filter with no poles.
- Coefficients with units, as an analog system has.
digitalPoles⎝⎛⎝⎛(1)(1−0.5)⎠⎞⎠⎞=(0.5)
digitalZeros(H) MathMath’s own
The zeros of a digital filter H(z): the roots in z of its numerator.
The system is a vector of coefficients b, or a pair (b; a), as butterLowpass and the other design functions give, with the constant term first. The coefficients are those of z⁻¹, so H(z) = (b₀ + b₁z⁻¹ + …) / (a₀ + a₁z⁻¹ + …). Both polynomials are brought to the same length first, so a denominator longer than the numerator adds zeros at 0. A vector b alone is an FIR filter.
Units
The coefficients must be plain numbers, and so are the zeros.
Refused
- A filter with no zeros.
- Coefficients with units, as an analog system has.
digitalZeros((1−0.25))=(0.25)