On Sun, May 9, 2010 at 11:28 PM, zzw.1012 <[email protected]> wrote: > Hi, > I'm studying benchmark_tx.py now. I find that the packet size is not > right (at least I'd like to think so) in the process of making packet, which > can be seen in pkt.py and packet_utils.py. In the packet consist of 2 bytes > packed_preamble, 8 bytes packed_access_code, 4 bytes header, 4 bytes > outband_crc with default 1500 bytes size, padding bytes and endbyte"\x55" . > I use default gmsk modulatiom. So, the packet have 2 + 8 + 4 + 1504 + 1 + 1 > = 1520bytes. > However, in the function of _npadding_bytes(pkt_bytes_len, > samples_per_symbol, bits_per_symbol) , there have such description: > "generate sufficient padding such that each packet ultimately ends up being > a multiple of 512 bytes when sent across the USB, we send 4-byte samples > across the USB (16-bit I and 16-bit Q), thus we want to pad so that after > modulation the resulting packet is a multiple of 128 samples". Also , in the > function "int usrp_basic_tx::write(const void *buf, int len, bool > *underrun)"in the usrp_basic.cc, there have similar code like "if (len < 0 > || (len % 512) != 0){fprintf(stderr, "usrp_basic_tx::write: invalid length > = %d\n", len}". > they both tell me that the data across the USB must be a multiple of 512 > bytes .but in the example of benchmark_tx.py, the packet size is 1520 > bytes. what's wrong ?
1520 bytes only refers to the packet size. The transmitted sample stream at the physical layer includes a number of other factors including conversion to bits, samples per symbol, and sample size. So for the default case, a 1520 byte packet using 4 samples per symbol yields 48640 samples or 194560 bytes, which is a multiple of 512. Thomas _______________________________________________ Discuss-gnuradio mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
