Code covered by the BSD License
-
progressbar(varargin)
Displays a multi leveled progressbar. This makes it easy to nest
-
ACdsgn(Fs)
-
Test_Nth_oct_filters1(resampl...
% Test_Nth_oct_filters1: This program tests the Nth octave time filters for continuous and impulsive noise
-
[A2, A_str, real_digitsL, rea...
% sd_round: Rounds an array to a specified number of Significant Digits, significant figures, digits of precision
-
[B, A]=Nth_octdsgn(Fs, Fc, N,...
-
[B, A]=hand_arm_fil(Fs)
% hand_arm_fil: Calculates the hand arm vibrations filter coefficients
-
[Fsn, p, q, errors]=get_p_q2(...
-
[LeqA, LeqA8, LeqC, LeqC8, Le...
% Leq_all_calc: Calculates levels and peaks for A, C, and linear weighting
-
[SP, f, bin_size, num_average...
% pressure_spectra: Calculates an accurate estimate of the pressure spectra
-
[SP, f, num_averages_out]=spe...
% spectra_estimate: Is a rough estimate of the pressure spectra
-
[SP2, mean_array2, mean1, arr...
% sub_mean: Removes the running average from a time record given a sampling rate and high pass cutoff frequency.
-
[SP2, mean_array2]=sub_mean(S...
% sub_mean: Removes the running average from a time record given a sampling rate and high pass cutoff frequency.
-
[SP_rms_levels_a, SP_peak_lev...
% Test_third_oct_filters: Tests Nth octave filters with pure tones and tone bursts
-
[Wa, Wc]=AC_weight_NB(f, outp...
% AC_weight_NB: Calculates the A and C frequency weights at specified frequencies
-
[bin_size, num_averages_out, ...
% number_of_averages: Calculates the number of points not overlapped from the array size, bin size, and number of averages
-
[bz, az]=bessel_digital(Fs, F...
% bessel_digital: creates a digital low pass bessel filter of order n
-
[f, A_atten, A_atten2, C_atte...
% Test_ACweight: Tests the A and C weighting filters using pure tones and tone bursts
-
[f_sig, Wf ]=Test_hand_arm(Fs...
% Test_hand_arm: Tests the accuracy of the hand-arm vibrations filters
-
[fc_out, SP_levels, SP_peak_l...
% Nth_oct_time_filter: Calculates the Nth octave center frequencies, sound levels, peak levels, and time records
-
[fc_out, SP_levels, SP_peak_l...
% Nth_oct_time_filter2: Calculates the Nth octave center frequencies, sound levels, peak levels, and time records
-
[filename_base, ext]=file_ext...
% file_extension: separates a filename and path from the file extension
-
[ftwcf]=window_correction_fac...
% window_correction_factor: Computes the factor for calibrating a Fourier Transform given specific processing parameters
-
[m2]=geospace(a, b, n, flag)
% geospace: caculates a geometric sequence or psuedogeometric sequence from a to b with n elements
-
[ndraw, count, count2, error]...
% rand_int: Quckly generates n random integers from a to b integer
-
[prms]=rms_val(p, dim)
% rms_val: Calculates the rms value along a specific dimension
-
[res,raw]=fastmcd(data,option...
version 22/12/2000, revised 19/01/2001,
-
[varargout]=convert_double(va...
% This program converts the inputs into double precision arrays. Then
-
[w]=flat_top(N, type)
% Flat top windows are used for calibration, because the wide main lobe
-
[xw, xp, xb, SPLw1, SPLp1, SP...
% Test_third_oct_filters: Tests Nth octave filters with white, pink, and brown noise.
-
[y, t]=tone_burst(Fs, fc, td,...
% sinusoidal_w_wave: N wave with known peak level, frequency and duration
-
[y, x, a]=match_height_and_sl...
% match_height_and_slopes2: creates a quartic with specifed height and slope at the end points.
-
[y2, num_settle_pts, settling...
% filter_settling_data: Creates data to append to a time record for settling a filter
-
[y2]=remove_filter_settling_d...
% remove_filter_settling_data: removes data added to time records to settle the filter
-
[yAC, errors]=ACweight_time_f...
% ACweight_time_filter: Applies an A or C weighting time filter to a sound recording
-
[y]=moving(x,m,fun)
MOVING will compute moving averages of order n (best taken as odd)
-
[y_out, b, a]=bessel_antialia...
% bessel_antialias: applies an antialiasing digital Bessel filter
-
[y_out, t_out, b, a]=bessel_d...
% bessel_down_sample: applies an antialiasing digital Bessel filter
-
[y_out, x_out, y_in]=resample...
% resample_interp3: resamples using interp1 with additional options
-
[yh, B, A, errors]=hand_arm_t...
% hand_arm_time_fil: Calculates the hand arm vibrations filter coefficients and returns the filtered time record
-
fastlts(x,y,options)
version 22/12/2000, revised 19/01/2001, 30/01/2003
-
nth_freq_band(N, min_f, max_f...
% nth_freq_band: Calculates the 1/nth octave frequency bands center, lower, and upper bandedge limits
-
plot_test_Nth_oct_filters(SP_...
% plot_test_Nth_oct_filters: plots the third octave filter test data
-
rmean(y, db_or_lin)
% get_stats: Calculates descriptive statistics for the input variable y.
-
save_a_plot_reverb_time(a, fi...
% save_a_plot_reverb_time: Saves current figure to specified image type.
-
spatialPattern(DIM,BETA)
function x = spatialPattern(DIM, BETA),
-
View all files
from
Nth_Oct_Hand_Arm_&_AC_Filter_Tool_Box
by Edward Zechmann
Features Nth octave band, Hand Arm, and A and C weighting filters
|
| rmean(y, db_or_lin)
|
function [ rm ] = rmean(y, db_or_lin)
% % get_stats: Calculates descriptive statistics for the input variable y.
% %
% % Sytnax:
% %
% % [stats, stats_descriptions]=get_stats(y, db_or_lin);
% %
% % **********************************************************************
% %
% % Description
% %
% % Calculates descriptive statistics for the input variable y.
% %
% %
% % **********************************************************************
% %
% % Input Variables
% %
% % y
% %
% % db_or_lin
% %
% %
% %
% % **********************************************************************
% %
% % Output Variables
% %
% % rm
% %
% % **********************************************************************
% %
% %
% % List of Dependent Subprograms for
% % get_stats
% %
% % FEX ID# is the File ID on the Matlab Central File Exchange
% %
% %
% % Program Name Author FEX ID#
% % 1) fastlts Peter J. Rousseeuw NA
% % 2) fastmcd Peter J. Rousseeuw NA
% % 3) genHyper Ben Barrowes 6218
% % 4) t_alpha Edward L. Zechmann
% % 5) t_confidence_interval Edward L. Zechmann
% % 6) t_icpbf Edward L. Zechmann
% %
% %
% % **********************************************************************
% %
% % get_stats is written by Edward L. Zechmann
% %
% % date 4 January 2011 Added comments.
% %
% %
% %
% % **********************************************************************
% %
% % See also: allstats by Duane Hanselman
% %
if nargin < 1 || isempty(y) || ~isnumeric(y)
y=[];
end
if nargin < 2 || isempty(db_or_lin) || ~isnumeric(db_or_lin)
db_or_lin=0;
end
rm=[];
am=[];
% get rid of the NaN elements
buf2=find(~isnan(y));
y=y(buf2); %#ok<FNDSB>
y=y(:);
nmax=200;
num_pts=length(y);
if ~isempty(y);
% Calculate the arithmetic mean
if isequal(db_or_lin, 1)
[mn_rt1]=mean(10.^(y./20));
am=20.*log10(mn_rt1);
else
am=mean(y);
end
% Calculate the robust estimate of the mean.
%
% Statistical language for this type of mean is
% "calculates the Least Median of Squares (LMS)
% location parameter of the columns of a matrix
% X. If X is a vector, it returns the LTS
% location parameter of its components. If X
% is a scalar, it returns X."
if num_pts >= 4
if num_pts > nmax
num_bins=max([min([floor(num_pts/nmax), 50]), 1]);
pts_per_bin=floor(num_pts/num_bins);
rma=zeros(num_bins, 1);
for e1=1:num_bins;
[ndraw]=rand_int(1+(e1-1)*pts_per_bin, e1*pts_per_bin, nmax, 1, 1);
if isequal(db_or_lin, 1)
[res] = fastlts(10.^(y(ndraw)./20));
rm1=20.*log10(res.coefficients);
else
[res] = fastlts(y(ndraw));
rm1=res.coefficients;
end
rma(e1)=rm1;
end
else
num_bins=1;
if isequal(db_or_lin, 1)
[res] = fastlts(10.^(y./20));
rm1=20.*log10(res.coefficients);
else
[res] = fastlts(y);
rm1=res.coefficients;
end
rma=rm1;
end
if num_bins >= 4
if isequal(db_or_lin, 1)
[res] = fastlts(10.^(rma./20));
rm=20.*log10(res.coefficients);
else
[res] = fastlts(rma);
rm=res.coefficients;
end
else
if isequal(db_or_lin, 1)
[mn_rt1]=mean(10.^(rma./20));
rm=20.*log10(mn_rt1);
else
rm=mean(rma);
end
end
else
rm=am;
end
else
rm=am;
end
|
|
Contact us at files@mathworks.com