% sin_wave = sin(2*pi*index*(rate/Fs))






wave(1:501) = 0:0.002:1
wave(502:1500) = 0.998:-0.002:-0.998;

wave(1501:2000) = -1:0.002:-0.002;
plot(wave);

%plot(wave);
filename = 'tri_table.dat';
filenameX = 'tri_table_hex.dat';

delete filename;
fid = fopen(filename, 'w');
fidX = fopen(filenameX, 'w');


for i = 1:length(wave)% - 1,
	fprintf(fid,'%d, \n',(wave(i)));
    fprintf(fidX,'0x%tx, \n',(wave(i)));
end

fclose('all');