Bishal Thapa wrote:
Q.1. TX side: I simply want to take a packet and XOR each bit of the packet with a PN-code (hint: final goal will be to implement a DSSS). Could you please hint me some pointers as to where catch the packet before it gets modulated so that I can XOR it with my code? I read and re-read benchmark_tx.py code and tried to trace the function send_pkt(). But I couldn?t do a good job at it. Please give me some pointers. PS: My modulation choice will be DBPSK.
If your packets have an outside source, one of the easiest ways to get them in to a GnuRadio stream is by using the tun/tap device. Tun/tap is a pseudo ethernet device driver. On side of it talks to the OS's network stack, while the other side connects to an application program instead of to actual ethernet hardware. This gives you direct access to packet data at one of two levels. The Tap device gives you the entire raw ethernet frame, while the Tun device simply gives you the ethernet frame's payload. I used a Tun device in the GMSK Spacecraft Groundstation code that is in CGRAN. Look at the hdlc router block code. Once you have the packets read into a GnuRadio stream, it's easiest (though maybe not most efficient) to handle the bit-level processing in an unpacked stream of bytes with one bit per byte. There's a standard block to do the unpacking. As far as DSSS goes, I've done some GnuRadio work with that as well, but it's not complete. As you note, the basic operation centers around XORing the bitstream with a pseudorandom sequence. Typically this sequence runs at many times the clock rate of of the data. This is called the "chip" rate. So, the data must be upsampled to the chip rate before it can be XORed. In the world of streams of digitized analog data, this upsampling is typically done by inserting extra 0's into the bitstream and following with a low-pass filter to remove the introduced high frequency components. But since we're working with digital data directly, it's much more computationally efficient to simply replicate the input bit the appropriate number of times onto the output. The code for a block that does this also appears in the GMSK Spacacraft Groundstation project, although it is being used for other purposes than DSSS. It's called digital_upsampler. @(^.^)@ Ed _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio