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 | |
# Oona Rรคisรคnen 2014 | |
use warnings; | |
$fs = 48000; | |
$f = 200; | |
$pi = 3.141592653589793238; | |
open(U,"|sox -t .raw -c 1 -r $fs -b 16 -e signed - sines.wav"); |
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 warnings; | |
use DateTime; | |
$snum = 0; | |
$writing = 0; | |
open OUT, "|sox -t .raw -e signed-integer -b 16 -r 44100 ". | |
"-c 1 - stamped.wav"; | |
while (not eof STDIN) { |
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 warnings; | |
my $snum = 0; | |
my $reading = 0; | |
open my $in, '-|', 'sox stamped.wav -e unsigned-integer -t .raw -'; | |
while (read $in, $sample, 2) { | |
$bit = (unpack "S", $sample) & 1; |
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 warnings; | |
use DateTime; | |
$snum = 0; | |
$writing = 0; | |
open OUT, "|sox -t .raw -e unsigned-integer -b 16 -r 44100 ". | |
"-c 1 - stamped.wav"; | |
while (not eof STDIN) { |
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
# Oona Rรคisรคnen 2013 | |
# http://windytan.com | |
# ssh-keygen -l -f ~/.ssh/id_rsa.pub | perl emoji.pl | |
@emoji = qw( ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ฐ ๐ฑ ๐ฒ ๐ณ ๐ด ๐ต ๐ท ๐ธ | |
๐น ๐บ ๐ป ๐ผ ๐ฝ ๐พ ๐ฟ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ | |
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ | |
๐ ๐ ๐ ๐ ๐ ๐ก ๐ข ๐ฃ ๐ค ๐ฅ ๐ฆ ๐ง ๐จ ๐ฉ ๐ช ๐ซ | |
๐ฌ ๐ญ ๐ฎ ๐ฏ ๐ฐ ๐ฑ ๐ฒ ๐ณ ๐ด ๐ต ๐ถ ๐ท ๐ธ ๐น ๐บ ๐ป |
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
$fs = 48000; # sample rate | |
$fc = 3729; # carrier frequency | |
$filter = " sinc -$fc"; # optional LP filter | |
$fc = freq($fc); | |
open(IN, "sox scrambled.wav -c 1 -b 16 -e signed -t .raw -|"); | |
open(OUT,"|sox -r $fs -c 1 -b 16 -e signed -t .raw - descrambled.wav". | |
$filter); |
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(IN, "sox scrambled.wav -r 8600 -c 1 -t .s16 -|"); | |
open(OUT,"|sox -r 8600 -c 1 -t .s16 - descrambled.wav"); | |
$n = 1; | |
while (not eof IN) { | |
read IN, $a, 2; | |
print OUT pack("s",unpack("s",$a) * $n); | |
$n *= -1; | |
} |
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 warnings; | |
use Getopt::Std; | |
getopt('xytGgwsf',\%opts); | |
# pcm file = $opts{f} | |
# samples per pixel x | |
$xscale = $opts{x} // 1200; |
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 warnings; | |
use Text::LevenshteinXS qw(distance); | |
for (qx!cat nappis.txt!) { | |
$merkki{$2} = $1 if (/^(.+) ([01]+)/); | |
} | |
while (<>) { | |
chomp(); |
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
#include <stdlib.h> | |
#include <math.h> | |
#include <string.h> | |
#include <fftw3.h> | |
#define FFTLEN 2048 | |
#define SRATE 22050 | |
// Return sinusoid power from complex DFT coefficients | |
double power (fftw_complex coeff) { |