Пример #1
0
def wavfileinput(filename, verbose=False, dodistance=False, homegrid="", homelatlon=[]):
# does the analysis for a wav file
# returns the packet array if you want it
    sys.stderr.write("processing: " + filename + "\n")
    packets = jt65wrapy.decodewav(filename)
    if verbose:
        print packets

    for packet in packets:
        diffs = checkpacket(packet, verbose)
        if len(diffs) <= 26:  # need to toss these... offair decoder is better than analysis decoder (we don't have deletions here)
            output(diffs, packet, dodistance, homegrid, homelatlon)

    return packets
Пример #2
0
 def test_DecodeWav(self):
     expectedresult = "KB2BBC KA1AAB DD44"
     msg = np.array(
         [39, 19, 16, 44, 29, 13, 58, 19, 13, 14, 20, 44, 17, 20, 25, 31, 46, 2, 29, 35, 56, 17, 11, 20, 39,
          51, 7, 30, 26, 11, 17, 27, 21, 11, 30, 34, 46, 48, 15, 53, 14, 26, 12, 7, 5, 8, 42, 41, 37, 19,
          16, 35, 63, 20, 3, 12, 38, 26, 8, 37, 22, 23, 29])
     tones = jt65sound.toneswithsync(msg)
     jt65sound.outputwavfile("test_output.wav", tones)
     result = jt.decodewav("test_output.wav")
     symbols, confidence, jt65result, s2db, freq, a1, a2 = result[0]
     os.remove("test_output.wav")  # Cleanup!
     self.assertEqual(len(result), 1)
     self.assertEqual(symbols, msg.tolist())
     self.assertEqual(
         confidence, [255] * 63)  # 63 symbols with 100% confidence
     self.assertEqual(jt65result, expectedresult)
Пример #3
0
def inputwavfile(filename, verbose=False):
# Performs decoding of JT65 wav file

    messages = jt.decodewav(filename)

    if verbose:
        for currentmsg in messages:
            symbols, confidence, jt65msg, s2db, freq, a1, a2 = currentmsg

            print "Decoded file : " + filename
            print "Symbols : " + str(symbols)
            print "Confidence : " + str(confidence)
            print "JT65 Msg : " + jt65msg
            print "S2DB : " + s2db
            print "Freq : " + freq
            print "a1 : " + a1
            print "a2 : " + a2

    return messages
Пример #4
0
def wavfileinput(filename,
                 verbose=False,
                 dodistance=False,
                 homegrid="",
                 homelatlon=[]):
    # does the analysis for a wav file
    # returns the packet array if you want it
    sys.stderr.write("processing: " + filename + "\n")
    packets = jt65wrapy.decodewav(filename)
    if verbose:
        print packets

    for packet in packets:
        diffs = checkpacket(packet, verbose)
        if len(
                diffs
        ) <= 26:  # need to toss these... offair decoder is better than analysis decoder (we don't have deletions here)
            output(diffs, packet, dodistance, homegrid, homelatlon)

    return packets