Code covered by the BSD License
-
[C, y, X, n, p, error1]=LMS_t...
-
[LMSout, blms, Rsq, error1]=L...
-
[LMSout, blms, Rsq, error1]=L...
-
[LeqA, LeqA8, LeqC, LeqC8, Le...
% This program calculates the A-weighted, C-weighted and Linear weighted
-
[SP, vibs, Fs_SP, Fs_vibs, de...
-
[SP2, mean_array2]=sub_mean(S...
% This program calculates the running average for sound and vibrations
-
[filename_base, ext]=file_ext...
% This program separates the filename from the extension. For example a
-
[gm]=geomean2(y)
% This program calculates the geometric mean, if all of the data are
-
[interval]=call_ci(x,confiden...
-
[ma,mi]=findextrema(a)
FINDEXTREMA - finds minima and maxima of data
-
[ndraw, count, count2, error]...
% This program quickly and randomly selects n integers from a to b.
-
[rt_array2, lv_array2, lv_arr...
-
[rta, Lya, rtpa]=reverb_time(...
-
[varargout]=convert_double(va...
-
[yA, B, A]=Aweight_time_filte...
% This program applies an A-weighting filter to
-
[yC, B, A]=Cweight_time_filte...
% This program applies an C-weighting filter to
-
adsgn(Fs);
ADSGN Design of a A-weighting filter.
-
cdsgn(Fs);
CDSGN Design of a A-weighting filter.
-
interval=ci(x,confidence,dim)...
interval=ci(x,confidence,dim);
-
loc=LMSloc(X)
-
oct3dsgn(Fc,Fs,N);
OCT3DSGN Design of a one-third-octave filter.
-
save_a_plot_reverb_time(a, fi...
-
View all files
from
Reverberation Time Calculator
by Edward Zechmann
Calculates Reverberation Time from multiple microphones using time records
|
| loc=LMSloc(X)
|
function loc=LMSloc(X)
%Syntax: loc=LMSloc(X)
%_____________________
%
% Calculates the Least Median of Squares (LMS) location parameter
% of the columns of a matrix X. If X is a vector, it returns the LMS
% location parameter of its components. If X is a scalar, it returns
% X.
%
% loc is the LMS estimated vector of locations.
% X is the matrix with the data sets.
%
% Reference:
% Rousseeuw PJ, Leroy AM (1987): Robust regression and outlier detection. Wiley.
%
%
% Alexandros Leontitsis
% Institute of Mathematics and Statistics
% University of Kent at Canterbury
% Canterbury
% Kent, CT2 7NF
% U.K.
%
% University e-mail: al10@ukc.ac.uk (until December 2002)
% Lifetime e-mail: leoaleq@yahoo.com
% Homepage: http://www.geocities.com/CapeCanaveral/Lab/1421
%
% Sep 3, 2001.
if nargin<1 || isempty(X)
error('Not enough input arguments.');
else
% X must be 2-dimensional
if ndims(X)>2
error('Invalid data set.');
end
% If X is a row vector make it a column vector
if size(X,1)==1
X=X';
end
% n is the length of the data set
n=size(X,1);
end
% For a single data point there is no need to proceed
if n==1
loc=X;
else
% Sort the data set to ascending order
X=sort(X);
% P. 169: the length of the "half" of the data points
h=floor(n/2)+1;
% P. 169: determine the shortest half and compute its midpoint
j=1:n-h+1;
range=X(j+h-1,:)-X(j,:);
% Calculate the location parameter for every column of X
for i=1:size(X,2);
f=find(range(:,i)==min(range(:,i)));
loc(i)=median((X(f+h-1,i)+X(f,i))/2);
end
end
|
|
Contact us at files@mathworks.com