Browse Source

Transférer les fichiers vers 'matlab'

testing
Lilian RM 3 years ago
parent
commit
ff2a63e4f3
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      matlab/write_polyfir_coeffs.m

+ 13
- 0
matlab/write_polyfir_coeffs.m View File

@@ -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

Loading…
Cancel
Save