
space = int32(round(linspace(0,pi,128) * 2^16))
costable = int32(round(cos(linspace(0,pi,128)) * 2^16));
sintable = int32(round(sin(linspace(0,pi,128)) * 2^16));

space_file = fopen('space_table.txt', 'w');
cos_file = fopen('cos_table.txt', 'w');
sin_file = fopen('sin_table.txt', 'w');

for i=1:length(space)
	fprintf(space_file, '%d, ', space(i));
	if ~mod(i,8)
		fprintf(space_file, '\n');
	end
end

for i=1:length(costable)
	fprintf(cos_file, '%d, ', costable(i));
	if ~mod(i,8)
		fprintf(cos_file, '\n');
	end
end

for i=1:length(sintable)
	fprintf(sin_file, '%d, ', sintable(i));
	if ~mod(i,8)
		fprintf(sin_file, '\n');
	end
end

