Main Content

Weighting Filter

Weighted frequency response filter

  • Weighting Filter block

Libraries:
Audio Toolbox / Filters

Description

The Weighting Filter block performs frequency-weighted filtering independently across each input channel.

Ports

Input

expand all

  • 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.

Data Types: single | double

Output

expand all

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.

Data Types: single | double

Parameters

expand all

If a parameter is listed as tunable, then you can change its value during simulation.

See A-Weighting, C-Weighting, and K-Weighting for the definition of the weighting curves.

Tunable: No

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).

Tunable: No

Tunable: Yes

Dependencies

To enable this parameter, clear the Inherit sample rate from input parameter.

  • 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.

  • Interpreted execution –– Simulate model using the MATLAB® interpreter. This option shortens startup time but has a slower simulation speed compared to Code generation. In this mode, you can debug the source code of the block.

Tunable: No

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.

Tunable: Yes

Dependencies

To enable this parameter, set Weighting method to A-weighting or C-weighting.

A 2048-point FFT is used to calculate the magnitude response.

Tunable: Yes

Name of the variable in the base workspace to contain the filter when it is exported. The name must be a valid MATLAB variable name.

When you select this parameter, exporting the filter overwrites the variable specified by the Variable name parameter if it already exists in the base workspace. If you do not select this parameter and the specified variable already exists in the workspace, exporting the filter creates a new variable with an underscore and a number appended to the variable name. For example, if the variable name is var and it already exists, the exported variable will be named var_1.

Export the filter to the base workspace in the variable specified by the Variable name parameter.

Tips

You cannot export the filter if you have enabled the Inherit sample rate from input parameter and the model is not running.

Block Characteristics

Data Types

double | single

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

yes

Zero-Crossing Detection

no

More About

expand all

References

[1] Acoustical Society of America. Design Response of Weighting Networks for Acoustical Measurements. ANSI S1.42-2001. New York, NY: American National Standards Institute, 2001.

[2] International Electrotechnical Commission. Electroacoustics Sound Level Meters Part 1: Specifications. First Edition. IEC 61672-1. 2002-2005.

[3] International Telecommunication Union. Algorithms to measure audio programme loudness and true-peak audio level. ITU-R BS.1770-4. 2015.

[4] 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.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2016b