1
0
Эх сурвалжийг харах

sync example with fixes in filter shape extraction

Fernando Pablo Lopez-Lezcano 9 жил өмнө
parent
commit
18195487df

+ 15 - 14
calibration/src/sphear_design_example.m

@@ -99,16 +99,26 @@ sphear_bf_plot_frequency_response(BF, 300, 20000, -60, 0, 48000, 8192);
 %% the signal power to extract filter shapes from the B-format signals. 
 
 %% extract the shapes of wxyz filters
+%% get flat response in cardinal directions
 
-[W X Y Z] = sphear_bf_extract_filter_shapes(B, OCTA_CARDINALS);
+[W X Y Z U V] = sphear_bf_extract_filter_shapes(B, 0);
 
-[W X Y Z] = sphear_bf_extract_filter_shapes(B, TETRA_CARDINALS);
+%% get bright response in cardinal directions
 
-[W X Y Z] = sphear_bf_extract_filter_shapes(B, [1:16]);
+[W X Y Z U V] = sphear_bf_extract_filter_shapes(B, 1);
 
-[W X Y Z U V] = sphear_bf_extract_filter_shapes(B, [1:16]);
+%% average all measurements for all components
 
-[W X Y Z U V] = sphear_bf_extract_filter_shapes(B, 0);
+[W X Y Z U V] = sphear_bf_extract_filter_shapes(B, 2);
+
+%% look at the shapes of the filters
+%% for tetrahedral microphones Z is an average estimation so do not plot it
+
+sphear_bf_plot_filters(FC, W, X, Y);
+
+sphear_bf_plot_filters(FC, W, X, Y, Z);
+
+sphear_bf_plot_filters(FC, W, X, Y, Z, U, V);
 
 %% now design four FIR filters, one for each B-format component
 
@@ -126,15 +136,6 @@ sphear_bf_plot_frequency_response(BF, 300, 20000, -60, 0, 48000, 8192);
 
 [FIR TFIR] = sphear_design_fir_filters(FC, 512, 15, 48000, W, X, Y, Z, U, V, 8, -24);
 
-%% look at the shapes of the filters
-%% for tetrahedral microphones Z is an average estimation so do not plot it
-
-sphear_bf_plot_filters(FC, W, X, Y);
-
-sphear_bf_plot_filters(FC, W, X, Y, Z);
-
-sphear_bf_plot_filters(FC, W, X, Y, Z, U, V);
-
 %% re-calculate the full B-format signal with the filters
 
 [BF, BFF] = sphear_af_to_bf(AF, A2B, FIR, 8192);