Code covered by the BSD License
- Test_Nth_oct_filters1(res...% Test_Nth_oct_filters1: This program tests the Nth octave time filters for continuous and impulsive noise
- [A2, A_str, real_digitsL,...% sd_round: Rounds an array to a specified number of Significant Digits, significant figures, digits of precision
- [B, A]=Nth_octdsgn(Fs, Fc...
- [B, A]=hand_arm_fil(Fs)
% hand_arm_fil: Calculates the hand arm vibrations filter coefficients
- [Fsn, p, q, errors]=get_p...
- [LeqA, LeqA8, LeqC, LeqC8...% Leq_all_calc: Calculates levels and peaks for A, C, and linear weighting
- [SP, f, bin_size, num_ave...% pressure_spectra: Calculates an accurate estimate of the pressure spectra
- [SP, f, num_averages_out]...% spectra_estimate: Is a rough estimate of the pressure spectra
- [SP2, mean_array2, mean1,...% sub_mean: Removes the running average from a time record given a sampling rate and high pass cutoff frequency.
- [SP2, mean_array2]=sub_me...% 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...% Test_third_oct_filters: Tests Nth octave filters with pure tones and tone bursts
- [Wa, Wc]=AC_weight_NB(f, ...% AC_weight_NB: Calculates the A and C frequency weights at specified frequencies
- [bin_size, num_averages_o...% number_of_averages: Calculates the number of points not overlapped from the array size, bin size, and number of averages
- [bz, az]=bessel_digital(F...% bessel_digital: creates a digital low pass bessel filter of order n
- [f, A_atten, A_atten2, C_...% Test_ACweight: Tests the A and C weighting filters using pure tones and tone bursts
- [f_sig, Wf ]=Test_hand_ar...% Test_hand_arm: Tests the accuracy of the hand-arm vibrations filters
- [fc_out, SP_levels, SP_pe...% Nth_oct_time_filter: Calculates the Nth octave center frequencies, sound levels, peak levels, and time records
- [fc_out, SP_levels, SP_pe...% Nth_oct_time_filter2: Calculates the Nth octave center frequencies, sound levels, peak levels, and time records
- [filename_base, ext]=file...% file_extension: separates a filename and path from the file extension
- [ftwcf]=window_correction...% window_correction_factor: Computes the factor for calibrating a Fourier Transform given specific processing parameters
- [m2]=geospace(a, b, n, fl...% geospace: caculates a geometric sequence or psuedogeometric sequence from a to b with n elements
- [ndraw, count, count2, er...% 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,op...version 22/12/2000, revised 19/01/2001,
- [varargout]=convert_doubl...% 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...% Test_third_oct_filters: Tests Nth octave filters with white, pink, and brown noise.
- [y, t]=tone_burst(Fs, fc,...% sinusoidal_w_wave: N wave with known peak level, frequency and duration
- [y, x, a]=match_height_an...% match_height_and_slopes2: creates a quartic with specifed height and slope at the end points.
- [y2, num_settle_pts, sett...% filter_settling_data: Creates data to append to a time record for settling a filter
- [y2]=remove_filter_settli...% remove_filter_settling_data: removes data added to time records to settle the filter
- [yAC, errors]=ACweight_ti...% ACweight_time_filter: Applies an A or C weighting time filter to a sound recording
MOVING will compute moving averages of order n (best taken as odd)
- [y_out, b, a]=bessel_anti...% bessel_antialias: applies an antialiasing digital Bessel filter
- [y_out, t_out, b, a]=bess...% bessel_down_sample: applies an antialiasing digital Bessel filter
- [y_out, x_out, y_in]=resa...% resample_interp3: resamples using interp1 with additional options
- [yh, B, A, errors]=hand_a...% 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, m...% nth_freq_band: Calculates the 1/nth octave frequency bands center, lower, and upper bandedge limits
- plot_test_Nth_oct_filters...% plot_test_Nth_oct_filters: plots the third octave filter test data
Displays a multi leveled progressbar. This makes it easy to nest
- rmean(y, db_or_lin)
% get_stats: Calculates descriptive statistics for the input variable y.
- save_a_plot_reverb_time(a...% save_a_plot_reverb_time: Saves current figure to specified image type.
function x = spatialPattern(DIM, BETA),
View all files
22 Dec 2008
(Updated 15 Mar 2012)
Features Nth octave band, Hand Arm, and A and C weighting filters
function [w]=flat_top(N, type)
% % Flat top windows are used for calibration, because the wide main lobe
% % has very little spectra leakage.
% N=100; % Number of data points in the window
% type=3; % Selection number of the flat_top window from the list below
% % Table of Basic Properties of the Flat Top Windows
% % Peak Asymptotic Maximum
% % Sidelobe Decay Error
% % type Behavior dB dB/octave Percentage
% % 1 % Fast deacaying 3-term -31.85 18 0.094
% % 2 % Fast deacaying 4-term -44.84 30 0.047
% % 3 % Fast deacaying 5-term -57.20 42 0.028
% % 4 % minimum side-lobe 3-term -43.19 6 0.13
% % 5 % minimum side-lobe 4-term -66.75 6 0.078
% % 6 % minimum side-lobe 5-term -90.5 18 0.045
% % Reference "Flat Top Windows for PWMM waveform processing viw DFT"
% % Prof. Luigi Salvator and Dr. Amerigo Trotta IEE Proceedings Vol. 135,
% % Pt. B No 6, November 1998
% % This program was written by Edward L. Zechmann
% % 10 November 2007
% % modified 13 November 2007 (updated comments)
% % Feel free to modify this code.
% % [w]=flat_top(N, type);
% The default type is #3
% Fast decaying 5-term
if nargin < 2
% The default number of elements is 100;
if nargin < 1
coef=[0.266526 0.5 0.23474];
coef=[0.21706 0.42103 0.28294 0.07897];
coef=[0.1881 0.36923 0.28702 0.13077 0.02488];
coef=[0.28235 0.52105 0.19659];
coef=[0.241906 0.460841 0.255381 0.041872];
coef=[0.209671 0.407331 0.281225 0.092669 0.0091036];
coef=[0.266526 0.5 0.23474];
% Calculate the coherent gain, processing gain, and the incoherent gain.
% CG=sum(w)/N; % Coherent Gain
% PG=sum(w)^2/sum(w.^2)/N; % Processing Gain
% K=sqrt(PG); % Incoherent Gain