1function example_dcblock();
2
3% Set the parameters here
4tplg_fn = "../../topology/topology1/m4/dcblock_coef_default.m4" % Control Bytes File
5% Use those files with sof-ctl to update the component's configuration
6blob_fn = "../../ctl/dcblock_coef.blob" % Blob binary file
7alsa_fn = "../../ctl/dcblock_coef.txt" % ALSA CSV format file
8
9endian = "little";
10R_coeffs = [0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98];
11
12blob8 = dcblock_build_blob(R_coeffs, endian);
13
14% Generate output files
15addpath ./../common
16
17tplg_write(tplg_fn, blob8, "DCBLOCK");
18blob_write(blob_fn, blob8);
19alsactl_write(alsa_fn, blob8);
20
21% Plot Filter's Transfer Function and Step Response
22% As an example, plot the graphs of the first coefficient
23fs = 48e3
24dcblock_plot_transferfn(R_coeffs(1), fs);
25figure
26dcblock_plot_stepfn(R_coeffs(1), fs);
27
28rmpath ./../common
29
30endfunction
31