Notch-Peak Filter
The project of notch and narrow-band IIR filters of the second order with adjustable parameters.
blockType: NotchPeakFilter
Path in the library:
|
Description
Block Notch-Peak Filter filters each channel of the input signal by time, using a preset center frequency and a 3 dB bandwidth. This block offers configurable filter design parameters that allow you to customize the filter characteristics during simulation. The block simulates the filter according to the parameters set in the block settings window.
Ports
Entrance
x — input signal
vector | the matrix
The input data for the block, specified as a vector or matrix. Each column of the input signal is considered as a separate channel. If the input signal is two—dimensional, then the first dimension is the channel length (or frame size), and the second dimension is the number of channels. If there is a one-dimensional signal at the input, it is interpreted as a single channel.
Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64
Support for complex numbers: yes
BW — bandwidth 3 dB
positive scalar
The bandwidth input port is 3 dB.
Dependencies
To use this port, set the Filter specification parameter to Bandwidth and center frequency, and for the Specify bandwidth from input port parameter , the value enabled.
Fc — central pass frequency:q[<br>] positive scalar
The center frequency input port.
Dependencies
To use this port, set the Filter specification parameter to Bandwidth and center frequency or Quality factor and center frequency, and for the parameter Specify center frequency from input port the value enabled.
BWCoeff — pass throughput factor:q[<br>] a real scalar in the range [-1, 1]
The bandwidth factor input port. The coefficient determining the bandwidth of 3 dB, in the form of a scalar in the range from -1 to 1:
-
-1corresponds to a maximum bandwidth of 3 dB (one-fourth of the sampling frequency of the input signal). -
1corresponds to the minimum bandwidth (0 Hz, i.e. frequency-independent filter).
Dependencies
To use this port, set the Filter specification parameter to Coefficients, and for the Specify bandwidth coefficient from input port parameter , the value enabled.
FcCoeff is the central frequency coefficient of
a real scalar in the range [-1, 1]
The input port of the coefficient that determines the center frequency of the filter, in the form of a scalar in the range from -1 to 1:
-
-1corresponds to the minimum central frequency (0 Hz). -
1corresponds to the maximum center frequency (half of the sampling frequency of the input signal).
Dependencies
To use this port, set the Filter specification parameter to Coefficients, and for the parameter Specify center frequency coefficient from input port the value enabled.
Q — Q-factor of the notch or narrowband pass filter:q[<br>] 5 (default) | positive scalar
The Q-factor input port of a notch or narrowband filter in the form of a real positive scalar. The quality factor is defined as the ratio of the center frequency of a notch or narrowband filter and the bandwidth of 3 dB. A higher quality factor value corresponds to a smaller bandwidth of suppression and bandwidth.
Dependencies
To use this port, set the Filter specification parameter to Quality factor and center frequency, and for the parameter Specify quality factor from input port the value enabled.
Output
notch — output signal after cutting
vector | the matrix
The output signal after passing through the notch filter, returned as a vector or matrix.
Dependencies
To use this port, set the Filter output parameter to Notch and Peak or Notch.
Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64
peak — output signal after the narrowband pass filter:q[<br>] vector | the matrix
The output signal after passing the narrowband filter, returned as a vector or matrix.
Dependencies
To use this port, set the Filter output parameter to Notch and Peak or Peak.
Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64
Parameters
Filter specification — characteristics of the pass filter project:q[<br>] Bandwidth and center frequency (default) | Coefficients| Quality factor and center frequency
Specify the parameter or coefficients that the block uses to design the filter.:
-
Bandwidth and center frequency— filter design using 3 dB bandwidth (Hz) parameters and Center frequency of notch or peak. -
Coefficient— filter design using the Bandwidth coefficient and Center frequency coefficient parameters. -
Quality factor and center frequency— filter design using the Quality factor and Center frequency of notch or peak parameters.
Specify bandwidth from input port — option for setting the bandwidth of 3 dB via the input port
disabled (by default) | enabled
If this option is selected, the 3 dB bandwidth is set via the BW port. If the checkbox is unchecked, the 3 dB bandwidth is set in the 3 dB bandwidth (Hz) parameter.
Dependencies
To use this parameter, set the Filter specification parameter to Bandwidth and center frequency.
3 dB bandwidth (Hz) — 3 dB bandwidth
2205 (default) | positive scalar
Specify the bandwidth of the 3 dB filter as a positive scalar in Hz.
Dependencies
To use this port, set the Filter specification parameter to Bandwidth and center frequency, and for the Specify bandwidth from input port parameter , the value turned off.
Specify center frequency from input port — option for setting the center frequency via the input port
disabled (by default) | enabled
If the flag is checked, the center frequency is set via the Fc port. If the checkbox is unchecked, the center frequency is set in the Center frequency of notch or peak parameter.
Dependencies
To use this parameter, set the Filter specification parameter to Bandwidth and center frequency or Quality factor and center frequency.
Notch/Peak center frequency (Hz) — the center frequency of a notch or narrowband pass filter:q[<br>] 11025 (default) | positive scalar
The value of the center frequency of a notch or narrowband filter in the form of a positive scalar in Hz.
Dependencies
To use this port, set the Filter specification parameter to Bandwidth and center frequency or Quality factor and center frequency, and for the Specify bandwidth from input port parameter , the value turned off.
Specify bandwidth coefficient from input port — option for setting the bandwidth coefficient through the input port
disabled (by default) | enabled
If this option is selected, the bandwidth factor is set via the BWCoeff port. If the checkbox is unchecked, the bandwidth coefficient is set in the Bandwidth efficient parameter.
Dependencies
To use this parameter, set the Filter specification parameter to Coefficients.
Bandwidth coefficient — bandwidth factor
0.72654 (default) | a real scalar in the range [-1, 1]
Specify the coefficient that determines the bandwidth of 3 dB as a scalar in the range from -1 to 1:
-
-1corresponds to a maximum bandwidth of 3 dB (one-fourth of the sampling frequency of the input signal). -
1corresponds to the minimum bandwidth (0 Hz, i.e. frequency-independent filter).
Dependencies
To use this parameter, set the Filter specification parameter to Coefficients, and for the Specify bandwidth coefficient from input port parameter , the value turned off.
Specify center frequency coefficient from input port — option for setting the center frequency coefficient via the input port
disabled (by default) | enabled
If this option is selected, the center frequency coefficient is set via the FcCoeff port. If the checkbox is unchecked, the center frequency coefficient is set in the Center frequency coefficient parameter.
Dependencies
To use this parameter, set the Filter specification parameter to Coefficients.
Center frequency coefficient — the coefficient of the central frequency of
0 (default) | a real scalar in the range [-1, 1]
Specify the coefficient that determines the center frequency of the filter as a scalar in the range from -1 to 1:
-
-1corresponds to the minimum central frequency (0 Hz). -
1corresponds to the maximum center frequency (half of the sampling frequency of the input signal).
Dependencies
To use this parameter, set the Filter specification parameter to Coefficients, and for the parameter Specify center frequency coefficient from input port the value turned off.
Specify quality factor from input port — an option for setting the quality factor via the input port
disabled (by default) | enabled
If the flag is checked, the quality factor is set via the Q port. If the checkbox is unchecked, the quality factor is set in the Quality factor parameter.
Dependencies
To use this parameter, set the Filter specification parameter to Quality factor and center frequency.
Quality factor — the quality of the notch or narrowband pass filter:q[<br>] 5 (default) | positive scalar
Specify the quality factor of the notch or narrowband filter in the form of a real positive scalar. The quality factor is defined as the ratio of the center frequency of a notch or narrowband filter and the bandwidth of 3 dB. A higher quality factor value corresponds to a smaller bandwidth of suppression and bandwidth.
Dependencies
To use this parameter, set the Filter specification parameter to Quality factor and center frequency, and for the parameter Specify quality factor from input port the value turned off.
Filter output — selecting a filter for data output
Notch and Peak (default) | Notch | Peak
Selecting the output data:
-
Notch and Peak— the unit outputs the output signal after passing the notch and narrowband filters. -
Notch— the unit outputs the output signal after passing the notch filter. -
Peak— The unit outputs an output signal after passing a narrowband filter.
Inherit sample rate from input — inherit the sampling rate from the input signal
disabled (by default) | enabled
If this option is selected, the sampling rate is inherited from the input signal. If the checkbox is unchecked, the sampling rate is set in the Input sample rate (Hz) parameter.
Input sample rate (Hz) — sampling rate of the input signal
44100 (default) | positive scalar
Specify the sampling frequency of the input signal as a positive scalar value.
Dependencies
To use this parameter, set the Inherit sample rate from input parameter to turned off.
Algorithms
The equation for a narrowband filter design is as follows:
The equation for the injection filter design is as follows:
In these equations
,
,
,
where — the central frequency in Hz, — sampling rate in Hz, — bandwidth of 3 dB per Hz.
Please note that these two filters complement each other.:
.
They can be rewritten as
,
,
where frequency-independent second-order filter:
,
,
.
The filter is implemented as follows:
In the picture:
,
.
Please note that depends only on the central frequency, and — only from 3 dB bandwidth.