Notch-Peak Filter
Design of a second-order rectifier and narrowband BIR filter with tunable parameters.
Description
Unit Notch-Peak Filter filters each channel of the input signal in time using the specified centre frequency and 3 dB bandwidth. This block offers configurable filter project parameters that allow you to adjust the filter characteristics while running the simulation. The block simulates the filter according to the parameters set in the block settings window.
Ports
Input
x - input signal
vector
| matrix
Input data for the block given as a vector or matrix. Each column of the input signal is treated as a separate channel. If the input signal is two-dimensional, the first dimension is the channel length (or frame size) and the second dimension is the number of channels. If the input signal is one-dimensional, 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 - 3 dB bandwidth.
`positive scalar
3 dB bandwidth input port.
Dependencies
To use this port, set the Filter specification parameters to Bandwidth and centre frequency
and the Specify bandwidth from input port parameters to enabled
.
Fc - centre frequency
positive scalar
Centre frequency input port.
Dependencies
To use this port, set the Filter specification parameters to Bandwidth and centre frequency
or Quality factor and centre frequency
and the Specify centre frequency from input port parameters to enabled
.
BWCoeff - bandwidth factor
real scalar in the range [-1, 1]
Bandwidth coefficient input port. A coefficient defining the 3 dB bandwidth as a scalar in the range -1 to 1:
-
-1
corresponds to the maximum 3 dB bandwidth (one fourth of the sampling frequency of the input signal). -
-1
corresponds to the minimum bandwidth (0 Hz, i.e. frequency-independent filter).
Dependencies
To use this port, set the Filter specification parameters to Coefficients
and the Specify bandwidth coefficient from input port to enabled
.
FcCoeff is the centre frequency coefficient
real scalar in the range [-1, 1]
Port for entering the coefficient defining the filter centre frequency as a scalar in the range from -1 to 1:
-
-1
corresponds to the minimum centre frequency (0 Hz). -
-1
corresponds to the maximum centre frequency (half the sampling frequency of the input signal).
Dependencies
To use this port, set the Filter specification parameters to Coefficients
and the Specify centre frequency coefficient from input port to enabled
.
Q is the goodness of the bandpass or narrowband filter
5 (By default)
| positive scalar
.
Port for inputting the goodness of a bandpass or narrowband filter as a real positive scalar. The goodness is defined as the ratio of the centre frequency of a bandpass or narrowband filter to the 3 dB bandwidth. A higher value of goodness corresponds to a smaller suppression bandwidth and bandwidth.
Dependencies
To use this port, set the Filter specification parameters to Quality factor and centre frequency' and the Specify quality factor from input port parameters to `On
.
Output
notch - output signal after regegmentation
vector
| matrix
The output signal after passing the filter, returned as a vector or matrix.
Dependencies
To use this port, set the Filter output parameters to Notch and Peak
or Notch
.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
peak - output signal after a narrowband filter
vector
| matrix
The output signal after passing the narrowband filter, returned as a vector or matrix.
Dependencies
To use this port, set the Filter output parameters 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 filter project
Bandwidth and centre frequency (by default)
| Coefficients
| Quality factor and centre frequency
Specify the parameters or coefficients that the block uses to design the filter:
-
Bandwidth and centre frequency
- design the filter using the parameters 3 dB bandwidth (Hz) and Center frequency of notch or peak. -
Coefficient
- filter design using the parameters Bandwidth coefficient and Center frequency coefficient. -
Quality factor and centre frequency
- filter design with usage of Quality factor and Center frequency of notch or peak parameters.
Specify bandwidth from input port - option to specify 3 dB bandwidth through input port
off (By default)
| `on
If the checkbox is selected, the 3 dB bandwidth is set through the BW port. If unchecked, the 3 dB bandwidth is set in the 3 dB bandwidth (Hz) parameters.
Dependencies
To use this parameter, set the Filter specification parameters to Bandwidth and centre frequency
.
3 dB bandwidth (Hz) - 3 dB bandwidth
2205 (By default)
| positive scalar
Specify the 3 dB bandwidth of the filter as a positive scalar in Hz.
Dependencies
To use this port, set the Filter specification parameters to Bandwidth and centre frequency
and the Specify bandwidth from input port parameters to off
.
Specify centre frequency from input port - option to specify centre frequency from input port
off (by default)
| `on
If the checkbox is checked, the centre frequency is set through the Fc port. If unchecked, the centre frequency is set in the Center frequency of notch or peak parameters.
Dependencies
To use this parameter, set the Filter specification parameters to Bandwidth and centre frequency
or Quality factor and centre frequency
.
Notch/Peak centre frequency (Hz) - the centre frequency of the bandpass or narrowband filter
11025 (By default)
| Positive scalar
The value of the centre frequency of the bandpass or narrowband filter as a positive scalar in Hz.
Dependencies
To use this port, set the Filter specification parameters to Bandwidth and centre frequency
or Quality factor and centre frequency
and the Specify bandwidth from input port parameters to off
.
Specify bandwidth coefficient from input port - option to specify bandwidth coefficient from input port
disabled (by default)
| enabled
.
If the checkbox is selected, the bandwidth coefficient is set through the BWCoeff port. If unchecked, the bandwidth coefficient is set in the Bandwidth coefficient parameters.
Dependencies
To use this parameter, set the Filter specification parameters to Coefficients
.
Bandwidth coefficient is the bandwidth coefficient
0.72654 (by default)
| real scalar in the range [-1, 1]
.
Specify the coefficient that defines the 3 dB bandwidth as a scalar in the range -1 to 1:
-
-1
corresponds to the maximum 3 dB bandwidth (one fourth of the sampling frequency of the input signal). -
-1
corresponds to the minimum bandwidth (0 Hz, i.e. frequency-independent filter).
Dependencies
To use this parameter, set the Filter specification parameter to Coefficients
and the Specify bandwidth coefficient from input port parameter to off
.
Specify centre frequency coefficient from input port - option to specify centre frequency coefficient from input port
off (by default)
| `on
If the checkbox is checked, the centre frequency coefficient is set through the FcCoeff port. If unchecked, the centre frequency coefficient is set in the Center frequency coefficient parameters.
Dependencies
To use this parameter, set the Filter specification parameters to Coefficients
.
Center frequency coefficient - centre frequency coefficient
0 (by default)
| ` real scalar in the range [-1, 1]`.
Specify the coefficient defining the filter centre frequency as a scalar in the range from -1 to 1:
-
-1
corresponds to the minimum centre frequency (0 Hz). -
-1
corresponds to the maximum centre frequency (half of the sampling frequency of the input signal).
Dependencies
To use this parameter, set the Filter specification parameter to Coefficients
and the Specify centre frequency coefficient from input port parameter to off
.
Specify quality factor from input port - option to specify quality factor from input port
off (by default)
| `on
If the checkbox is checked, the goodness is set through the Q port. If unchecked, the quality factor is set in the Quality factor parameters.
Dependencies
To use this parameter, set the Filter specification parameters to Quality factor and centre frequency
.
The Quality factor is the quality factor of the bandpass or narrowband filter
5 (By default)
| positive scalar
.
Specify the goodness of a bandpass or narrowband filter as a real positive scalar. The goodness is defined as the ratio of the centre frequency of a bandpass or narrowband filter to the 3 dB bandwidth. A higher value of goodness corresponds to a smaller suppression bandwidth and bandwidth.
Dependencies
To use this parameter, set the Filter specification parameter to Quality factor and centre frequency
and the Specify quality factor from input port parameter to off
.
Filter output - selection of filter for data output
Notch and Peak (by default)
| Notch
| Peak
Selecting the output data:
-
Notch and Peak
- the block outputs the output signal after passing the bandpass and narrowband filter. -
Notch
- the block outputs the output signal after passing the bandpass filter. -
Peak
- the unit outputs the output signal after passing the narrowband filter.
Inherit sample rate from input - inherit sample rate from input signal
off (by default)
| on
If the checkbox is checked, the sampling rate is inherited from the input signal. If unchecked, the sampling rate is set in the Input sample rate (Hz) parameters.
Input sample rate (Hz) - sampling rate of the input signal
44100 (By default)
| positive scalar
.
Specify the sampling rate of the input signal as a positive scalar value.
Dependencies
To use this parameter, set the Inherit sample rate from input parameter to off
.
Algorithms
The equation for the narrowband filter design is as follows:
The equation for the injection filter project is as follows:
In these equations
,
,
,
where is the centre frequency in Hz, is the sampling frequency in Hz, is the 3dB bandwidth in Hz.
Note that these two filters are complementary to each other:
.
They can be rewritten as
,
,
where is a frequency-independent second-order filter:
,
,
.
The filter is implemented as follows:
In Fig:
,
.
Note that depends only on the centre frequency and depends only on the 3 dB bandwidth.
References
-
Orfanidis, Sophocles J. Introduction to Signal Processing. Upper Saddle River, NJ: Prentice-Hall, 1996.