Skip to content

Commit 4bac61c

Browse files
singalsulgirdwood
authored andcommitted
Audio: Crossover: Fix paths after scripts move
The paths to topology and sof-ctl blobs are updated. The paths to other setup scripts (common, eq) are set with a new helper function crossover_paths.m. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 80c621a commit 4bac61c

4 files changed

Lines changed: 32 additions & 13 deletions

File tree

src/audio/crossover/tune/crossover_coef_quant.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
bits_iir = 32; % Q2.30
44
qf_iir = 30;
55

6-
addpath ./../eq
7-
86
if length(lowpass) ~= length(highpass)
97
error("length of lowpass and highpass array do not match");
108
end
@@ -27,5 +25,4 @@
2725
crossover_quant.lp_coef = cell2mat(crossover_quant.lp_coef);
2826
crossover_quant.hp_coef = cell2mat(crossover_quant.hp_coef);
2927

30-
rmpath ./../eq
3128
end

src/audio/crossover/tune/crossover_gen_coefs.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
function crossover = crossover_gen_coefs(fs, fc_low, fc_mid, fc_high)
22

3-
addpath ./../eq/
43
switch nargin
54
case 2, crossover = crossover_generate_2way(fs, fc_low);
65
case 3, crossover = crossover_generate_3way(fs, fc_low, fc_mid);
76
case 4, crossover = crossover_generate_4way(fs, fc_low, fc_mid, fc_high);
87
otherwise, error("Invalid number of arguments");
98
end
10-
rmpath ./../eq
9+
1110
end
1211

1312
function crossover_2way = crossover_generate_2way(fs, fc)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function crossover_paths(enable)
2+
3+
% crossover_paths(enable)
4+
% enable - set to true to enable needed search path
5+
% set to false to disable the search paths
6+
%
7+
8+
% SPDX-License-Identifier: BSD-3-Clause
9+
%
10+
% Copyright (c) 2024, Intel Corporation. All rights reserved.
11+
12+
common = '../../../../tools/tune/common';
13+
eq = '../../../../tools/tune/eq';
14+
# After #9187 merge use this:
15+
# eq = '../../eq_iir/tune';
16+
if enable
17+
addpath(common);
18+
addpath(eq);
19+
else
20+
rmpath(common);
21+
rmpath(eq);
22+
end
23+
end

src/audio/crossover/tune/example_crossover.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
function example_crossover()
22

3-
addpath ./../common
4-
53
% Sampling Frequency and Frequency cut-offs for crossover
64
cr.fs = 48e3;
75
cr.fc_low = 200;
@@ -30,17 +28,18 @@ function example_crossover()
3028
cr.sinks = [0 1 2 3];
3129
export_crossover(cr);
3230

33-
rmpath ./../common
34-
3531
end
3632

3733
function export_crossover(cr)
3834

35+
crossover_paths(true);
36+
3937
endian = "little";
40-
tpath1 = '../../topology/topology1/m4/crossover';
41-
tpath2 = '../../topology/topology2/include/components/crossover';
42-
ctlpath3 = '../../ctl/ipc3/crossover';
43-
ctlpath4 = '../../ctl/ipc4/crossover';
38+
sof_tools = '../../../../tools';
39+
tpath1 = fullfile(sof_tools, 'topology/topology1/m4/crossover');
40+
tpath2 = fullfile(sof_tools, 'topology/topology2/include/components/crossover');
41+
ctlpath3 = fullfile(sof_tools, 'ctl/ipc3/crossover');
42+
ctlpath4 = fullfile(sof_tools, 'ctl/ipc4/crossover');
4443

4544
str_way = sprintf('%dway', cr.num_sinks);
4645
str_freq = get_str_freq(cr);
@@ -100,6 +99,7 @@ function export_crossover(cr)
10099
% Plot Magnitude and Phase Response of each sink
101100
crossover_plot_freq(crossover.lp, crossover.hp, cr.fs, cr.num_sinks);
102101

102+
crossover_paths(false);
103103
end
104104

105105
% Frequencies part for filename

0 commit comments

Comments
 (0)