Browse Source

add lookup table for DAC mapping

git-svn-id: https://bucket.mit.edu/svn/nilm/zoom@8026 ddd99763-3ecb-0310-9145-efcb8ce7c51f
tags/zoom-1.0
jim 12 years ago
parent
commit
5cb6542c7e
3 changed files with 1044 additions and 0 deletions
  1. +7
    -0
      firmware/Makefile
  2. +13
    -0
      firmware/gen-dac-lookup.pl
  3. +1024
    -0
      firmware/lookup.inc

+ 7
- 0
firmware/Makefile View File

@@ -0,0 +1,7 @@
all: lookup.inc

lookup.inc: gen-dac-lookup.pl
perl gen-dac-lookup.pl > lookup.inc

show: lookup.inc
echo 'plot "lookup.inc" with lines' | gnuplot -persist

+ 13
- 0
firmware/gen-dac-lookup.pl View File

@@ -0,0 +1,13 @@
#!/usr/bin/perl

srand(1337);

# constant bits, the rest are filled with random data
$bits = $ARGV[0] || 10;

$rem = 16 - $bits;
for ($i = 0; $i < 2**$bits; $i++)
{
$out = $i * 2**$rem + int(rand(2**$rem));
print $out . ",\n";
}

+ 1024
- 0
firmware/lookup.inc
File diff suppressed because it is too large
View File


Loading…
Cancel
Save