added conversion to binary form
[svn42.git] / rf433rcv / pc / data2sample.pl
diff --git a/rf433rcv/pc/data2sample.pl b/rf433rcv/pc/data2sample.pl
new file mode 100755 (executable)
index 0000000..2690012
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+use strict;
+my $base=shift @ARGV;
+
+my @input= split //,<>;
+
+print 1 x $base;
+print 0 x (31 * $base);
+
+for my $current (@input)
+{
+  if ($current)
+  {
+    print 1 x (3*$base);
+    print 0 x $base;
+  } else {
+    print 1 x $base;
+    print 0 x (3*$base);
+  }
+}