function save_coef(outfile,h,order) % function save_coef(outfile,h,order) % write the filter coefficients stored in h % as a .asm file for use under Code Composer Studio % all the element of h must be two's complement % decimal numbers % if order is -1 the order of h is reversed [m,n]=size(h); if (m > 1) & (n > 1) disp('Error: h must be a vector'); return; end; if (n > m) h = h'; end; if order == -1 h = flipud(h); end; m=max(m,n); fid = fopen(outfile,'w'); fprintf(fid,' .def _coef\n'); fprintf(fid,' .sect "coeffs"\n'); fprintf(fid,'_coef:\n'); for i=1:m fprintf(fid,' .short 0%xh\n',h(i)); end; fclose(fid);