Engee documentation

designNotchPeakIIR

Formation of a higher-order Butterworth notch filter or peak IIR filter.

Library

EngeeDSP

Syntax

Function call

  • B,A,SV = designNotchPeakIIR() — generates a peak IIR filter with the filter order 2, the central frequency 0.5 rad/s and Q-factor 2.5.

    B and A They contain the coefficients of the second-order sections for the numerator and denominator of the peak IIR filter, respectively. Arrays B and A have a size , where — the number of filter sections equal to half the filter order.

    Argument SystemObject the default value is false. To implement the filter, assign the filter coefficients to the object SOSFilter.

  • B,A,SV = designNotchPeakIIR(Name=Value) — sets parameters using one or more name-value arguments.

    For example, B, A, SV = designNotchPeakIIR(Response="notch", FilterOrder=10, CenterFrequency=0.55, Bandwidth=0.3) designs a notch BIH filter with filter order 10, the central frequency 0.55 rad/s and bandwidth 3 dB 0.3.

    If you specify only a partial list of filter parameters, the function designs the filter, setting the default values for the remaining parameters.

  • B,A,SV = designNotchPeakIIR(Name=Value) — also returns scale values if you specified the argument HasScaleValues. Argument SV It is a vector of units if for the argument HasScaleValues the value is set false, and a vector of scale values if — true.

  • filtObj = designNotchPeakIIR(Name=Value) — designs a notch or peak BIH filter and implements the object SOSFilter.

    This syntax is used if for the argument SystemObject the value is set true.

Arguments

Name-value input arguments

Specify optional argument pairs as Name=Value, where Name — the name of the argument, and Value — the appropriate value. Name-value arguments should be placed after other arguments, but the order of the pairs does not matter.

# Response — filter characteristic

+ "peak" (by default) | "notch"

Details

The filter characteristic, set as "peak" or "notch".

Data types

Char, String

# FilterOrder — the order of the notch or peak IIR filter

+ 2 (default) | an even non-negative integer

Details

Order a notch or peak IIR filter, specified as an even non-negative integer.

Data types

Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

# CenterFrequency — the center frequency of the notch or peak IIR filter

+ 0.5 (by default) | normalized scalar

Details

Central frequency notch or peak IIR filter in rad/s, set as a normalized scalar in the range:

  • [0, 1] when specifying the input argument Bandwidth;

  • (0, 1] when specifying the input argument QualityFactor.

Data types

Float32, Float64

# QualityFactor — the quality of the notch or peak IIR filter

+ 2.5 (by default) | positive scalar

Details

Q-factor (or Q-factor) a notch or peak IIR filter, set as a positive scalar. The Q-factor is defined as the central frequency divided by the bandwidth That is , . A higher Q-factor corresponds to a narrower notch or peak band.

Data types

Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

# Bandwidth — bandwidth 3 dB of the notch or peak IIR filter

+ scalar in the range [0, 1]

Details

Bandwidth 3 dB a notch or peak IIR filter, set as a normalized scalar in the range [0, 1].

Data types

Float32, Float64

# HasScaleValues — the flag for calculating scale values for each section

+ false (default) | true

Details

The flag for calculating scale values for each section, set as true or false. If you set the value for this parameter true the function returns scale values that can be applied before and after each section of the second-order filter.

Data types

Bool

# SystemObject — flag for creating a system object

+ false (by default) | true

Details

The flag for creating a system object, set as

  • false — the function returns matrices of coefficients of sections of the second order;

  • true — the function returns an object SOSFilter.

Data types

Bool

# Verbose — the flag for printing a function call in Engee

+ false (by default) | true

Details

The flag for printing a function call in Engee, set as

  • false — the function does not output a function call;

  • true — the function outputs the entire function call, including the default values for type arguments Name=Value which were not specified when calling the function.

    Use this value to view all the parameters used by the function to design and implement the filter.

Data types

Bool

Output arguments

# B — numerator coefficients of the notch or peak IIR filter

+ the N/2×3 array

Details

Numerator coefficients of a notch or peak IIR filter, returned as an array of size , where — the number of filter sections, and — filter order.

Data types

Float64

# A — coefficients of the denominator of the notch or peak IIR filter

+ the N/2×3 array

Details

Denominator coefficients of a notch or peak IIR filter returned as an array of size , where — the number of filter sections, and — filter order.

The highest coefficient of the denominator is always equal to 1.

Data types

Float64

# SV — scale values

+ column vector

Details

Scale values between sections returned as a column vector of length , where — the number of filter sections, and — filter order.

If for an argument HasScaleValues the value is set true Then SV it will be a column vector of units.

Data types

Float64

# filtObj — filter object

+ the SOSFilter object

Details

The filter object returned as an object SOSFilter. Function designNotchPeakIIR updates arguments HasScaleValues and SV in the object SOSFilter depending on what value is set for the argument when calling the function. HasScaleValuestrue or false .

Literature

  1. Orfanidis , SJ. High-Order Digital Parametric Equalizer Design. 2005, pp. 1026–1046.