Skip to content

Commit 3506772

Browse files
committed
Audio: TDFB: Tune: Rename top level scripts with sof_ prefix
The names of top level functions are prefixed with sof_ to ensure there is no conflict with other possible scripts. The paths to other directories are also fixed to work after the move. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 6eb6f3c commit 3506772

19 files changed

Lines changed: 104 additions & 108 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% bf = bf_array_circ(bf)
1+
% bf = sof_bf_array_circ(bf)
22
%
33
% Inputs
44
% bf.mic_n ... number of microphones
@@ -15,7 +15,7 @@
1515
%
1616
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1717

18-
function bf = bf_array_circ(bf)
18+
function bf = sof_bf_array_circ(bf)
1919

2020
bf.mic_angle = (0:bf.mic_n-1)*360/bf.mic_n; % Mic 1 at 0 deg
2121
idx = find(bf.mic_angle > 180); % wrap > 180 deg to -180 .. 0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% bf = bf_array_line(bf)
1+
% bf = sof_bf_array_line(bf)
22
%
33
% Inputs
44
% bf.mic_n ... number of microphones
@@ -15,7 +15,7 @@
1515
%
1616
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1717

18-
function bf = bf_array_line(bf)
18+
function bf = sof_bf_array_line(bf)
1919

2020
bf.mic_y = linspace(0, -(bf.mic_n-1) * bf.mic_d, bf.mic_n) ...
2121
+ (bf.mic_n-1) * bf.mic_d / 2;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% bf = bf_array_lshape(bf)
1+
% bf = sof_bf_array_lshape(bf)
22
%
33
% Inputs
44
% bf.mic_nxy ... vector of two with number of microphones along x and y
@@ -15,7 +15,7 @@
1515
%
1616
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1717

18-
function bf = bf_array_lshape(bf)
18+
function bf = sof_bf_array_lshape(bf)
1919

2020
bf.mic_x = [];
2121
bf.mic_y = [];
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% bf = bf_array_rect(bf)
1+
% bf = sof_bf_array_rect(bf)
22
%
33
% Inputs
44
% bf.mic_nxy ... vector of two with number of microphones along x and y
@@ -15,7 +15,7 @@
1515
%
1616
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1717

18-
function bf = bf_array_rect(bf)
18+
function bf = sof_bf_array_rect(bf)
1919

2020
bf.mic_x = [];
2121
bf.mic_y = [];
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% bf = bf_array_rot(bf)
1+
% bf = sof_bf_array_rot(bf)
22
%
33
% Inputs
44
% bf.array_angle ... three element vector for x, y, z rotation [degrees]
@@ -17,7 +17,7 @@
1717
%
1818
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1919

20-
function bf = bf_array_rot(bf)
20+
function bf = sof_bf_array_rot(bf)
2121

2222
% Equations reference
2323
% https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% bf = bf_array_xyz(bf)
1+
% bf = sof_bf_array_xyz(bf)
22
%
33
% Inputs
44
% bf.mic_x ... x coordinates [m]
@@ -17,7 +17,7 @@
1717
%
1818
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1919

20-
function bf = bf_array_xyz(bf)
20+
function bf = sof_bf_array_xyz(bf)
2121

2222
bf.mic_n = length(bf.mic_x);
2323
bf.mic_x = bf.mic_x - mean(bf.mic_x);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function blob8 = bf_blob_pack(bf, ipc_version)
1+
function blob8 = sof_bf_blob_pack(bf, ipc_version)
22

33
%% Pack TDFB struct to bytes
44
%

src/audio/tdfb/tune/sof_bf_defaults.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function bf = bf_defaults()
1+
function bf = sof_bf_defaults()
22

