ソースを参照

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

Fernando Pablo Lopez-Lezcano 10 年 前
親
コミット
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).
 
 ```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.
@@ -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. 
 
 ```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. 

+ 2 - 1
sphear_a2b_all.m

@@ -31,7 +31,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 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);
 
@@ -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);
     %% measurement, b format component, capsule
     A2BF(i,:,:) = A2B;
+    PVF(i,:,:) = pv;
     BF = R * A2B;
 
     printf("%d: %d -> [%d %d] cond=%f\n", i, fc(i), fe(i), fe(i + 1), cond(A2B));