Просмотр исходного кода

return pv array from function to be able to easily analyze results with pv2params

Fernando Pablo Lopez-Lezcano 10 лет назад
Родитель
Сommit
ea10b60851
2 измененных файлов с 4 добавлено и 3 удалено
  1. 2 2
      CALIBRATION.md
  2. 2 1
      sphear_a2b_all.m

+ 2 - 2
CALIBRATION.md

@@ -22,7 +22,7 @@ The software calibration requires at least 16 impulse response measurements at r
 * calculate all A2B matrixes as a function of frequency (returned in A2BF).
 * calculate all A2B matrixes as a function of frequency (returned in A2BF).
 
 
 ```octave
 ```octave
-[F FE A2BF] = sphear_a2b_all((1:16), 300, 20000, 3, 48000, 256, 32, 0);
+[F FE A2BF PVF] = sphear_a2b_all((1:16), 300, 20000, 3, 48000, 256, 32, 0);
 ```
 ```
 
 
 The last parameter can be used to enable the b format component polar plots.
 The last parameter can be used to enable the b format component polar plots.
@@ -30,7 +30,7 @@ The last parameter can be used to enable the b format component polar plots.
 The first parameter specifies the measurements to process, (1:16) is a vector that contains all measurement numbers. To specify a subset of measurements just build an array with the desired numbers. 
 The first parameter specifies the measurements to process, (1:16) is a vector that contains all measurement numbers. To specify a subset of measurements just build an array with the desired numbers. 
 
 
 ```octave
 ```octave
-[F FE A2BF] = sphear_a2b_all([1, 5, 9, 13, 15], 300, 20000, 3, 48000, 256, 32, 0);
+[F FE A2BF PVF] = sphear_a2b_all([1, 5, 9, 13, 15], 300, 20000, 3, 48000, 256, 32, 0);
 ```
 ```
 
 
 Then design the FIR filter to correct each component of the A2B matrix as a function of frequency for low and mid frequencies (below 5000Hz in this example). Also restrict the maximum boost of the filter to 12 dB in this example. 
 Then design the FIR filter to correct each component of the A2B matrix as a function of frequency for low and mid frequencies (below 5000Hz in this example). Also restrict the maximum boost of the filter to 12 dB in this example. 

+ 2 - 1
sphear_a2b_all.m

@@ -31,7 +31,7 @@
 %%  You should have received a copy of the GNU General Public License
 %%  You should have received a copy of the GNU General Public License
 %%  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 %%  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-function [F FE A2BF] = sphear_a2b_all(m, fmin, fmax, Noct, Fs, Nsamp, Npre, plt)
+function [F FE A2BF PVF] = sphear_a2b_all(m, fmin, fmax, Noct, Fs, Nsamp, Npre, plt)
 
 
   A2BF = zeros(1, 4, 4);
   A2BF = zeros(1, 4, 4);
 
 
@@ -52,6 +52,7 @@ function [F FE A2BF] = sphear_a2b_all(m, fmin, fmax, Noct, Fs, Nsamp, Npre, plt)
     [A2B pv max_err] = A2B_matrix(R);
     [A2B pv max_err] = A2B_matrix(R);
     %% measurement, b format component, capsule
     %% measurement, b format component, capsule
     A2BF(i,:,:) = A2B;
     A2BF(i,:,:) = A2B;
+    PVF(i,:,:) = pv;
     BF = R * A2B;
     BF = R * A2B;
 
 
     printf("%d: %d -> [%d %d] cond=%f\n", i, fc(i), fe(i), fe(i + 1), cond(A2B));
     printf("%d: %d -> [%d %d] cond=%f\n", i, fc(i), fe(i), fe(i + 1), cond(A2B));