Notch-Peak Filter
Design of a second-order rectifier and narrowband BIR filter with tunable parameters.
Description
The Notch-Peak Filter block filters each channel of the input signal in time using a specified centre frequency and 3 dB bandwidth. This block offers configurable filter design 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 Filter specification to Bandwidth and centre frequency
and Specify bandwidth from input port to enabled
.
Fc - centre frequency
positive scalar
Centre frequency input port.
Dependencies
To use this port, set Filter specification to Bandwidth and centre frequency
or Quality factor and centre frequency
and Specify centre frequency from input port 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 Filter specification to Coefficients
and 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 Filter specification to Coefficients
and 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 Filter specification to Quality factor and centre frequency' and Specify quality factor from input port 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 parameter to Notch and Peak
or Notch
.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
.
peak - output signal after narrow-band 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 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 filter project
Bandwidth and centre frequency (by default)
| Coefficients
| Quality factor and centre frequency
Specify the parameter 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 using the parameters Quality factor and Center frequency of notch or peak.
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) parameter.
Dependencies
To use this parameter, set the Filter specification 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 Filter specification to Bandwidth and centre frequency
and Specify bandwidth from input port to disabled
.
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 Center frequency of notch or peak.
Dependencies
To use this parameter, set the Filter specification 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 Filter specification to Bandwidth and centre frequency
or Quality factor and centre frequency
and Specify bandwidth from input port 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 parameter.
Dependencies
To use this parameter, set the Filter specification parameter 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 Filter specification to Coefficients
and Specify bandwidth coefficient from input port 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 parameter.
Dependencies
To use this parameter, set the Filter specification parameter 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 Filter specification to Coefficients
and Specify centre frequency coefficient from input port 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 parameter.
Dependencies
To use this parameter, set the Filter specification parameter 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 Filter specification to Quality factor and centre frequency
and Specify quality factor from input port 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. When unchecked, the sampling rate is set in Input sample rate (Hz).
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 Inherit sample rate from input 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.