plasma: reverse engineering the sine tables

This commit is contained in:
Vince Weaver 2023-09-03 22:17:39 -04:00
parent df69d2d5ba
commit d1bcefc04a
4 changed files with 249 additions and 0 deletions

View File

@ -0,0 +1,28 @@
CFLAGS = -O2 -Wall
LFLAGS =
MATH_LFLAGS = -lm
all: sine_dup sine_reverse
###
sine_dup: sine_dup.o
$(CC) -o sine_dup sine_dup.o $(LFLAGS) $(MATH_LFLAGS)
sine_dup.o: sine_dup.c
$(CC) $(CFLAGS) -c sine_dup.c
###
sine_reverse: sine_reverse.o
$(CC) -o sine_reverse sine_reverse.o $(LFLAGS)
sine_reverse.o: sine_reverse.c
$(CC) $(CFLAGS) -c sine_reverse.c
###
clean:
rm -f *~ *.o sine_dup sine_reverse

View File

@ -0,0 +1,96 @@
#include <stdio.h>
#include <math.h>
#define PI 3.14159265358979323846264338327950
static int sin1[256]={
0x2E,0x30,0x32,0x34,0x35,0x36,0x38,0x3A,
0x3C,0x3C,0x3E,0x40,0x41,0x42,0x44,0x45,
0x47,0x47,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,
0x4F,0x50,0x51,0x52,0x53,0x53,0x54,0x54,
0x55,0x55,0x56,0x57,0x57,0x58,0x58,0x57,
0x58,0x58,0x58,0x58,0x58,0x58,0x58,0x58,
0x58,0x57,0x57,0x57,0x56,0x56,0x55,0x54,
0x55,0x54,0x53,0x52,0x52,0x51,0x50,0x4F,
0x4E,0x4E,0x4D,0x4C,0x4B,0x4B,0x4A,0x49,
0x48,0x47,0x46,0x45,0x45,0x44,0x42,0x42,
0x41,0x41,0x3F,0x3F,0x3D,0x3D,0x3C,0x3B,
0x3B,0x39,0x39,0x39,0x38,0x38,0x37,0x36,
0x36,0x35,0x35,0x34,0x34,0x33,0x32,0x32,
0x32,0x31,0x31,0x31,0x30,0x31,0x30,0x30,
0x30,0x30,0x2F,0x2F,0x30,0x2F,0x2F,0x2F,
0x2F,0x2F,0x2F,0x2F,0x2E,0x2F,0x2F,0x2F,
0x2E,0x2F,0x2F,0x2F,0x2F,0x2E,0x2F,0x2F,
0x2F,0x2E,0x2F,0x2F,0x2E,0x2E,0x2F,0x2E,
0x2E,0x2D,0x2E,0x2D,0x2D,0x2D,0x2C,0x2C,
0x2C,0x2B,0x2B,0x2B,0x2A,0x2A,0x29,0x28,
0x28,0x27,0x27,0x26,0x26,0x25,0x25,0x23,
0x23,0x22,0x21,0x21,0x20,0x1F,0x1F,0x1D,
0x1D,0x1C,0x1B,0x1A,0x19,0x19,0x17,0x16,
0x16,0x15,0x14,0x13,0x13,0x12,0x11,0x10,
0x0F,0x0F,0x0E,0x0D,0x0C,0x0C,0x0B,0x0A,
0x09,0x09,0x08,0x08,0x08,0x07,0x06,0x07,
0x06,0x06,0x06,0x06,0x05,0x06,0x05,0x05,
0x06,0x05,0x06,0x06,0x07,0x07,0x08,0x08,
0x09,0x09,0x0A,0x0B,0x0B,0x0C,0x0C,0x0D,
0x0F,0x0F,0x10,0x12,0x12,0x14,0x15,0x16,
0x17,0x19,0x1A,0x1B,0x1D,0x1E,0x20,0x21,
0x22,0x24,0x26,0x27,0x28,0x2A,0x2C,0x2E,
};
static int sin2[256]={
0x2E,0x33,0x38,0x3C,0x40,0x43,0x47,0x4B,0x4E,0x51,0x54,0x56,0x59,0x5A,0x5C,0x5D,0x5D,0x5E,0x5E,0x5D,0x5C,0x5A,0x59,0x57,0x55,0x53,0x4F,0x4C,0x49,0x46,0x42,0x3E,
0x3A,0x36,0x32,0x2E,0x2A,0x26,0x23,0x1F,0x1C,0x18,0x15,0x12,0x10,0x0E,0x0C,0x0A,0x09,0x08,0x07,0x07,0x07,0x07,0x09,0x0A,0x0B,0x0D,0x0F,0x11,0x13,0x16,0x19,0x1C,
0x1F,0x22,0x26,0x29,0x2C,0x2F,0x32,0x36,0x38,0x3B,0x3E,0x3F,0x42,0x44,0x46,0x47,0x48,0x49,0x4B,0x4B,0x4B,0x4A,0x4A,0x49,0x49,0x48,0x46,0x44,0x43,0x41,0x3F,0x3C,
0x3A,0x38,0x35,0x33,0x30,0x2E,0x2C,0x2A,0x28,0x26,0x24,0x22,0x21,0x20,0x1F,0x1F,0x1E,0x1E,0x1D,0x1D,0x1E,0x1E,0x1F,0x20,0x21,0x22,0x24,0x25,0x27,0x29,0x2B,0x2D,
0x2E,0x30,0x33,0x35,0x37,0x38,0x3A,0x3C,0x3D,0x3E,0x3F,0x3F,0x40,0x40,0x41,0x40,0x40,0x3F,0x3F,0x3E,0x3D,0x3B,0x3A,0x38,0x36,0x34,0x31,0x2F,0x2D,0x2B,0x29,0x25,
0x23,0x21,0x1F,0x1D,0x1B,0x19,0x18,0x16,0x15,0x14,0x14,0x13,0x13,0x13,0x13,0x14,0x16,0x17,0x18,0x1A,0x1C,0x1D,0x20,0x23,0x26,0x28,0x2C,0x2E,0x32,0x35,0x38,0x3B,
0x3E,0x41,0x45,0x48,0x4B,0x4C,0x4F,0x51,0x53,0x54,0x55,0x55,0x57,0x57,0x57,0x56,0x55,0x53,0x52,0x50,0x4E,0x4B,0x49,0x45,0x42,0x3F,0x3B,0x37,0x34,0x30,0x2C,0x27,
0x23,0x1F,0x1C,0x18,0x14,0x11,0x0E,0x0B,0x09,0x07,0x05,0x03,0x02,0x01,0x00,0x00,0x01,0x01,0x02,0x03,0x05,0x07,0x0A,0x0D,0x10,0x13,0x17,0x1A,0x1E,0x22,0x26,0x2A,
};
static int sin3[256]={
0x26,0x2C,0x31,0x35,0x39,0x3D,0x40,0x42,0x44,0x45,0x45,0x46,0x45,0x43,0x42,0x40,0x3C,0x3A,0x38,0x36,0x33,0x31,0x30,0x2F,0x2F,0x2E,0x2F,0x2F,0x30,0x33,0x33,0x36,
0x37,0x3A,0x3C,0x3C,0x3E,0x3E,0x3D,0x3D,0x3B,0x39,0x36,0x34,0x30,0x2B,0x28,0x23,0x1D,0x19,0x14,0x11,0x0C,0x09,0x07,0x04,0x03,0x03,0x03,0x03,0x04,0x07,0x09,0x0C,
0x0F,0x13,0x16,0x18,0x1B,0x1E,0x20,0x22,0x22,0x23,0x24,0x24,0x23,0x22,0x21,0x20,0x1D,0x1C,0x1B,0x1A,0x19,0x19,0x19,0x1A,0x1C,0x1E,0x20,0x23,0x27,0x2B,0x2F,0x33,
0x37,0x3D,0x40,0x44,0x47,0x4A,0x4C,0x4D,0x4E,0x4E,0x4D,0x4C,0x4A,0x47,0x45,0x41,0x3C,0x39,0x35,0x32,0x2E,0x2B,0x28,0x26,0x25,0x23,0x23,0x22,0x22,0x24,0x24,0x25,
0x26,0x29,0x2A,0x2A,0x2B,0x2C,0x2B,0x2B,0x29,0x28,0x25,0x23,0x20,0x1C,0x19,0x15,0x10,0x0D,0x09,0x07,0x04,0x02,0x01,0x00,0x00,0x00,0x02,0x03,0x06,0x0A,0x0D,0x11,
0x15,0x1B,0x1F,0x23,0x27,0x2B,0x2D,0x30,0x32,0x33,0x34,0x35,0x35,0x33,0x33,0x32,0x30,0x2E,0x2D,0x2C,0x2B,0x2A,0x2A,0x2A,0x2B,0x2C,0x2E,0x30,0x32,0x36,0x38,0x3B,
0x3E,0x42,0x45,0x47,0x49,0x4B,0x4B,0x4B,0x4A,0x49,0x47,0x45,0x42,0x3D,0x3A,0x35,0x30,0x2B,0x26,0x22,0x1E,0x1A,0x17,0x14,0x13,0x11,0x10,0x10,0x10,0x12,0x12,0x14,
0x15,0x18,0x1A,0x1B,0x1D,0x1E,0x1F,0x1F,0x1F,0x1F,0x1E,0x1D,0x1B,0x18,0x16,0x14,0x10,0x0E,0x0C,0x0B,0x09,0x08,0x08,0x09,0x0A,0x0C,0x0E,0x11,0x14,0x19,0x1D,0x22,
};
static int sin4[256]={
0x40,0x41,0x43,0x44,0x46,0x47,0x49,0x4A,0x4C,0x4D,0x4F,0x50,0x52,0x53,0x55,0x56,0x58,0x59,0x5B,0x5C,0x5D,0x5F,0x60,0x61,0x63,0x64,0x65,0x67,0x68,0x69,0x6A,0x6B,
0x6C,0x6D,0x6F,0x70,0x71,0x72,0x73,0x73,0x74,0x75,0x76,0x77,0x78,0x78,0x79,0x7A,0x7A,0x7B,0x7B,0x7C,0x7C,0x7D,0x7D,0x7D,0x7E,0x7E,0x7E,0x7F,0x7F,0x7F,0x7F,0x7F,
0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7E,0x7E,0x7E,0x7D,0x7D,0x7D,0x7C,0x7C,0x7B,0x7B,0x7A,0x7A,0x79,0x78,0x78,0x77,0x76,0x75,0x74,0x73,0x73,0x72,0x71,0x70,0x6F,0x6D,
0x6C,0x6B,0x6A,0x69,0x68,0x67,0x65,0x64,0x63,0x61,0x60,0x5F,0x5D,0x5C,0x5B,0x59,0x58,0x56,0x55,0x53,0x52,0x50,0x4F,0x4D,0x4C,0x4A,0x49,0x47,0x46,0x44,0x43,0x41,
0x3F,0x3E,0x3C,0x3B,0x39,0x38,0x36,0x35,0x33,0x32,0x30,0x2F,0x2D,0x2C,0x2A,0x29,0x27,0x26,0x24,0x23,0x22,0x20,0x1F,0x1E,0x1C,0x1B,0x1A,0x18,0x17,0x16,0x15,0x14,
0x13,0x12,0x10,0x0F,0x0E,0x0D,0x0C,0x0C,0x0B,0x0A,0x09,0x08,0x07,0x07,0x06,0x05,0x05,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x07,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0C,0x0D,0x0E,0x0F,0x10,0x12,
0x13,0x14,0x15,0x16,0x17,0x18,0x1A,0x1B,0x1C,0x1E,0x1F,0x20,0x22,0x23,0x24,0x26,0x27,0x29,0x2A,0x2C,0x2D,0x2F,0x30,0x32,0x33,0x35,0x36,0x38,0x39,0x3B,0x3C,0x3E,
};
int main(int argc, char **argv) {
int i;
int ours[256];
int diff=0;
for(i=0;i<256;i++) {
/* start 46, peak=88, 21 */
ours[i]=round(47.0+
32.0*sin(i*(PI*2.0/256.0))+
16.0*sin(i*(PI*2.0/128.0)));
//printf("%d %d\n",i,sin1[i]);
printf("%d: %d %d\n",i,sin1[i],ours[i]);
if (ours[i]!=sin1[i]) {
// printf("%d: %d %d\n",i,sin1[i],ours[i]);
diff++;
}
}
printf("Diff = %d\n",diff);
return 0;
}

