function gen_Wn_coeffs_5ndft(nb_inputs_tot, bitwidth, file) coeff_format = 'library ieee;\nUSE ieee.std_logic_1164.all;\nUSE work.FIVEn_DFT_PKG.all;\npackage coeff is\n TYPE vect_cos_sin_k_pi_over_n_wb IS ARRAY (0 TO cst_nb_wn_coeffs-1) OF smpl_cos_sin_wb ;\n CONSTANT cos_k_pi_over_n_wb : vect_cos_sin_k_pi_over_n_wb := ("'; for i = 0:nb_inputs_tot/2-2 coeff_format = strcat(coeff_format, string(bin(fi(real(exp(-2*1i*pi*i/nb_inputs_tot)),1,bitwidth, bitwidth-2))), '","'); end coeff_format = strcat(coeff_format, string(bin(fi(real(exp(-2*1i*pi*(nb_inputs_tot/2-1)/nb_inputs_tot)),1,bitwidth, bitwidth-2))), '");\n CONSTANT sin_k_pi_over_n_wb : vect_cos_sin_k_pi_over_n_wb := ("'); for i = 0:nb_inputs_tot/2-2 coeff_format = strcat(coeff_format, string(bin(fi(imag(exp(-2*1i*pi*i/nb_inputs_tot)),1,bitwidth, bitwidth-2))), '","'); end coeff_format = strcat(coeff_format, string(bin(fi(imag(exp(-2*1i*pi*(nb_inputs_tot/2-1)/nb_inputs_tot)),1,bitwidth, bitwidth-2))), '");\nend package coeff;'); fcoeff = fopen(file,'w'); fprintf(fcoeff,coeff_format); fclose(fcoeff); end