This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open(S,"sox salakalastaja.wav -t .raw -e signed -|"); | |
| open(U,"|sox -b 16 -c 1 -e signed -t .raw -r 44100 ". | |
| "- ssb.wav sinc 6000 -n 4096"); | |
| while(not eof(S)) { | |
| read(S,$a,2); | |
| print U pack("s",unpack("s",$a) * | |
| cos(($n++ * 2 * 3.141592653589793 * 6000) / 44100); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $prevbit = 0; | |
| $n=0; | |
| for (qx!cat ddtaa.asc!) { | |
| chomp($a = $_); | |
| if ($n >= 2300) { | |
| if (($n - 2300) % 80 == 0) { | |
| $bit = ($a > 0) ? 1 : 0; | |
| print (($bit != $prevbit) ? "1" : "0"); | |
| $prevbit = $bit; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use constant BPS => 300; | |
| use constant SRATE => 44100; | |
| $dur = 0; | |
| for (qx!cat olddata.asc!) { | |
| chomp($a = $_); | |
| if ($a * $preva < 0) { | |
| $nbits = int($dur / (SRATE/BPS) + .5); | |
| print ((($preva < 0) ? 1 : 0) x $nbits); | |
| $dur = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while(not eof(STDIN)) { | |
| read(STDIN,$a,2); | |
| $a = unpack("s",$a); | |
| print $a."\n"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use utf8; | |
| use warnings; | |
| @kirjaimet = ( "a" .. "z", "å", "ä", "ö" ); | |
| $alkutilanne = "aaaaaaaaaaaaaaa"; | |
| $valintapaine = "kehitysoppi"; | |
| # Elinkelpoisuutta simuloidaan ns. Levenšteinin etäisyydellä, joka sopii esimerkkiimme | |
| use Text::Levenshtein qw(fastdistance); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| use feature "switch"; | |
| open(S,"convert bitit.png gray:-|"); | |
| for $y (0..434) { | |
| for $x (0..699) { | |
| read(S,$a,1); | |
| $b[int($x / 27)][int($y / 27)] ++ if (ord($a) < 127); | |
| } | |
| } |
NewerOlder