Exemplo n.º 1
0
#!/usr/bin/env python

from __future__ import division

from time import sleep, time
import matplotlib
import pylab
import numpy as np
#import pyback

from covert_fsk import Covert, show_sig


cc = Covert(bit_rate=100., f0=600., f1=900., spl_rate=50000)

while True:
    #S = pyback.measure(1 * 1000 * 1000, 50000)
    S = cc.measure(3)
    S_ = cc.bandpass(S)
    B = cc.demod(S_)
    pkts = cc.decode(B)

    pylab.figure(1); 
    pylab.subplot(2,1,1); show_sig(S, 5*20*4)
    pylab.subplot(2,1,2); show_sig(B, 5*20*4)
    pylab.draw()
    
    print 78*"-"
    for p in pkts:
        if len(p) == len(cc.test_pkt):
            print "%1.4f: %s" % (np.mean(np.abs(p - cc.test_pkt)), p)
Exemplo n.º 2
0
#!/usr/bin/env python

from __future__ import division

from time import sleep, time
import matplotlib
import pylab
import numpy as np
import pyback

from covert_fsk import Covert, show_sig


cc = Covert(bit_rate=100., f0=600., f1=900., spl_rate=50000)

while True:
    S = pyback.measure(1 * 1000 * 1000, 50000)
    S_ = cc.bandpass(S)
    B = cc.demod(S_)
    pkts = cc.decode(B)

    pylab.figure(1); 
    pylab.subplot(2,1,1); show_sig(S, 5*20*4)
    pylab.subplot(2,1,2); show_sig(B, 5*20*4)
    pylab.draw()
    
    print 78*"-"
    for p in pkts:
        if len(p) == len(cc.test_pkt):
            print "%1.4f: %s" % (np.mean(np.abs(p - cc.test_pkt)), p)
Exemplo n.º 3
0
#!/usr/bin/env python 

from __future__ import division

import numpy as np

from time import sleep
from covert_fsk import Covert



if __name__ == "__main__":
    cc = Covert()

    while True:
        print "Sending..."
        cc.send_bits( cc.sync_pattern.tolist() + cc.test_pkt.tolist() )
        sleep(.5)

Exemplo n.º 4
0
#!/usr/bin/env python

from __future__ import division

import numpy as np

from time import sleep
from covert_fsk import Covert

if __name__ == "__main__":
    cc = Covert()

    while True:
        print "Sending..."
        cc.send_bits(cc.sync_pattern.tolist() + cc.test_pkt.tolist())
        sleep(.5)
Exemplo n.º 5
0
#!/usr/bin/env python

from __future__ import division

from time import sleep, time
import matplotlib
import pylab
import numpy as np
#import pyback

from covert_fsk import Covert, show_sig

cc = Covert(bit_rate=100., f0=600., f1=900., spl_rate=50000)

while True:
    #S = pyback.measure(1 * 1000 * 1000, 50000)
    S = cc.measure(3)
    S_ = cc.bandpass(S)
    B = cc.demod(S_)
    pkts = cc.decode(B)

    pylab.figure(1)
    pylab.subplot(2, 1, 1)
    show_sig(S, 5 * 20 * 4)
    pylab.subplot(2, 1, 2)
    show_sig(B, 5 * 20 * 4)
    pylab.draw()

    print 78 * "-"
    for p in pkts:
        if len(p) == len(cc.test_pkt):