Jelajahi Sumber

sphear_a2b_all: add option to define where the transition frequency is located with respect to the maximum condition number of the A2B matrices

Fernando Pablo Lopez-Lezcano 9 tahun lalu
induk
melakukan
8a85875853
1 mengubah file dengan 6 tambahan dan 5 penghapusan
  1. 6 5
      calibration/src/sphear_a2b_all.m

+ 6 - 5
calibration/src/sphear_a2b_all.m

@@ -1,13 +1,15 @@
+%% -*- mode: octave -*-
 %%
 %% *SpHEAR Project
 %%
 %% sphear_a2b_all: calculate A2B matrixes for frequency ranges
 %%
 %% usage:
-%%   [F FE Fs A2BF PVF COND TF] = sphear_a2b_all(m, fmin, fmax, Noct, Nfft, plot_on)
+%%   [F FE Fs A2BF PVF COND TF] = sphear_a2b_all(m, fmin, fmax, cond_mult, Noct, Nfft, plot_on)
 %%
 %% m: vector of measurement numbers to take into account
 %% fmin, fmax: lower and upper frequency limits
+%% cond_mult: multiplier for transition frequency calculation (default should be 1/2)
 %% Noct: width of frequency ranges in fractions of an octave, this
 %%       will be changed slightly so that the frequency range is
 %%       covered by equally spaced frequency bands
@@ -33,7 +35,7 @@
 %%  You should have received a copy of the GNU General Public License
 %%  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-function [F FE Fs A2BF PVF COND TF] = sphear_a2b_all(m, fmin, fmax, Noct, Nfft, plot_on)
+function [F FE Fs A2BF PVF COND TF] = sphear_a2b_all(m, fmin, fmax, cond_mult, Noct, Nfft, plot_on)
 
   %% do not plot by default
   if (!exist("plot_on"))
@@ -71,10 +73,9 @@ function [F FE Fs A2BF PVF COND TF] = sphear_a2b_all(m, fmin, fmax, Noct, Nfft,
 
   %% calculate the transition frequency of the array
   [value, index] = max(COND);
-  TF = fc(index) / 2;
+  TF = fc(index) * cond_mult;
   printf("max condition %fHz, cf %f, fe %f, transition %f\n", value, fc(index), fe(index), fc(index)/2);
-  
-  
+
   F = fc;
   FE = fe;
   Fs = srate;