View File

@ -0,0 +1,43 @@
# https://stackoverflow.com/questions/59725933/plot-fft-as-a-set-of-sine-waves-in-python
import matplotlib.pyplot as plt
import numpy as np
import cmath
sin3 = (46,48,50,52,53,54,56,58,60,60,62,64,65,66,68,69,71,71,73,74,75,76,77,78,79,80,81,82,83,83,84,84,85,85,86,87,87,88,88,87,88,88,88,88,88,88,88,88,88,87,87,87,86,86,85,84,85,84,83,82,82,81,80,79,78,78,77,76,75,75,74,73,72,71,70,69,69,68,66,66,65,65,63,63,61,61,60,59,59,57,57,57,56,56,55,54,54,53,53,52,52,51,50,50,50,49,49,49,48,49,48,48,48,48,47,47,48,47,47,47,47,47,47,47,46,47,47,47,46,47,47,47,47,46,47,47,47,46,47,47,46,46,47,46,46,45,46,45,45,45,44,44,44,43,43,43,42,42,41,40,40,39,39,38,38,37,37,35,35,34,33,33,32,31,31,29,29,28,27,26,25,25,23,22,22,21,20,19,19,18,17,16,15,15,14,13,12,12,11,10,9,9,8,8,8,7,6,7,6,6,6,6,5,6,5,5,6,5,6,6,7,7,8,8,9,9,10,11,11,12,12,13,15,15,16,18,18,20,21,22,23,25,26,27,29,30,32,33,34,36,38,39,40,42,44,46)
#x = np.arange(0,256,1)
# discrete works better if periodicity matches range (?)
x = np.linspace(0,4*np.pi, 256)
#fft3=np.fft.fft(sin3)
#
#plt.plot(x, sin3)
#plt.show()
fft3 = np.fft.fft(sin3)
freqs = np.fft.fftfreq(len(x),.01)
threshold = 0.0
recomb = np.zeros((len(x),))
middle = len(x)//2 + 1
for i in range(middle):
if abs(fft3[i])/(len(x)) > threshold:
if i == 0:
coeff = 2
else:
coeff = 1
sinusoid = 1/(len(x)*coeff/2)*(abs(fft3[i])*np.cos(freqs[i]*2*np.pi*x+cmath.phase(fft3[i])))
recomb += sinusoid
print(abs(fft3[i]))
plt.plot(x,sinusoid)
#plt.show()
plt.plot(x,recomb,x,sin3)
plt.show()
#plt.plot(fft3.imag)
#plt.show()
#for i in range(1,256):
# plt.plot(x, fft3.imag[i] * np.sin(i*x)/100)
#plt.show()

