Main Content

fdesign.audioweighting

(Removed) Audio weighting filter specification object

Compatibility

Note

The fdesign.audioweighting filter specification object has been removed from DSP System Toolbox™. Use the weightingFilter (Audio Toolbox) System object™ instead. For more information on how to update your existing code, see Version History.

Syntax

HAwf = fdesign.audioweighting
HAwf = fdesign.audioweighting(spec)
HAwf = fdesign.audioweighting(spec,specvalue1,specvalue2)
HAwf = fdesign.audioweighting(specvalue1,specvalue2)
HAwf = fdesign.audioweighting(...,Fs)

Description

Supported audio weighting filter types are: A weighting, C weighting, C-message, ITU-T 0.41, and ITU-R 468–4 weighting.

HAwf = fdesign.audioweighting constructs an audio weighting filter specification object HAwf with a weighting type of A and a filter class of 1. Use the design method and set the 'SystemObject' flag to true, to instantiate a System object based on the specifications in HAwf. Use designmethods to find valid filter design methods. Because the standards for audio weighting filters are in Hz, normalized frequency specifications are not supported for fdesign.audioweighting objects. The default sampling frequency for A weighting, C weighting, C-message, and ITU-T 0.41 filters is 48 kHz. The default sampling frequency for the ITU-R 468–4 filter is 80 kHz. If you invoke the normalizefreq method, a warning is issued when you instantiate the System object and the default sampling frequencies in Hz are used.

HAwf = fdesign.audioweighting(spec) returns an audio weighting filter specification object using default values for the specification in spec. The following are valid entries for spec. The entries are not case sensitive.

  • 'WT,Class' (default spec)

    The 'WT,Class' specification is valid for A weighting and C weighting filters of class 1 or 2.

    The weighting type is specified by the character vector: 'A' or 'C'. The class is the scalar 1 or 2.

    The default values for 'WT,Class' are 'A',1.

  • 'WT'

    The 'WT' specification is valid for C-message (default), ITU-T 0.41, and ITU-R 468–4 weighting filters.

    The weighting type is specified by the character vector: 'Cmessage', 'ITUT041', or 'ITUR4684'.

HAwf = fdesign.audioweighting(spec,specvalue1,specvalue2) constructs an audio weighting filter specification object HAwf and sets its specifications at construction time.

HAwf = fdesign.audioweighting(specvalue1,specvalue2) constructs an audio weighting filter specification object HAwf with the specification 'WT,Class' using the values you provide. The valid weighting types are 'A' or 'C'.

HAwf = fdesign.audioweighting(...,Fs) specifies the sampling frequency in Hz. The sampling frequency is a scalar trailing all other input arguments.

Name-Value Arguments

WT

Weighting type

The weighting type defines the frequency response of the filter. The valid weighting types are: A weighting, C weighting, C-message, ITU-T 0.41, and ITU-R 468–4 weighting. The weighting types are described in More About.

Class

Filter Class

Filter class is only applicable for A weighting and C weighting filters. The filter class describes the frequency-dependent tolerances specified in the relevant standards [1], [2]. There are two possible class values: 1 and 2. Class 1 weighting filters have stricter tolerances than class 2 filters. The filter class value does not affect the design. The class value is only used to provide a specification mask in FVTool for the analysis of the filter design.

Default: 1

Examples

collapse all

Compare class 1 A weighting and ITU-R 468-4 filters between 0.1 and 12 kHz. Sampling frequency is 44.1 kHz

HawfA = fdesign.audioweighting('WT,Class','A',1,44.1e3);
HawfITUR = fdesign.audioweighting('WT','ITUR4684',44.1e3);

Afilter = design(HawfA,'SystemObject',true);
ITURfilter = design(HawfITUR,'SystemObject',true);

hfvt = fvtool(Afilter,ITURfilter);
axis([0.1 12 -80 20]);
legend(hfvt,'A-weighting','ITU-R 468-4');
hCmessage = fdesign.audioweighting('WT','Cmessage',24e3);
hITUT = fdesign.audioweighting('WT','ITUT041',24e3);
dCmessage = design(hCmessage,'SystemObject',true);
dITUT = design(hITUT,'SystemObject',true);
hfvt = fvtool(dCmessage,dITUT);
legend(hfvt,'C-Message Weighting','ITU-T 0.41 Weighting');
axis([0.1 10 -50 5]);

Construct an ITU-R 468-4 filter using all available design methods.

HAwf = fdesign.audioweighting('WT','ITUR4684');
ValidDesigns = designmethods(HAwf);
% returns iirlpnorm,equiripple,freqsamp in cell array
D = design(HAwf,'all','SystemObject',true); % returns all designs
hfvt = fvtool(D{1},D{2},D{3});
legend(hfvt,'Least P-norm IIR','FIR Equiripple',...,
'FIR Frequency Sampling')

Design a class 2 A-weighted filter.

fs = 48e3;
audioWeightingFilterDesign = fdesign.audioweighting('A',2,fs);

Convert the design to a System object for use.

audioWeightingFilter = design(audioWeightingFilterDesign,...
'SystemObject',true);

Create a spectrumAnalyzer object to visualize original and filtered signals.

windowLength = 2048;
scope = spectrumAnalyzer( ...
    'SampleRate',fs, ...
    'PlotAsTwoSidedSpectrum',false, ...
    'SpectralAverages',50, ...
    'FrequencyScale','Log', ...
    'FrequencyResolutionMethod','WindowLength', ...
    'WindowLength',windowLength, ...
    'Title','A-Weighted Filtering', ...
    'ShowLegend',true, ...
    'ChannelNames',{'Original signal','Filtered signal'});

Apply the A-weighting filter to white noise.

tic
while toc < 10
    x = rand(windowLength,1) - 0.5;
    y = audioWeightingFilter(x);
    scope([x,y])
end

More About

collapse all

References

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

[2] Electroacoustics Sound Level Meters Part 1: Specifications, IEC 61672-1, First Edition 2002-05.

[3] Fletcher, H. and W.A. Munson. “Loudness, its definition, measurement and calculation.” Journal of the Acoustical Society of America, Vol. 5, 1933, pp. 82–108.

[4] Measurement of Audio-Frequency Noise Voltage Level in Sound Broadcasting, International Telecommunication Union Recommendation ITU-R BS.468-4, 1986.

[5] Psophometer for Use on Telephone-Type Circuits, ITU-T Recommendation 0.41.

[6] Transmission Parameters Affecting Voiceband Data Transmission-Measuring Techniques, Bell System Technical Reference, PUB 41009, 1972.

Version History

Introduced in R2011a

expand all