33
% Recording array general setup
44
bf.taylorwin_sidelobe = -30;
@@ -19,10 +19,11 @@
1919
bf.array_angle = [0 0 0]; % Array rotation angles for xyz
2020
bf.tplg_fn = '';
2121
bf.sofctl_fn = '';
22-
bf.tplg1_path = '../../topology/topology1/m4/tdfb';
23-
bf.tplg2_path = '../../topology/topology2/include/components/tdfb';
24-
bf.sofctl3_path = '../../ctl/ipc3/tdfb';
25-
bf.sofctl4_path = '../../ctl/ipc4/tdfb';
22+
sof_tools = '../../../../tools';
23+
bf.tplg1_path = fullfile(sof_tools, 'topology/topology1/m4/tdfb');
24+
bf.tplg2_path = fullfile(sof_tools, 'topology/topology2/include/components/tdfb');
25+
bf.sofctl3_path = fullfile(sof_tools, 'ctl/ipc3/tdfb');
26+
bf.sofctl4_path = fullfile(sof_tools, 'ctl/ipc4/tdfb');
2627
bf.data_path = './data';
2728
bf.endian = 'little';
2829
bf.fn = 1;
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% bf = bf_design(bf)
1+
% bf = sof_bf_design(bf)
22
%
33
% This script calculates beamformer filters with superdirective design
44
% criteria.
@@ -9,10 +9,9 @@
99
%
1010
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1111

12-
function bf = bf_design(bf)
12+
function bf = sof_bf_design(bf)
1313

14-
addpath('../../test/audio/test_utils');
15-
addpath('../../test/audio/std_utils');
14+
sof_bf_paths(1);
1615
mkdir_check('plots');
1716
mkdir_check('data');
1817

@@ -30,15 +29,15 @@
3029

3130
switch lower(bf.array)
3231
case 'line'
33-
bf = bf_array_line(bf);
32+
bf = sof_bf_array_line(bf);
3433
case 'circular'
35-
bf = bf_array_circ(bf);
34+
bf = sof_bf_array_circ(bf);
3635
case 'rectangle'
37-
bf = bf_array_rect(bf);
36+
bf = sof_bf_array_rect(bf);
3837
case 'lshape'
39-
bf = bf_array_lshape(bf);
38+
bf = sof_bf_array_lshape(bf);
4039
case 'xyz'
41-
bf = bf_array_xyz(bf);
40+
bf = sof_bf_array_xyz(bf);
4241
otherwise
4342
error('Invalid array type')
4443
end
@@ -51,7 +50,7 @@
5150
end
5251
end
5352

54-
bf = bf_array_rot(bf);
53+
bf = sof_bf_array_rot(bf);
5554

5655
% The design function handles only single (az, el) value, so need to
5756
% loop every steer angle.
@@ -88,11 +87,11 @@
8887
bf.mat_fn = all_mat_fn;
8988
bf.w = w_all;
9089

90+
sof_bf_paths(0);
9191
end
9292

9393
function bf = bf_one_design(bf)
9494

95-
9695
%% Defaults
9796
j = complex(0,-1);
9897
fs = bf.fs;

src/audio/tdfb/tune/sof_bf_export.m

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% bf_export(bf)
1+
% sof_bf_export(bf)
22
%
33
% Inputs
44
% bf.sofctl3_fn .... filename of ascii text format blob
@@ -13,12 +13,10 @@
1313
%
1414
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1515

16-
function bf = bf_export(bf)
16+
function bf = sof_bf_export(bf)
1717

18-
% Use functionc from common, test utils
19-
addpath('../common');
20-
addpath('../eq');
21-
addpath('../../test/audio/test_utils');
18+
% Use functions from common, test utils
19+
sof_bf_paths(1);
2220

2321
%% Add needed default controls if missing
2422

@@ -76,8 +74,8 @@
7674

7775
%% Build blob
7876
bf.all_filters = filters;
79-
bp3 = bf_blob_pack(bf, 3);
80-
bp4 = bf_blob_pack(bf, 4);
77+
bp3 = sof_bf_blob_pack(bf, 3);
78+
bp4 = sof_bf_blob_pack(bf, 4);
8179

8280
%% Export
8381
if isempty(bf.sofctl3_fn)
@@ -118,8 +116,6 @@
118116
tplg2_write(bf.tplg2_fn, bp4, "tdfb_config", export_note, bf.export_howto);
119117
end
120118

121-
rmpath('../../test/audio/test_utils');
122-
rmpath('../eq');
123-
rmpath('../common');
119+
sof_bf_paths(0);
124120

125121
end

0 commit comments

Comments
 (0)