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
|
| [ma,mi]=findextrema(a)
|
function [ma,mi]=findextrema(a)
% FINDEXTREMA - finds minima and maxima of data
%
% If 'y' is the data the function finds the maximas 'ma' and minimas 'mi'.
% The x-position of the extrema are interpolated.
%
% Usage: [ma,mi]=findextrema(y);
%
% Example:
% x=-10:0.1:10; y=sin(x);
% [ma,mi]=findextrema(y);
% plot(y); hold on; plot(ma,y(round(ma)),'ro'); plot(mi,y(round(mi)),'gs'); hold off;
%
a=gradient(a);
ad=diff(0.5*sign(a)); p=find(abs(ad)==1); %find position of signum change
if isempty(p) ma=[]; mi=[]; return; end
zp=p+a(p)./(a(p)-a(p+1)); %linear interpolate zero crossing
mip=find(ad(p)==1);
map=find(ad(p)==-1);
mi=zp(mip);
ma=zp(map);
|
|
Contact us at files@mathworks.com