www.pudn.com > Matlab-MPEG.rar > Sound_pressure_level.m, change:2007-08-21,size:1430b


function Lsb = Sound_pressure_level(X, scf) 
%   X = Sound_pressure_level(X, scf) 
% 
%   The sound pressure level Lsb is computed for every subband. 
%   计算每个子频带的声压级 
%   X is the normalised power density spectrum and scf are the 32 scale factors (one per band). 
%   输入X是正归化的功率密度谱 
%   输入scf是32个尺度因子(每个频带一个) 
% 
%   See also  Scale_factors 
%  
%   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; 
 
% 检查输入参数 
if (length(X) ~= FFT_SIZE) 
   error('Unexpected power density spectrum size.'); 
end 
 
if (length(scf) ~= N_SUBBAND) 
   error('Unexpected number of scalefactors'); 
end 
 
% Pick the 32 sound pressure level of the spectral line with maximum amplitude 
% in the frequency range corresponding to subband i and compute the 
% sound pressure level Lsb. 
Xmin = min(X); 
n = FFT_SIZE / 2 / N_SUBBAND; % Size of each subband 
 
for i = 1:N_SUBBAND, 
   local_max = Xmin; 
   for j = 1:n, 
      local_max = max(X((i - 1) * n + j), local_max); 
   end 
   Lsb(i) = max(local_max, 20 * log10(scf(i) * 32768) - 10); 
end