Code covered by the BSD License
Highlights from
octave
-
adsgn(Fs);
ADSGN Design of a A-weighting filter.
-
aspec(B,A,Fs);
ASPEC Plots a filter characteristics vs. A-weighting specifications.
-
bankdisp(P,F,Pmin,Pmax);
BANKDISP Display filterbank power spectrum in 'bar' form.
-
cdsgn(Fs);
CDSGN Design of a A-weighting filter.
-
cspec(B,A,Fs);
CSPEC Plots a filter characteristics vs. C-weighting specifications.
-
filtbank(x,Fs,T,arg4);
FILTBANK One-third-octave band frequency analyser.
-
oct3bank(x);
OCT3BANK Simple one-third-octave filter bank.
-
oct3dsgn(Fc,Fs,N);
OCT3DSGN Design of a one-third-octave filter.
-
oct3spec(B,A,Fs,Fc,s,n);
OCT3SPEC Plots a one-third-octave filter characteristics.
-
octdsgn(Fc,Fs,N);
OCTDSGN Design of an octave filter.
-
octspec(B,A,Fs,Fc,s,n);
OCTSPEC Plots an octave filter characteristics.
-
p=leq(x,t,Pref)
LEQ Computes the sequence of short-time RMS powers (Leq) of a signal.
-
View all files
from
octave
by Christophe COUVREUR
Generates normalized A-weigthing, -weighting, octave and one-third-octave digital filters.
|
| p=leq(x,t,Pref) |
function p=leq(x,t,Pref)
% LEQ Computes the sequence of short-time RMS powers (Leq) of a signal.
% P = LEQ(X,T) is a length LENGTH(X)/T column vector whose
% elements are the RMS powers (Leq's) of length T frames of X.
% The powers are expressed in dB with 1 as reference level.
% LEQ(X,T,REF) uses REF as the reference level for the dB
% scale. If a RMS power is equal to zero, a NaN is returned
% for its dB value.
%
% Author: Christophe Couvreur, Faculte Polytechnique de Mons (Belgium)
% couvreur@thor.fpms.ac.be
% Last modification: Aug. 24, 1997, 4:00pm.
m = floor(length(x)/t);
p = zeros(m,1);
for i = 1:m
p(i) = sum(x((i-1)*t+1:i*t).^2)/t;
end
idx = (p>0);
if (nargin < 3)
Pref = 1;
end
if ~isempty(idx)
p(idx) = 10*log10(p(idx)/Pref);
p(~idx) = NaN*ones(sum(~idx),1);
else
p = NaN*ones(m,1);
end
|
|
Contact us at files@mathworks.com