diff --git a/src/audio/eq_iir/tune/sof_eq_blob_plot.m b/src/audio/eq_iir/tune/sof_eq_blob_plot.m index cb096e863a6e..369c311fc96f 100644 --- a/src/audio/eq_iir/tune/sof_eq_blob_plot.m +++ b/src/audio/eq_iir/tune/sof_eq_blob_plot.m @@ -26,13 +26,13 @@ % SPDX-License-Identifier: BSD-3-Clause % -% Copyright (c) 2016-2022, Intel Corporation. All rights reserved. +% Copyright (c) 2016-2025, Intel Corporation. % % Author: Seppo Ingalsuo %% Handle input parameters if nargin < 2 - if findstr(blobfn, '_fir_') + if strfind(blobfn, '_fir') eqtype = 'FIR'; else eqtype = 'IIR'; diff --git a/src/audio/eq_iir/tune/sof_eq_blob_read.m b/src/audio/eq_iir/tune/sof_eq_blob_read.m index d95613507c91..424e8c74ad93 100644 --- a/src/audio/eq_iir/tune/sof_eq_blob_read.m +++ b/src/audio/eq_iir/tune/sof_eq_blob_read.m @@ -2,17 +2,18 @@ % SPDX-License-Identifier: BSD-3-Clause % -% Copyright (c) 2020, Intel Corporation. All rights reserved. +% Copyright (c) 2020-2025, Intel Corporation. % % Author: Seppo Ingalsuo %% Use file suffix as type if nargin < 2 - idx = findstr(blobfn, '.'); + idx = strfind(blobfn, '.'); fntype = blobfn(idx(end)+1:end); end %% Read the file +add_tlv_header = false; switch lower(fntype) case 'bin' fh = fopen(blobfn, 'rb'); @@ -23,13 +24,21 @@ tmp = fscanf(fh, '%u,', Inf); fclose(fh); case 'm4' + % The blobs in topology are without TLV header. For simplicity + % add to beginning two 32 bit words (zeros) to be compatible + % with other blob formats. tmp = get_parse_m4(blobfn); + add_tlv_header = true; otherwise error('Illegal file type, please give fntype argument'); end -blob = uint32(tmp); +if add_tlv_header + blob = uint32([0 0 tmp']'); +else + blob = uint32(tmp); +end end @@ -46,7 +55,7 @@ n = 1; ln = fgets(fh); while ln ~= -1 - idx = findstr(ln, '0x'); + idx = strfind(ln, '0x'); for i = 1:length(idx) bytes(n) = hex2dec(ln(idx(i)+2:idx(i)+3)); n = n + 1; diff --git a/src/audio/eq_iir/tune/sof_mls_freq_resp.m b/src/audio/eq_iir/tune/sof_mls_freq_resp.m index 8376325c69a1..a30864d93a3b 100644 --- a/src/audio/eq_iir/tune/sof_mls_freq_resp.m +++ b/src/audio/eq_iir/tune/sof_mls_freq_resp.m @@ -22,7 +22,7 @@ % SPDX-License-Identifier: BSD-3-Clause % -% Copyright (c) 2018-2020, Intel Corporation. All rights reserved. +% Copyright (c) 2018-2025, Intel Corporation. % % Author: Seppo Ingalsuo @@ -332,12 +332,12 @@ function remote_capture(fn, cfg, t) sens =[]; desc = ''; str = fgets(fh); - idx = findstr(str, '"'); + idx = strfind(str, '"'); while length(idx) > 0 line = str(idx(1)+1:idx(2)-1); desc = sprintf('%s%s ', desc, line); str = fgets(fh); - idx = findstr(str, '"'); + idx = strfind(str, '"'); end if length(strfind(str, 'Sens')) desc = str;