%myezkit mfile - written by AJL to write a filter file for the SHARC EZ-KIT lite %typical usage for FIR filter - myezkit(h); %typical usage for IIR filter - myezkit(a,b); % file format is - filter, source, numtaps (<32 for IIR and <256 for FIR), normalised coeffs (to 0.5) % filter = 0 for none, 1 for this % source = 0 for samples, =1 for noise, =2 for impulse of 4096 samples, > 2 = 0 function myezkit(coeffsa,coeffsb,source,filter,filename) if (nargin > 4) fid = fopen('input.dat'); else fid = fopen(filename); end; if (nargin > 3) fprintf(fid, '%d ',filter); else fprintf(fid, '%d ',0); end; if (nargin > 2) fprintf(fid,'%d ',source); else fprintf(fid,'%d ',1); end; fprintf(fid,'%d ',size(coeffsa)); fprintf(fid,'%1.12f ',(coeffsa/max(abs(coeffsa)))); if (nargin > 1) fprintf(fid,'%1.12f ',coeffsb/max(abs(coeffsb))); end fclose(fid);