{"id":503,"date":"2011-02-03T21:30:20","date_gmt":"2011-02-04T03:30:20","guid":{"rendered":"http:\/\/www.gergltd.com\/home\/?p=503"},"modified":"2011-02-17T15:35:01","modified_gmt":"2011-02-17T21:35:01","slug":"simple-uhd-transceiver-class","status":"publish","type":"post","link":"https:\/\/www.gergltd.com\/home\/simple-uhd-transceiver-class\/","title":{"rendered":"Simple UHD Transceiver Class"},"content":{"rendered":"<p style=\"text-align: justify;\">I wrote a simple transceiver class for the USRP1 (GNURadio) using the new UHD interface.<\/p>\n<p style=\"text-align: justify;\">The class allows you to send and receive data. \u00a0What you fill in for the data is up to you. \u00a0Currently, the class performs simple energy detection (sends a 100 sample burst with constant envelope) and works when you hook the RX up to the TX on the Basic RX\/TX boards (make sure you have proper\u00a0attenuation\u00a0as to not break the daughterboards). \u00a0But, with some simple modification, you can have it do more sophisticated processing.<\/p>\n<p style=\"text-align: justify;\">The class creates two queues and three threads.<\/p>\n<p style=\"text-align: justify;\">One queue is the TX queue and the other the RX queue.\u00a0The TX queue is a vector of pointers to complex float vectors (variable length) and are waveforms to be transmitted.\u00a0The RX queue is a vector of pointers to complex float vectors (const size) and are the data blocks received from the radio.<\/p>\n<p style=\"text-align: justify;\">The three threads are the TX thread, the RX thread, and the processing thread.<\/p>\n<p style=\"text-align: justify;\">The TX thread wakes up every 100ms and looks at the TX queue and sends any waveforms that are present. \u00a0The RX thread runs\u00a0continuously\u00a0and receives datablocks from the radio. The processing thread checks the RX queue and processes any blocks that are present on it. \u00a0Having an RX queue, RX thread, and processing thread allows the software to\u00a0continually\u00a0receive data without dropping packets and leaves the choice up to the software as to which packets to process. \u00a0For example, if the processing thread runs slower than the samples coming in (slower than real time), it may choose to intelligently process the remaining blocks instead of dropping data on the floor. \u00a0This would allow the processing thread to &#8220;catch up.&#8221;<\/p>\n<p style=\"text-align: justify;\">The TX thread can be modified as to send the waveforms out\u00a0immediately instead of on a queue for servicing.<\/p>\n<p style=\"text-align: justify;\">I hope all this makes sense.<\/p>\n<p style=\"text-align: justify;\">The code can be downloaded <a href=\"http:\/\/www.gergltd.com\/home\/wp-content\/uploads\/2011\/02\/UHD-Simple-Transceiver.zip\">here<\/a>. \u00a0I used this to compile:<\/p>\n<pre style=\"text-align: justify;\">g++ main.cpp SimpleTransceiver.cpp -lboost_thread -luhd -I\/opt\/uhd\/include -L\/opt\/uhd\/lib<\/pre>\n<p style=\"text-align: justify;\">Bugs,\u00a0questions, comments welcomed.<\/p>\n<p style=\"text-align: justify;\">Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wrote a simple transceiver class for the USRP1 (GNURadio) using the new UHD interface. The class allows you to send and receive data. \u00a0What you fill in for the data is up to you. \u00a0Currently, the class performs simple energy detection (sends a 100 sample burst with constant envelope) and works when you hook [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[47,56,48],"class_list":["post-503","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-gnu-radio","tag-uhd","tag-usrp"],"_links":{"self":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts\/503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/comments?post=503"}],"version-history":[{"count":3,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts\/503\/revisions"}],"predecessor-version":[{"id":508,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts\/503\/revisions\/508"}],"wp:attachment":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/media?parent=503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/categories?post=503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/tags?post=503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}