Portapack应用开发教程(十八)NavTex接收 D

2023-05-16

上回说到,我现在已经做到用自己的gnuradio流图从音频信号做fsk解调,得到方波。然后用c程序把方波转为二进制数。又用python把二进制数转为最终的字母。

但是遗留问题是python解码,起始位如果错误,解的信息是错的。另外,也没有实现两个字符串的错位输出(这个功能是很好理解的,但是为了简化代码,我暂时没做)。

主要是python的问题,所以我把python改为比较完整的版本,并且这次我的输入数据,直接用c程序的输出,而不是人工去截取最好的一段数据,代码如下:

import numpy as np
import scipy
import scipy.signal
from scipy.io import wavfile
from navtex import ALPHABET_FIGS, ALPHABET_LTRS

string = "111111000011001111110000110011111100001100111111000011001111110000110011111100001100111111000011001111110000110011111100001100111111000010110101100110101101111100011101000101101111010001011011110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100011001111101001111000111010001100111111000011001111110000110011111100001100111111000011"


bits = list(string)

bits = np.array(bits)

N = 7
shift = 0

cur_alphabet_A = ALPHABET_LTRS
cur_alphabet_B = ALPHABET_LTRS

msg_a = ""
msg_b = ""
msgs_a = []
msgs_b = []

alpha_shift = 0
i = 0
while i*N + shift < len(bits):

    b = bits[i*N + shift:(i+1)*N + shift]

    s = "".join(map(str, b))
    s = s[::-1]
    h = int(s, 2)
    print (s, h, shift)
    if s.count('1') != 4:
        shift += 1
        continue 
            
    # Phasing signals, reset receiver
    if h == 0xf: # [alpha]
        alpha_shift = i % 2
        cur_alphabet_A = ALPHABET_LTRS
        
        if len(msg_a.replace('_', '')) > 10:
            msgs_a.append(msg_a)
            msgs_b.append(msg_b)
            msg_a = ""
            msg_b = ""
        msg_a = ""
            
    elif h == 0x66: # [rep]
        alpha_shift = (i+1) % 2
        cur_alphabet_B = ALPHABET_LTRS
        if len(msg_a.replace('_', '')) > 10:
            msgs_a.append(msg_a)
            msgs_b.append(msg_b)
            msg_a = ""
            msg_b = ""
        msg_b = ""

    # Regular symbols
    if i % 2 == alpha_shift:
        dec = cur_alphabet_A[h]
        if dec == '[ltrs]':
            cur_alphabet_A = ALPHABET_LTRS
        elif dec == '[figs]':
            cur_alphabet_A = ALPHABET_FIGS
        elif not dec.startswith('['):
            msg_a += dec
    else:
        dec = cur_alphabet_B[h]
        if dec == '[ltrs]':
            cur_alphabet_B = ALPHABET_LTRS
        elif dec == '[figs]':
            cur_alphabet_B = ALPHABET_FIGS
        elif not dec.startswith('['):
            msg_b += dec
    i += 1
                
i = 0
for msg_a, msg_b in zip(msgs_a, msgs_b):
    i += 1
    msg = ""
    for a, b in zip(msg_a, msg_b):
        if a == b:
            msg += a
        else:
            if a == '_' and b != '_':
                msg += b
            elif a != '_' and b == '_':
                msg += a
            else:
                msg += "_"
    print ("A: ", msg_a)
    print ("B: ", msg_b)
    print ("final: ", msg)
    print ("-" * 80)

输出结果如下:

