www.pudn.com > Matlab-MPEG.rar > Global_masking_threshold.asv, change:2007-08-21,size:1699b

```function  LTg = Global_masking_threshold(LTq, LTt, LTn)
%   LTg = Global_masking_threshold(LTq, LTt, LTn)
%
%   为表中定义的频率线子集，计算全局屏蔽阈。
%   它是在标准频谱的平方幅值尺下，
%   Compute the global masking threshold for the subset of frequency lines
%   defined in table [1, pp. 117]. It is the sum -- in the normal square
%   amplitude scale of the spectrum -- of the individual masking
%   thresholds and the absolute threshold [1, pp. 114].
%
%   See also Individual_masking_thresholds, Table_absolute_threshold
%
%   References:
%    [1] Information technology -- Coding of moving pictures and associated
%        audio for digital storage media at up to 1,5 Mbits/s -- Part3: audio.
%        British standard. BSI, London. October 1993. Implementation of ISO/IEC
%        11172-3:1993. BSI, London. First edition 1993-08-01.
%
%-------------------------------------------------------------------------------
Common;

N = length(LTq(:, 1));
if not(isempty(LTt))
m = length(LTt(:, 1));
end
n = length(LTn(:, 1));

% The global masking thresholds is computing for the subset of frequencies
% defined in [1, Table 1.b]. They are the summ of the powers of the
% corresponding to the individual masking thresholds (LTt, LTn) and the
% threshold in quiet (LTq).
for i = 1:N

% Threshold in quiet
temp = 10^(LTq(i) / 10);;

% Contribution of the tonal component
if not(isempty(LTt))
for j = 1:m,
temp = temp + 10^(LTt(j, i) / 10);
end
end

% Contribution of the noise components
for j = 1:n,
temp = temp + 10^(LTn(j, i) / 10);
end

LTg(i) = 10 * log10(temp);
end
```