Weighted frequency response filter
Audio System Toolbox / Filters
The Weighting Filter block performs frequency-weighted filtering independently across each input channel.
Port_1— Input signal
Matrix input –– Each column of the input is treated as an independent channel.
1-D vector input –– The input is treated as a single channel.
Port_1— Output signal
The Weighting Filter block outputs a signal with the same data type as the input signal. The size of the output depends on the size of the input:
Matrix input –– The block outputs a matrix the same size and data type as the input signal.
1-D vector input –– The block outputs an N-by-1 matrix (column vector), where N is the number of elements in the 1-D vector.
If a parameter is listed as tunable, then you can change its value during simulation.
Inherit sample rate from input— Specify source of input sample rate
When you select this parameter, the block inherits its sample rate from the input signal. When you clear this parameter, you specify the sample rate in Input sample rate (Hz).
Input sample rate (Hz)— Sample rate of input
To enable this parameter, clear the Inherit sample rate from input parameter.
Simulate using— Specify type of simulation to run
Code generation(default) |
Code generation –– Simulate model using
generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused
for subsequent simulations, as long as the model does not change.
This option requires additional startup time but the speed of the
subsequent simulations is faster than
Interpreted execution –– Simulate model
using the MATLAB® interpreter. This option shortens startup time but has
a slower simulation speed compared to
generation. In this mode, you can debug the source
code of the block.
Mask for attenuation limits— Creates a mask for filter response visualization
No mask(default) |
The mask attenuation limits are defined in the IEC 61672-1:2002 standard.
If the mask is green, the design is compliant.
If the mask is red, the design breaks compliance.
To enable this parameter, set Weighting method to
Visualize filter response— Open plot to visualize magnitude response and compliance mask
A 2048-point FFT is used to calculate the magnitude response.
The A-curve is a wide bandpass filter centered at 2.5 kHz, with approximately 20 dB attenuation at 100 Hz and 10 dB attenuation at 20 kHz. A-weighted SPL measurements of noise level are increasingly found in sales literature for domestic appliances. In most countries, the use of A-weighting is mandated for the protection of workers against noise-induced deafness. The ISO and ICOA standards mandate A-weighting for all civil aircraft noise measurements.
ANSI S1.42.2001 defines the weighting curve by specifying analog poles and zeros. Audio System Toolbox™ converts the specified poles and zeros to the digital domain using a bilinear transform:
The C-curve is "flat," but with limited bandwidth: It has –3 dB corners at 31.5 Hz and 8 kHz. C-curves are used in sound level meters for sounds that are louder than those intended for A-weighting filters.
ANSI S1.42.2001 defines the weighting curve by specifying analog poles and zeros. Audio System Toolbox converts the specified poles and zeros to the digital domain using a bilinear transform:
The K-weighting filter is used for loudness normalization in broadcast. It is composed of two stages of filtering: a first stage shelving filter and a second stage highpass filter.
The ITU-R BS.1770-4  standard defines this curve.
Assume a second-order filter.
The table shows the coefficients for the filters.
|First Stage Shelving Coefficients||Second Stage Highpass Coefficients|
The coefficients presented by ITU-R BS.1770-4 are defined for 48 kHz. These coefficients are recomputed for nonstandard sample rates using the algorithm described in .
 Acoustical Society of America. Design Response of Weighting Networks for Acoustical Measurements. ANSI S1.42-2001. New York, NY: American National Standards Institute, 2001.
 International Electrotechnical Commission. Electroacoustics Sound Level Meters Part 1: Specifications. First Edition. IEC 61672-1. 2002-2005.
 International Telecommunication Union. Algorithms to measure audio programme loudness and true-peak audio level. ITU-R BS.1770-4. 2015.
 Mansbridge, Stuart, Saoirse Finn, and Joshua D. Reiss. “Implementation and Evaluation of Autonomous Multi-track Fader Control.” Paper presented at the 132nd Audio Engineering Society Convention, Budapest, Hungary, 2012.