('0111111', 63)
('0011111', 31)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1011010', 90)
('1100110', 102)
('1011010', 90)
('0001111', 15)
('0010111', 23)
('1011010', 90)
('0010111', 23)
('1011010', 90)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('0010111', 23)
('1100110', 102)
('0010111', 23)
('0001111', 15)
('0010111', 23)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('1100110', 102)
('0001111', 15)
('110', 6)
0
('A: ', 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ')
('B: ', 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ')
('final: ', 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ')
--------------------------------------------------------------------------------

程序先通过找连续7个位里正好有4个1的组合,如果找到就解码,找不到就移动1位。然后才开始根据解码内容找数据起始。

代码开头和结尾确实有15和102,对应0x0F和0x66,也就是[alpha]和[rep],就是通过找这两个phasing_signal,我们才能找到正确的起始位置。

另外结尾处也分别写出了A和B两列,经过比较完全一致,说明接收正确。

你还会看到90,对应0x5a,对应[ltrs]

接下来我们要做的是看懂这段python代码,把它改写为c++。还有之前的c代码也要改为c++然后合并到一起。

import numpy as np
from navtex import ALPHABET_FIGS, ALPHABET_LTRS

string = "11100001100111111000011001111110000110011111100001100111111000011001111110000110011111100001100111111000010110101100110101101111100011101000101101111010001011011110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100011001111101001111000111010001100111111000011001111110000110011111100001100111111000011"


bits = list(string)

bits = np.array(bits)

N = 7
shift = 0

cur_alphabet_A = ALPHABET_LTRS
cur_alphabet_B = ALPHABET_LTRS

msg_a = ""
msg_b = ""
msgs_a = []
msgs_b = []

alpha_shift = 0
i = 0
while i*N + shift < len(bits):

    b = bits[i*N + shift:(i+1)*N + shift]

    s = "".join(map(str, b))
    s = s[::-1]

    if s.count('1') != 4:
        shift += 1
        continue 

    h = int(s, 2)
    print (s, h)

    # Phasing signals, reset receiver
    if h == 0x0f: # [alpha]
        alpha_shift = i % 2

        msg = ""
        for a, b in zip(msg_a, msg_b):
            if a == b:
                msg += a

        if (len(msg)>0):
            print ("final : ", msg)
            print ("-" * 80)

        msg_a = ""
        msg_b = ""
            
    elif h == 0x66: # [rep]
        alpha_shift = (i+1) % 2

        msg = ""
        for a, b in zip(msg_a, msg_b):
            if a == b:
                msg += a

        if (len(msg)>0):
            print ("final : ", msg)
            print ("-" * 80)

        msg_a = ""
        msg_b = ""

    # Regular symbols
    if i % 2 == alpha_shift:
        dec = cur_alphabet_A[h]
        if dec == '[ltrs]':
            cur_alphabet_A = ALPHABET_LTRS
        elif dec == '[figs]':
            cur_alphabet_A = ALPHABET_FIGS
        elif not dec.startswith('['):
            msg_a += dec
    else:
        dec = cur_alphabet_B[h]
        if dec == '[ltrs]':
            cur_alphabet_B = ALPHABET_LTRS
        elif dec == '[figs]':
            cur_alphabet_B = ALPHABET_FIGS
        elif not dec.startswith('['):
            msg_b += dec
    i += 1


进一步简化会变成这样:

import numpy as np
from navtex import ALPHABET_FIGS, ALPHABET_LTRS

string = "11100001100111111000011001111110000110011111100001100111111000011001111110000110011111100001100111111000010110101100110101101111100011101000101101111010001011011110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100011001111101001111000111010001100111111000011001111110000110011111100001100111111000011"


bits = list(string)
bits = np.array(bits)

N = 7
shift = 0

i = 0
while i*N + shift < len(bits):

    b = bits[i*N + shift:(i+1)*N + shift]

    s = "".join(map(str, b))
    s = s[::-1]

    if s.count('1') != 4:
        shift += 1
        continue 

    h = int(s, 2)
    print (s, h, ALPHABET_LTRS[h])

    i += 1
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1011010', 90, '[ltrs]')
('1100110', 102, '[rep]')
('1011010', 90, '[ltrs]')
('0001111', 15, '[alpha]')
('0010111', 23, 'J')
('1011010', 90, '[ltrs]')
('0010111', 23, 'J')
('1011010', 90, '[ltrs]')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('0010111', 23, 'J')
('1100110', 102, '[rep]')
('0010111', 23, 'J')
('0001111', 15, '[alpha]')
('0010111', 23, 'J')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')
('1100110', 102, '[rep]')
('0001111', 15, '[alpha]')


用下面的c++程序,可实现类似的效果,会用shift找合适的二进制串,也能转为10进制,但还不能转为字符

#include <stdio.h>
#include <string>
#include <math.h>
#include <iostream>

using namespace std;

std::string str_temp = "11100001100111111000011001111110000110011111100001100111111000011001111110000110011111100001100111111000010110101100110101101111100011101000101101111010001011011110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100011001111101001111000111010001100111111000011001111110000110011111100001100111111000011";
//std::string str_temp = "1010101101010110101011010101101010110101011010101";
char *char_temp = const_cast<char *>(str_temp.c_str()) ;


int main (int argc, char**argv){

	int N = 7;
	int shift = 0;
	int i = 0;

	cout << str_temp.length() << endl;

	while (i*N + shift < str_temp.length())
	{
		int result_6 = char_temp[i*N+shift+0] - '0';
		int result_5 = char_temp[i*N+shift+1] - '0';
		int result_4 = char_temp[i*N+shift+2] - '0';
		int result_3 = char_temp[i*N+shift+3] - '0';
		int result_2 = char_temp[i*N+shift+4] - '0';
		int result_1 = char_temp[i*N+shift+5] - '0';
		int result_0 = char_temp[i*N+shift+6] - '0';
		int sum = result_0 + result_1 + result_2 + result_3 + result_4 + result_5 + result_6;

		if (sum != 4)
		{
        		shift += 1;
			continue;
		}

		cout << result_0 << result_1 << result_2 << result_3 << result_4 << result_5 << result_6 << endl;
		int result = result_0 * 64 + result_1 * 32 + result_2 * 16 +  result_3 * 8 + result_4 * 4 + result_5 * 2 + result_6 * 1;
		cout << result << endl;
		i+=1;		
	}


	return 0;
}

接下来,我在c++版本的解码程序中,把字符转换也加好了,还加入了一部分的控制逻辑,比如字母和数字切换,以及AB列分开等。代码如下:

#include <stdio.h>
#include <string>
#include <math.h>
#include <iostream>

using namespace std;

std::string str_temp ="111111000011001111110000110011111100001100111111000011001111110000110011111100001100111111000011001111110000110011111100001100111111000010110101100110101101111100010101010101101100011101011011010101101010110001111000111101010110101011000111100011110101011010101100011110001111010101101010110001111000111101010110101011000111100011110101011010101100011110001111010101101010110001111000111101010110101011000111100011110101011010101100011110001111010101101010110001111000111101010110101011000111100011110101011010101100011110001111010101101010110001111000111101010110101011000111100011110101011010101100011110001111010101101010110001111000111101010110101011000111100011110101011010101011001110001111111000101010101100111111000011001111110000110011111100001100111111000011";
//std::string str_temp = "11100001100111111000011001111110000110011111100001100111111000011001111110000110011111100001100111111000010110101100110101101111100011101000101101111010001011011110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100111010011101001110100011001111101001111000111010001100111111000011001111110000110011111100001100111111000011";
//std::string str_temp = "1010101101010110101011010101101010110101011010101";

std::string msg_a;
std::string msg_b;
char *char_temp = const_cast<char *>(str_temp.c_str()) ;
bool letters = false;
int alpha_shift = 0;

std::string final_decode_letters(int input)
{
	std::string decode_result;

	if (input == 15)	decode_result = "[alpha]";
	if (input == 23)	decode_result = "J";
	if (input == 27)	decode_result = "F";
	if (input == 29)	decode_result = "C";
	if (input == 30)	decode_result = "K";
	if (input == 39)	decode_result = "W";
	if (input == 43)	decode_result = "Y";
	if (input == 45)	decode_result = "P";
	if (input == 46)	decode_result = "Q";
	if (input == 51)	decode_result = "[beta]";
	if (input == 53)	decode_result = "G";
	if (input == 54)	decode_result = "[figs]";
	if (input == 57)	decode_result = "M";
	if (input == 58)	decode_result = "X";
	if (input == 60)	decode_result = "V";
	if (input == 71)	decode_result = "A";
	if (input == 75)	decode_result = "S";
	if (input == 77)	decode_result = "I";
	if (input == 78)	decode_result = "U";
	if (input == 83)	decode_result = "D";
	if (input == 85)	decode_result = "R";
	if (input == 86)	decode_result = "E";
	if (input == 89)	decode_result = "N";
	if (input == 90)	decode_result = "[ltrs]";
	if (input == 92)	decode_result = " ";
	if (input == 99)	decode_result = "Z";
	if (input == 101)	decode_result = "L";
	if (input == 102)	decode_result = "[rep]";
	if (input == 105)	decode_result = "H";
	if (input == 106)	decode_result = "[]";
	if (input == 108)	decode_result = "\n";
	if (input == 113)	decode_result = "O";
	if (input == 114)	decode_result = "B";
	if (input == 116)	decode_result = "T";
	if (input == 120)	decode_result = "[cr]";

	return decode_result;
		
}

std::string final_decode_figures(int input)
{
	std::string decode_result;

	if (input == 15)	decode_result = "[alpha]";
	if (input == 23)	decode_result = "'";
	if (input == 27)	decode_result = "!";
	if (input == 29)	decode_result = ":";
	if (input == 30)	decode_result = "(";
	if (input == 39)	decode_result = "2";
	if (input == 43)	decode_result = "6";
	if (input == 45)	decode_result = "0";
	if (input == 46)	decode_result = "1";
	if (input == 51)	decode_result = "[beta]";
	if (input == 53)	decode_result = "&";
	if (input == 54)	decode_result = "[figs]";
	if (input == 57)	decode_result = ".";
	if (input == 58)	decode_result = "/";
	if (input == 60)	decode_result = ";";
	if (input == 71)	decode_result = "-";
	if (input == 75)	decode_result = "[bell]";
	if (input == 77)	decode_result = "8";
	if (input == 78)	decode_result = "7";
	if (input == 83)	decode_result = "$";
	if (input == 85)	decode_result = "4";
	if (input == 86)	decode_result = "3";
	if (input == 89)	decode_result = ",";
	if (input == 90)	decode_result = "[ltrs]";
	if (input == 92)	decode_result = " ";
	if (input == 99)	decode_result = "\\";
	if (input == 101)	decode_result = ")";
	if (input == 102)	decode_result = "[rep]";
	if (input == 105)	decode_result = "#";
	if (input == 106)	decode_result = "[]";
	if (input == 108)	decode_result = "\n";
	if (input == 113)	decode_result = "9";
	if (input == 114)	decode_result = "?";
	if (input == 116)	decode_result = "5";
	if (input == 120)	decode_result = "[cr]";

	return decode_result;
		
}

int main (int argc, char**argv){

	int N = 7;
	int shift = 0;
	int i = 0;

	cout << "length: " << str_temp.length() << endl;

	while (i*N + shift < str_temp.length())
	{
		int result_6 = char_temp[i*N+shift+0] - '0';
		int result_5 = char_temp[i*N+shift+1] - '0';
		int result_4 = char_temp[i*N+shift+2] - '0';
		int result_3 = char_temp[i*N+shift+3] - '0';
		int result_2 = char_temp[i*N+shift+4] - '0';
		int result_1 = char_temp[i*N+shift+5] - '0';
		int result_0 = char_temp[i*N+shift+6] - '0';
		int sum = result_0 + result_1 + result_2 + result_3 + result_4 + result_5 + result_6;

		if (sum != 4)
		{
        		shift += 1;
			continue;
		}

		//cout << result_0 << result_1 << result_2 << result_3 << result_4 << result_5 << result_6 << endl;
		int input = result_0 * 64 + result_1 * 32 + result_2 * 16 +  result_3 * 8 + result_4 * 4 + result_5 * 2 + result_6 * 1;
		//cout << input << " ";

		if (input == 15)
		{
			alpha_shift = i % 2;
			if (msg_a.length() > 0 && msg_b.length() > 0 )
			{
				cout << "A: " << msg_a << endl;
				cout << "B: " << msg_b << endl;
			}
			msg_a = "";
			msg_b = "";
		}
		if (input == 102)
		{
			alpha_shift = (i+1) % 2;
			if (msg_a.length() > 0 && msg_b.length() > 0 )
			{
				cout << "A: " << msg_a << endl;
				cout << "B: " << msg_b << endl;
			}
			msg_a = "";
			msg_b = "";
		}

		if (input == 90)
		{
			letters = true;
		}
		if (input == 54)
		{
			letters = false;
		}

		if (alpha_shift == i % 2)
		{
			std::string output;
			if (letters == true)
			{
				output = final_decode_letters(input);
			}
			else
			{
				output = final_decode_figures(input);
			}
			if (output[0] != '[')
			{ 
				msg_a = msg_a + output;
			}
		}
		else
		{
			std::string output;
			if (letters == true)
			{
				output = final_decode_letters(input);
			}
			else
			{
				output = final_decode_figures(input);
			}
			if (output[0] != '[')
			{ 
				msg_b = msg_b + output;
			}
		}

		i+=1;		
	}


	return 0;
}

效果如下:

length: 768
A: ROROROROROROROROROROROROROROROROROR
B: ROROROROROROROROROROROROROROROROROROR

接下来,另外一部分从gnuradio接收到方波波型,转为二进制数的c语言程序也合并到一起就行,那部分程序需要先转为c++,但这两种语言很接近,几乎不需要怎么改动就行:

#include <stdio.h>
#include <string.h>
#include <math.h>


int main (int argc, char**argv){
	int16_t cursamp = 0;
	int result = 0, last_result = 0;
	int16_t counter = 0;
	int real_counter = 0;
	int buffer[10];

	while(!feof(stdin) ) {
		cursamp  = (int16_t) ( fgetc(stdin) | fgetc(stdin)<<8);
		counter++;

		if (cursamp >= 0 )
		{
			result = 1;
		}
		else
		{
			result = 0;
		}

		if (last_result != result)
		{
			real_counter = (int)(counter / 440);

			for (int i = 0; i < real_counter; i++)
			{
				buffer[i] = last_result;
			}


			for (int i = 0; i < real_counter; i++)
			{
				printf("%d", buffer[i]);
			}
			

			counter = 0;
			last_result = result;
		}
		//printf("%d", result);


	}

	return 0;
}

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Portapack应用开发教程(十八)NavTex接收 D 的相关文章

  • linux 下postgresql遇到几个问题

    问题1 xff1a Job for postgresql service failed because the control process exited with error code See 34 systemctl status p
  • ActiveMQ连接数过多,导致ActiveMQ无法正常接入数据

    ActiveMQ跑了一段时间 xff0c 会出现连接数据过多的报错 Could not accept connection org apache activemq transport tcp ExceededMaximumConnectio
  • Axure嵌入Echarts图表--javascript (js)注入

    前言 用Axure做Web原型设计时 xff0c 经常会有图表 特别是大屏可视化或者数据可视化的原型中就更为常见 传统的方法是通过既有的图形或者曲线加上文字来实现 由于Axure可以通过javascript注入 的方法进行简单的拓展 xff
  • Axure嵌入Highcharts图表--javascript (js)注入

    前言 上次发现可以通过javascript js 注入实现在Axure 里引用Echarts图表 xff0c 提升原型展现能力 xff0c 特别是在高保真原型 既然可以实现Echarts的图表引用 xff0c 那么能否用同样的方法引用Hig
  • 一个比较好用的网络爬虫软件GooSeeker

    最近要搜集一些新闻语料 xff0c 看论文发现一个叫GooSeeker的爬虫软件还不错 xff0c 看了一天多的教程终于跑起来了 xff0c 趁着这会在抓新浪新闻过来发篇blog 这个爬虫是作为Firefox的插件出现的 一开始还觉得不够强
  • LibreELEC(kodi)安装

    想体验 xff08 折腾 xff09 kodi xff0c 刚好手上有个空置的树莓派 xff0c 而LibreELEC是轻量化kodi分支的开源系统 xff0c 本文介绍自动和手动安装LibreELEC xff08 LE xff09 原文地
  • LibreELEC(kodi)安装 IPTV

    kodi的PVR IPTV Simple Client插件通过直播源可以实现类似电视机顶盒播放电视节目的基本功能 xff0c 本文将介绍LibreELEC xff08 kodi xff09 安装和简单设置的PVR IPTV Simple C
  • Axure中继器组件化GIS地图

    虽然可以使用JavaScript注入的方式将GIS地图嵌入Axure xff0c 但每次使用地图都需要重复嵌入并修改代码 xff0c 不太方便 那么 xff0c 能不能实现组件化呢 xff1f 我们可以使用中继器 xff08 repeate
  • 比特米盒子刷安卓ATV6.0

    最近海鲜市场有很多比特米盒子 xff0c 50多块包邮 xff0c 买来的盒子回来折腾下 xff0c 买回来发现一直卡在 系统启动 34 中无法进入 xff0c 不知道原来的是啥系统 xff0c 看来只能找找线刷的办法 xff0c 重新拯救
  • Visual Studio Code(VSCode) 编辑/编译/调试 C++ 代码

    前言 最近想要切换编辑工具 xff0c 之前工作中使用过 Source Insight xff0c Eclipse xff0c CLion 来写 C 43 43 代码 目前来说 Source Insight 已经非常古老 xff0c 只有编
  • Visual Studio Code(vscode) 格式化C++代码

    前言 vscode 自带的代码格式化工具不太好用 xff0c 因此我们需要有额外的代码格式化插件进行辅助 xff0c 一般情况下都使用 clang format 格式化 xff0c 这里是对 vscode 安装和使用 clang forma
  • C++如何监听http请求

    下面有个例子 xff0c 基于 Windows 的 xff0c 编译完 xff0c 运行 WebSrv 7070 即可 在程序的目录中放一个 index html 文件 Copyright c 2002 2005 by Zhang Huiy
  • 我的网页作品(div+css)

    前段时间为一个育儿网站做了一个个人空间主页 xff0c 这可是我的处女座 呵呵 请点击查看 xff1a Files shiyangxt baobaoke rar
  • 我用Visual Basic做的多模式计算器(应用小软件)!

    前一段时间参加了一个校内组织的IT实践大赛 xff0c 虽然当时没什么成熟的技术 xff0c 但是还是参加了 Visual Basic刚学也没多长时间 xff0c 于是就做了这个多模式计算器 xff0c 虽然技术含量不算高 xff0c 一些
  • C语言实现阶乘累加(1!+2!+3!+....+n!=?)

    最近要期末考试 xff0c 复习C语言 xff0c 见到一个看似很简单的问题 就是C语言实现阶乘累加 xff08 1 xff01 43 2 xff01 43 3 43 43 n 61 xff09 本来觉得这个肯定小意思 xff0c 但是修改
  • C++项目工程(包含opencv库以及项目的依赖库移植)编译成android可以使用的so库并在Android studio上调用so库进行使用(血泪操作总结)

    目录结构 概述预先准备编译操作so的函数导出并在android进行调用 概述 最近负责一个android项目需要使用到之前公司师兄编写的c 43 43 算法库 xff0c 一开始并不知道c 43 43 项目可以移植给android项目使用
  • C语言:用递归实现将输入的整数按逆序输出。如输入12345,则输出54321。

    这个程序是我对构造函数有个更深的认识 首先构造函数要先从头至尾走一边才会输出 xff0c 无论输出语句加的位置 xff08 循环内 xff0c 条件语句内 除外 xff09 然后构造函数递归可以把问题简单化 xff0c 本题如果按常规思路
  • Visual Basic函数大全!

    VB函数大全 Abs 函数 返回数的绝对值 And 运算符 执行两个表达式的逻辑连接 Array 函数 返回含一数组的 变体 Asc 函数 返回字符串首字母的 ANSI 字符代码 赋值运算符 61 给变量或属性赋值 Atn 函数 返回数的反
  • 数据结构与算法:哈夫曼树(源码)!

    这些天明白了一个道理 xff0c 搞技术也是需要激情的 也不知道为什么这段过的感觉特别的不爽 xff0c 也不知道是因为快要考试了 xff0c 心里没底 xff0c 而带来的恐惧 xff0c 还是 搞技术太久 xff0c 心里想放个假 xf
  • SSH超实用分页实现(原创开源)!

    SSH的分页网上有不少的例子 xff0c 有利用session的 xff0c 有利用分页组件的 我几个师兄原来搞的SSH项目也有一个成熟的分页插件 具体业务实现类中的分页方法 xff1a lt bgsound cep 61 34 0 34

随机推荐

  • 欢迎访问我的主博(http://shiyangxt.cnblogs.com)

    JavaEye的朋友 xff0c 大家好 我是一名大二的学生 xff0c 对编程技术怀有很大的热情 我的技术方向是Java xff0c 但是我的主博并不在这里 xff0c 而在博客园 xff0c 欢迎大家访问我的主博 施杨de编程世界 我渴
  • Linux应用编程---14.UDP服务器、客户端编程

    Linux应用编程 14 UDP服务器 客户端编程 之前有介绍过UDP是一种无连接 尽最大努力交付 面向报文的协议 应用层交给UDP多长的报文 xff0c UDP就照样发送 Linux下UDP属于数据报socket 数据报socket流程图
  • 0816网络编程day5

    include lt stdio h gt include lt sys types h gt include lt sys socket h gt include lt arpa inet h gt include lt netinet
  • STL容器特征

    STL中顺序容器类和关联容器类的主要特征如下 xff1a 1 vector 内部数据结构 xff1a 数组 随机访问每个元素 xff0c 所需要的时间为常量 在末尾增加或删除元素所需时间与元素数目无关 xff0c 在中间或开头增加或删除元素
  • 数据结构——不带头结点的单链表的基本操作

    数据结构 不带头节点的单链表的基本操作 结构体的创建 xff1a span class token keyword typedef span span class token keyword struct span SListNode sp
  • HTTP请求/响应报文结构

    HTTP请求 响应报文结构 HTTP请求报文 一个HTTP请求报文由四个部分组成 xff1a 请求行 请求头部 空行 请求数据 1 请求行 请求行由请求方法字段 URL字段和HTTP协议版本字段3个字段组成 xff0c 它们用空格分隔 比如
  • C语言练习笔记 ~结构体2 ~ 结构体在内存中的对齐说明

    文章目录 1 结构体变量在内存中的对齐说明例1 1个char型变量例2 2个char型变量例3 1个int型变量例4 1个char型变量和1个int型变量例5 3个char型变量和1个int型变量例6 5个char型变量和1个int型变量例
  • 思岚激光雷达+cartographer建图

    系统环境 xff1a Ubuntu18 04 ROS Melodic gcc 7 5 0 1 安装思岚ROS包 1 1 clone并编译 cd catkin ws src git clone https github com Slamtec
  • 使用PyTorch+functorch计算并可视化NTK矩阵

    2022年3月 xff0c PyTorch发布了PyTorch1 11和functorch functorch灵感来自于Google JAX xff0c 旨在提供vmap和autodiff转换配合PyTorch使用 本文将演示如何使用PyT
  • libcurl异步请求+http长连接池

    由于公司项目 xff0c 需要localhost的形式高并发的http访问本机服务 xff0c 所以面临了两方面的问题 xff1a 1 http短连接会造成大量的time wait xff0c 影响服务器的性能 2 libcurl easy
  • VC实现http发送get和post请求

    VC实现http发送get和post请求 get请求 首先通过前面介绍的抓包工具获取请求的详细内容 xff0c 然后再通过VC拼接Header xff0c 函数如下 xff1a bool CXXX http get eng mode lt
  • 链表(图文详解)

    链表的概念 链表是一种物理存储结构上非连续 xff0c 非顺序的存储结构 xff0c 数据元素的逻辑顺序是通过链表中的指针链接次序实现的 链表的结构是多式多样的 xff0c 当时通常用的也就是两种 xff1a 无头单向非循环列表 xff1a
  • PCB上能上锡的那层叫什么?

  • C++常用数学函数

    C 43 43 中有个头文件math h xff0c 它是数学函数库 一些数学计算的公式的具体实现是放在math h里 xff0c 为了方便大家使用 xff0c 特在此总结常用的一些函数 1 三角函数 double sin double d
  • LimeSDR实验教程(6) 发射GPS

    下载程序 xff1a git clone https github com osqzss gps sdr sim git 编译安装 xff1a cd gps sdr sim gcc gpssim c lm O3 o gps sdr sim
  • 如何理解引用作为函数的返回值?

    如何理解引用作为函数的返回值 xff1f 1 引用作为函数的返回值时 xff0c 必须在定义函数时在函数名前将 amp 2 用引用作函数的返回值的最大的好处是在内存中不产生返回值的副本 span class token comment 代码
  • 自制合成孔径雷达(2) SDR实现的对比(SDR实现测速雷达)

    我今天查了查资料 xff1a 技术干货 xff1a 用LimeSDR Mini制作一台软件定义多普勒雷达 搜狐汽车 搜狐网 查阅一些文献后 xff0c 笔者想探寻减少雷达系统所需的昂贵模拟前端部件数量的可能性 设计灵感来自于Gregory
  • 自制合成孔径雷达(3) doppler代码解读

    上一篇帖子 xff0c 看完了基于SDR的多普勒雷达 xff0c 就可以看看硬件雷达的多普勒测速的DSP代码了 先看一下这个图 xff1a 我们需要的多普勒频移的测量结果是从混频器 xff08 Multiply Conjugate xff0
  • 各类SDR的USB接口一致性测试

    最近用高带宽示波器测了好几个SDR产品的USB2接口一致性 由于探头数量只有1个 xff0c 所以不能测全所有的项目 但已经包含了最主要的USB眼图 xff08 信号质量 xff09 项目 测试场景 xff1a 待测件包含 xff1a 1
  • Portapack应用开发教程(十八)NavTex接收 D

    上回说到 xff0c 我现在已经做到用自己的gnuradio流图从音频信号做fsk解调 xff0c 得到方波 然后用c程序把方波转为二进制数 又用python把二进制数转为最终的字母 但是遗留问题是python解码 xff0c 起始位如果错