View File

@ -0,0 +1,82 @@
#include <stdio.h>
static int sin1[256]={
0x2E,0x30,0x32,0x34,0x35,0x36,0x38,0x3A,
0x3C,0x3C,0x3E,0x40,0x41,0x42,0x44,0x45,
0x47,0x47,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,
0x4F,0x50,0x51,0x52,0x53,0x53,0x54,0x54,
0x55,0x55,0x56,0x57,0x57,0x58,0x58,0x57,
0x58,0x58,0x58,0x58,0x58,0x58,0x58,0x58,
0x58,0x57,0x57,0x57,0x56,0x56,0x55,0x54,
0x55,0x54,0x53,0x52,0x52,0x51,0x50,0x4F,
0x4E,0x4E,0x4D,0x4C,0x4B,0x4B,0x4A,0x49,
0x48,0x47,0x46,0x45,0x45,0x44,0x42,0x42,
0x41,0x41,0x3F,0x3F,0x3D,0x3D,0x3C,0x3B,
0x3B,0x39,0x39,0x39,0x38,0x38,0x37,0x36,
0x36,0x35,0x35,0x34,0x34,0x33,0x32,0x32,
0x32,0x31,0x31,0x31,0x30,0x31,0x30,0x30,
0x30,0x30,0x2F,0x2F,0x30,0x2F,0x2F,0x2F,
0x2F,0x2F,0x2F,0x2F,0x2E,0x2F,0x2F,0x2F,
0x2E,0x2F,0x2F,0x2F,0x2F,0x2E,0x2F,0x2F,
0x2F,0x2E,0x2F,0x2F,0x2E,0x2E,0x2F,0x2E,
0x2E,0x2D,0x2E,0x2D,0x2D,0x2D,0x2C,0x2C,
0x2C,0x2B,0x2B,0x2B,0x2A,0x2A,0x29,0x28,
0x28,0x27,0x27,0x26,0x26,0x25,0x25,0x23,
0x23,0x22,0x21,0x21,0x20,0x1F,0x1F,0x1D,
0x1D,0x1C,0x1B,0x1A,0x19,0x19,0x17,0x16,
0x16,0x15,0x14,0x13,0x13,0x12,0x11,0x10,
0x0F,0x0F,0x0E,0x0D,0x0C,0x0C,0x0B,0x0A,
0x09,0x09,0x08,0x08,0x08,0x07,0x06,0x07,
0x06,0x06,0x06,0x06,0x05,0x06,0x05,0x05,
0x06,0x05,0x06,0x06,0x07,0x07,0x08,0x08,
0x09,0x09,0x0A,0x0B,0x0B,0x0C,0x0C,0x0D,
0x0F,0x0F,0x10,0x12,0x12,0x14,0x15,0x16,
0x17,0x19,0x1A,0x1B,0x1D,0x1E,0x20,0x21,
0x22,0x24,0x26,0x27,0x28,0x2A,0x2C,0x2E,
};
static int sin2[256]={
0x2E,0x33,0x38,0x3C,0x40,0x43,0x47,0x4B,0x4E,0x51,0x54,0x56,0x59,0x5A,0x5C,0x5D,0x5D,0x5E,0x5E,0x5D,0x5C,0x5A,0x59,0x57,0x55,0x53,0x4F,0x4C,0x49,0x46,0x42,0x3E,
0x3A,0x36,0x32,0x2E,0x2A,0x26,0x23,0x1F,0x1C,0x18,0x15,0x12,0x10,0x0E,0x0C,0x0A,0x09,0x08,0x07,0x07,0x07,0x07,0x09,0x0A,0x0B,0x0D,0x0F,0x11,0x13,0x16,0x19,0x1C,
0x1F,0x22,0x26,0x29,0x2C,0x2F,0x32,0x36,0x38,0x3B,0x3E,0x3F,0x42,0x44,0x46,0x47,0x48,0x49,0x4B,0x4B,0x4B,0x4A,0x4A,0x49,0x49,0x48,0x46,0x44,0x43,0x41,0x3F,0x3C,
0x3A,0x38,0x35,0x33,0x30,0x2E,0x2C,0x2A,0x28,0x26,0x24,0x22,0x21,0x20,0x1F,0x1F,0x1E,0x1E,0x1D,0x1D,0x1E,0x1E,0x1F,0x20,0x21,0x22,0x24,0x25,0x27,0x29,0x2B,0x2D,
0x2E,0x30,0x33,0x35,0x37,0x38,0x3A,0x3C,0x3D,0x3E,0x3F,0x3F,0x40,0x40,0x41,0x40,0x40,0x3F,0x3F,0x3E,0x3D,0x3B,0x3A,0x38,0x36,0x34,0x31,0x2F,0x2D,0x2B,0x29,0x25,
0x23,0x21,0x1F,0x1D,0x1B,0x19,0x18,0x16,0x15,0x14,0x14,0x13,0x13,0x13,0x13,0x14,0x16,0x17,0x18,0x1A,0x1C,0x1D,0x20,0x23,0x26,0x28,0x2C,0x2E,0x32,0x35,0x38,0x3B,
0x3E,0x41,0x45,0x48,0x4B,0x4C,0x4F,0x51,0x53,0x54,0x55,0x55,0x57,0x57,0x57,0x56,0x55,0x53,0x52,0x50,0x4E,0x4B,0x49,0x45,0x42,0x3F,0x3B,0x37,0x34,0x30,0x2C,0x27,
0x23,0x1F,0x1C,0x18,0x14,0x11,0x0E,0x0B,0x09,0x07,0x05,0x03,0x02,0x01,0x00,0x00,0x01,0x01,0x02,0x03,0x05,0x07,0x0A,0x0D,0x10,0x13,0x17,0x1A,0x1E,0x22,0x26,0x2A,
};
static int sin3[256]={
0x26,0x2C,0x31,0x35,0x39,0x3D,0x40,0x42,0x44,0x45,0x45,0x46,0x45,0x43,0x42,0x40,0x3C,0x3A,0x38,0x36,0x33,0x31,0x30,0x2F,0x2F,0x2E,0x2F,0x2F,0x30,0x33,0x33,0x36,
0x37,0x3A,0x3C,0x3C,0x3E,0x3E,0x3D,0x3D,0x3B,0x39,0x36,0x34,0x30,0x2B,0x28,0x23,0x1D,0x19,0x14,0x11,0x0C,0x09,0x07,0x04,0x03,0x03,0x03,0x03,0x04,0x07,0x09,0x0C,
0x0F,0x13,0x16,0x18,0x1B,0x1E,0x20,0x22,0x22,0x23,0x24,0x24,0x23,0x22,0x21,0x20,0x1D,0x1C,0x1B,0x1A,0x19,0x19,0x19,0x1A,0x1C,0x1E,0x20,0x23,0x27,0x2B,0x2F,0x33,
0x37,0x3D,0x40,0x44,0x47,0x4A,0x4C,0x4D,0x4E,0x4E,0x4D,0x4C,0x4A,0x47,0x45,0x41,0x3C,0x39,0x35,0x32,0x2E,0x2B,0x28,0x26,0x25,0x23,0x23,0x22,0x22,0x24,0x24,0x25,
0x26,0x29,0x2A,0x2A,0x2B,0x2C,0x2B,0x2B,0x29,0x28,0x25,0x23,0x20,0x1C,0x19,0x15,0x10,0x0D,0x09,0x07,0x04,0x02,0x01,0x00,0x00,0x00,0x02,0x03,0x06,0x0A,0x0D,0x11,
0x15,0x1B,0x1F,0x23,0x27,0x2B,0x2D,0x30,0x32,0x33,0x34,0x35,0x35,0x33,0x33,0x32,0x30,0x2E,0x2D,0x2C,0x2B,0x2A,0x2A,0x2A,0x2B,0x2C,0x2E,0x30,0x32,0x36,0x38,0x3B,
0x3E,0x42,0x45,0x47,0x49,0x4B,0x4B,0x4B,0x4A,0x49,0x47,0x45,0x42,0x3D,0x3A,0x35,0x30,0x2B,0x26,0x22,0x1E,0x1A,0x17,0x14,0x13,0x11,0x10,0x10,0x10,0x12,0x12,0x14,
0x15,0x18,0x1A,0x1B,0x1D,0x1E,0x1F,0x1F,0x1F,0x1F,0x1E,0x1D,0x1B,0x18,0x16,0x14,0x10,0x0E,0x0C,0x0B,0x09,0x08,0x08,0x09,0x0A,0x0C,0x0E,0x11,0x14,0x19,0x1D,0x22,
};
static int sin4[256]={
0x40,0x41,0x43,0x44,0x46,0x47,0x49,0x4A,0x4C,0x4D,0x4F,0x50,0x52,0x53,0x55,0x56,0x58,0x59,0x5B,0x5C,0x5D,0x5F,0x60,0x61,0x63,0x64,0x65,0x67,0x68,0x69,0x6A,0x6B,
0x6C,0x6D,0x6F,0x70,0x71,0x72,0x73,0x73,0x74,0x75,0x76,0x77,0x78,0x78,0x79,0x7A,0x7A,0x7B,0x7B,0x7C,0x7C,0x7D,0x7D,0x7D,0x7E,0x7E,0x7E,0x7F,0x7F,0x7F,0x7F,0x7F,
0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7E,0x7E,0x7E,0x7D,0x7D,0x7D,0x7C,0x7C,0x7B,0x7B,0x7A,0x7A,0x79,0x78,0x78,0x77,0x76,0x75,0x74,0x73,0x73,0x72,0x71,0x70,0x6F,0x6D,
0x6C,0x6B,0x6A,0x69,0x68,0x67,0x65,0x64,0x63,0x61,0x60,0x5F,0x5D,0x5C,0x5B,0x59,0x58,0x56,0x55,0x53,0x52,0x50,0x4F,0x4D,0x4C,0x4A,0x49,0x47,0x46,0x44,0x43,0x41,
0x3F,0x3E,0x3C,0x3B,0x39,0x38,0x36,0x35,0x33,0x32,0x30,0x2F,0x2D,0x2C,0x2A,0x29,0x27,0x26,0x24,0x23,0x22,0x20,0x1F,0x1E,0x1C,0x1B,0x1A,0x18,0x17,0x16,0x15,0x14,
0x13,0x12,0x10,0x0F,0x0E,0x0D,0x0C,0x0C,0x0B,0x0A,0x09,0x08,0x07,0x07,0x06,0x05,0x05,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x07,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0C,0x0D,0x0E,0x0F,0x10,0x12,
0x13,0x14,0x15,0x16,0x17,0x18,0x1A,0x1B,0x1C,0x1E,0x1F,0x20,0x22,0x23,0x24,0x26,0x27,0x29,0x2A,0x2C,0x2D,0x2F,0x30,0x32,0x33,0x35,0x36,0x38,0x39,0x3B,0x3C,0x3E,
};
int main(int argc, char **argv) {
int i;
for(i=0;i<256;i++) {
//printf("%d %d\n",i,sin1[i]);
printf("%d,",sin1[i]);
}
printf("\n");
return 0;
}