From ff2a63e4f385695c905248907b1ae459f036d18e Mon Sep 17 00:00:00 2001 From: Lilian RM Date: Wed, 29 Jul 2020 08:48:45 +0100 Subject: [PATCH] =?UTF-8?q?Transf=C3=A9rer=20les=20fichiers=20vers=20'matl?= =?UTF-8?q?ab'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- matlab/write_polyfir_coeffs.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 matlab/write_polyfir_coeffs.m diff --git a/matlab/write_polyfir_coeffs.m b/matlab/write_polyfir_coeffs.m new file mode 100644 index 0000000..bf2544a --- /dev/null +++ b/matlab/write_polyfir_coeffs.m @@ -0,0 +1,13 @@ +function write_polyfir_coeffs(file, coeffs) + + +coeff_format = 'library ieee;\nUSE ieee.std_logic_1164.all;\nUSE work.POLY_FIR_PKG.all;\npackage coeff_fir is\n CONSTANT fir_coeffs_generated : vect_polyfir_coeffs_in := ('; +for i=1:(length(coeffs)-1) + coeff_format = strcat(coeff_format,'X"%02x", '); +end +coeff_format = strcat(coeff_format,'X"%02x");\nend package coeff_fir;'); +fcoeff = fopen(file,'w'); +fprintf(fcoeff,coeff_format,typecast(int8(coeffs),'uint8')); +fclose(fcoeff); + +end \ No newline at end of file