[Discuss-gnuradio] How to store recieved signal (time, voltage) in .txt format
Hey all, I want to store the signal I recieve from my USRP+XVR2450 in a text file, in 2 columns(1st clumn time and 2nd column I and Q voltage levels from USRP at each sampling time). So, how can I do this in the Python? I want to do this because I prefer to do the signal processing on the baseband signal in Mat Lab(by importing the txt file data) rather than defining a new signal processing block in python. Thanks Bruhtesfa ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] How to store recieved signal (time, voltage) in .txt format
So, how can I do this in the Python? I want to do this because I prefer to do the signal processing on the baseband signal in Mat Lab you can use gr.file_sink() to save your receive data. http://www.gnuradio.org/trac/wiki/Octave The directions are the same for Matlab. Jason ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] How to store recieved signal (time, voltage) in .txt format
Hey slimchao, Thanks for the reply! I tried gr.file_sink(). It writes something in a txt file, but when I open it it is not in readable format. Is there something that I can do to make it a readable .txt format for the MAt lab, where every sampled value is written as float value on a new line? Thanks! ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] JPEG Transmission via USRP
Hi, a tutorial for image transmission has been published on tools4sdr.com : http://www.tools4sdr.com/articles/transmission+of+an+image+from+1+USRP+connected+to+a+PC+running+matlab+and+windows+to+another+PC+running+matlab+and+windows_2229210 It supposes 2 USRP and 2 PCs, and the toolbox that interface the USRP with Matlab (which is available for download on tools4sdr.com). A video also shows the whole transmission here: http://www.youtube.com/watch?v=__uXHfvU-C4 you have to enable the subtitle to get the comment in French. Pierre -- View this message in context: http://www.nabble.com/JPEG-Transmission-via-USRP-tp20364308p20376189.html Sent from the GnuRadio mailing list archive at Nabble.com. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Could this output be a problem with myHardware or the python codes?
Hey Paul, Ya! you are correct, the isolation is a problem.But what is curious is when i operate the transmitter and reciever simultaneously,the signal level of the reciver decreases too much(cancels out) . If some of the signal from the transmitter antenna is also recived by the reciver antenna, I think the signal recived should increase in amplitude, because the frequency of the signals sent and recived are almost the same(except the small doppler shift). But, what occurs is the opposite. Bruhtesfa On Thu, Nov 6, 2008 at 4:14 PM, Paul Mathews [EMAIL PROTECTED] wrote: Are you aware that the isolation between the transmit and receive channels of USRP daughterboards is generally 40 dB? (This fact made it impossible for me to use the Transmit channels in my application.) It is quite challenging to have transmit and receive channels operating simultaneously, sharing a power supply, and without much shielding. I suppose we should be surprised that the isolation is as good as it is. As others have commented, the expectation is that your transmit and receive channels will be well separated, otherwise, crosstalk can overwhelm the receiver channels. Paul Mathews -Original Message- *From:* [EMAIL PROTECTED] [mailto: discuss-gnuradio-bounces+opto discuss-gnuradio-bounces%2Bopto= [EMAIL PROTECTED] *On Behalf Of *Bruhtesfa Ebrahim *Sent:* Thursday, November 06, 2008 2:14 AM *To:* Matt Ettus; discuss-gnuradio@gnu.org *Subject:* Re: [Discuss-gnuradio] Could this output be a problem with myHardware or the python codes? Hey, I have two XCVR2450 Trancievers.I have also two wire antennas connected to each. So,I have separate transmit and recieve paths, but I am using a single USRP. I am using the transmiter and reciever daughterboards at almost the same frequency. I am transmitting at 2.45GHz and I expect to recieve a reflected signal at a frequency of 2.45GHz + Doppler shift, so that I will detect the doppler shift. So, what do you think is the problem? Thanks 4 ur help ! Bruhtesfa On Mon, Nov 3, 2008 at 5:43 PM, Matt Ettus [EMAIL PROTECTED] wrote: Are you trying to simultaneously transmit and receive with the XCVR2450? Because it doesn't do that -- it does not do FDD. The RFX-series will work in full duplex mode, but you still need to put them on different frequencies. If you really need to do this with the XCVR2450, then you will need two of them. Matt Bruhtesfa Ebrahim wrote: Hey all, May be my question could be out of topic as it is can be a hardware problem, so excuses. The Thing isI am using USRP with XCVR2450 Tranciever to develop a doppler radar(in duplex mode). So, I was checking out my devices. When I use USRP_fft.py just to see the environment signals without enabling my USRP_siggen.py, I see a certain signal level. Then when i start to transmit and recieve in duplex mode running these two python codes simultaneously in different shell scripts; the signal(FFT) level I am recieving decreases too much. Normally, I should get a more strong recieved signal rather since I am transmitting. So, does anyone has experience in this stuff ? If so, what do you think is the problem? could it be a problem with my Trancievers. Thank you! Bruhtesfa ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Could this output be a problem with myHardware or the python codes?
On Fri, Nov 07, 2008 at 11:19:40AM +0100, Bruhtesfa Ebrahim wrote: Hey Paul, Ya! you are correct, the isolation is a problem.But what is curious is when i operate the transmitter and reciever simultaneously,the signal level of the reciver decreases too much(cancels out) . If some of the signal from the transmitter antenna is also recived by the reciver antenna, I think the signal recived should increase in amplitude, because the frequency of the signals sent and recived are almost the same(except the small doppler shift). But, what occurs is the opposite. Bruhtesfa You may be overdriving the input resulting in some kind of non-linear behavior. Have you plotted the received signal? Does it look like what you think you're sending? You say that you are trying to receive a doppler shifted echo. Given your physical setup (antennas, their pattern and their spacing, the distance to the object that you expect the signal to reflect from, its velocity and radar cross section), of the power received at the Rx antenna -- according to theory -- how much of the power will come directly from the Tx antenna, and how much will be reflected off of the moving object? Assume a free space model for simplicity. Eric ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] USRP2 AttributeError: 'usr p2_source_32fc_sptr' object has no attribute 'ad c_rate'¨
Hello, I tried to run usrp2_fft.py to test my USRP2 board and I got the following error. ¨AttributeError: 'usrp2_source_32fc_sptr' object has no attribute 'adc_rate'¨ ./find-usrps script is running fine with following result. 00:50:c2:85:30:0a hw_rev = 0x0300 My configuration is -Ubuntu 8.04, with the latest svn (7 days old) - I am using Netgear Gigabit switch to connect to fast Ethernet port on my laptop. I could not directly connect my Gigabit PCMCIA card to USRP2. Do you think this error is due to any configuration setting? Thank you, -C - ./usrp2_fft.py -f 400M Traceback (most recent call last): File ./usrp2_fft.py, line 267, in module main () File ./usrp2_fft.py, line 263, in main app = stdgui2.stdapp(app_top_block, USRP2 FFT, nstatus=1) File /usr/local/lib/python2.5/site-packages/gnuradio/wxgui/stdgui2.py, line 36, in __init__ wx.App.__init__ (self, redirect=False) File /usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py, line 7836, in __init__ self._BootstrapApp() File /usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py, line 7433, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File /usr/local/lib/python2.5/site-packages/gnuradio/wxgui/stdgui2.py, line 39, in OnInit frame = stdframe (self.top_block_maker, self.title, self._nstatus) File /usr/local/lib/python2.5/site-packages/gnuradio/wxgui/stdgui2.py, line 60, in __init__ self.panel = stdpanel (self, self, top_block_maker) File /usr/local/lib/python2.5/site-packages/gnuradio/wxgui/stdgui2.py, line 81, in __init__ self.top_block = top_block_maker (frame, self, vbox, sys.argv) File ./usrp2_fft.py, line 71, in __init__ input_rate = self.u.adc_rate() / self.u.decim() AttributeError: 'usrp2_source_32fc_sptr' object has no attribute 'adc_rate' -- ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
RE: [Discuss-gnuradio] USRP2 AttributeError: 'us rp2_source_32fc_sptr' object has no attribute 'adc_rate'¨
The usrp2_fft python code was recently changed to use that adc_rate() call, although the actual implementation returns the value to the input pointer parameter. Just change that line in usrp2_fft back to what it was so you can at least test it: From: input_rate = self.u.adc_rate() / self.u.decim() To: input_rate = 100e6/options.decim This simply a quick fix, I'm assuming the adc_rate function will be changed to return the value the same way as decim() does. --- Timothy R. Newman DNI Post Doctoral Fellow Wireless @ Virginia Tech 447 Durham Hall Blacksburg, VA 24061 Phone: 540-231-2041 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Catalin LACATUS Sent: Friday, November 07, 2008 10:35 AM To: discuss-gnuradio@gnu.org Subject: [Discuss-gnuradio] USRP2 AttributeError: 'usrp2_source_32fc_sptr' object has no attribute 'adc_rate'¨ Hello, I tried to run usrp2_fft.py to test my USRP2 board and I got the following error. ¨AttributeError: 'usrp2_source_32fc_sptr' object has no attribute 'adc_rate'¨ ./find-usrps script is running fine with following result. 00:50:c2:85:30:0a hw_rev = 0x0300 My configuration is -Ubuntu 8.04, with the latest svn (7 days old) - I am using Netgear Gigabit switch to connect to fast Ethernet port on my laptop. I could not directly connect my Gigabit PCMCIA card to USRP2. Do you think this error is due to any configuration setting? Thank you, -C - ./usrp2_fft.py -f 400M Traceback (most recent call last): File ./usrp2_fft.py, line 267, in module main () File ./usrp2_fft.py, line 263, in main app = stdgui2.stdapp(app_top_block, USRP2 FFT, nstatus=1) File /usr/local/lib/python2.5/site-packages/gnuradio/wxgui/stdgui2.py, line 36, in __init__ wx.App.__init__ (self, redirect=False) File /usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py, line 7836, in __init__ self._BootstrapApp() File /usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py, line 7433, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File /usr/local/lib/python2.5/site-packages/gnuradio/wxgui/stdgui2.py, line 39, in OnInit frame = stdframe (self.top_block_maker, self.title, self._nstatus) File /usr/local/lib/python2.5/site-packages/gnuradio/wxgui/stdgui2.py, line 60, in __init__ self.panel = stdpanel (self, self, top_block_maker) File /usr/local/lib/python2.5/site-packages/gnuradio/wxgui/stdgui2.py, line 81, in __init__ self.top_block = top_block_maker (frame, self, vbox, sys.argv) File ./usrp2_fft.py, line 71, in __init__ input_rate = self.u.adc_rate() / self.u.decim() AttributeError: 'usrp2_source_32fc_sptr' object has no attribute 'adc_rate' -- ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] Help: How to convert a *.mat file to binary file?
Hallo Everyone, I have generated some samples of a sinesoid from Matlab and want to convert it to a binary file and use it as a source signal to the LFTX daughterboard. Can you tell me how i do to convert it? Thanks a lot, Chao -- View this message in context: http://www.nabble.com/Help%3A-How-to-convert-a-*.mat-file-to-binary-file--tp20377742p20377742.html Sent from the GnuRadio mailing list archive at Nabble.com. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] How to store recieved signal (time, voltage) in .txt format
Bruhtesfa Ebrahim wrote: Hey all, I want to store the signal I recieve from my USRP+XVR2450 in a text file, in 2 columns(1st clumn time and 2nd column I and Q voltage levels from USRP at each sampling time). So, how can I do this in the Python? I want to do this because I prefer to do the signal processing on the baseband signal in Mat Lab(by importing the txt file data) rather than defining a new signal processing block in python. Thanks Bruhtesfa ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio Hi Bruhtesfa, you can use gr.file_sink() to save your receive data. Slimchao -- View this message in context: http://www.nabble.com/How-to-store-recieved-signal-%28time%2C-voltage%29-in-.txt-format-tp20378393p20378448.html Sent from the GnuRadio mailing list archive at Nabble.com. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] How to store recieved signal (time, voltage) in .txt format
On Fri, Nov 7, 2008 at 6:21 AM, Bruhtesfa Godana [EMAIL PROTECTED] wrote: Hey slimchao, Thanks for the reply! I tried gr.file_sink(). It writes something in a txt file, but when I open it it is not in readable format. Is there something that I can do to make it a readable .txt format for the MAt lab, where every sampled value is written as float value on a new line? Thanks! gr.file_sink() writes it as a binary file, not a txt file. You can use the programs found in gnuradio-core/src/utils/read_float_binary.m etc to read those files from matlab or octave where you can resave them in a format that you want. Karthik ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Help: How to convert a *.mat file to binary file?
On Fri, Nov 7, 2008 at 3:58 AM, Jorg Lotze [EMAIL PROTECTED] wrote: On Fri, 2008-11-07 at 02:06 -0800, slimchao wrote: Hallo Everyone, I have generated some samples of a sinesoid from Matlab and want to convert it to a binary file and use it as a source signal to the LFTX daughterboard. Can you tell me how i do to convert it? Thanks a lot, Chao Use the MATLAB functions fopen, fwrite, fclose to write your data in binary format to a file that can be read by gr.file_source. Choose 32bit floats for real data, write real,imag,real,imag,... for complex data. The MATLAB manual is your friend. ;) or you can use one of the programs in gnuradio-core/src/utils/write_float_binary.m etc Karthik ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Help: How to convert a *.mat file to binary file?
On Fri, 2008-11-07 at 02:06 -0800, slimchao wrote: Hallo Everyone, I have generated some samples of a sinesoid from Matlab and want to convert it to a binary file and use it as a source signal to the LFTX daughterboard. Can you tell me how i do to convert it? Thanks a lot, Chao Use the MATLAB functions fopen, fwrite, fclose to write your data in binary format to a file that can be read by gr.file_source. Choose 32bit floats for real data, write real,imag,real,imag,... for complex data. The MATLAB manual is your friend. ;) ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] gr.file_source problem
Piotr Swiatkiewicz wrote: Hi, I am trying to feed samples from a file to the LFTX daughter board. They were recorded using usrp_rx_cfile.py (from usrp.source_c). I cannot see any real signal from LFTX when I run my script, but fftsink2.fft_sink_c produces the correct spectrum when samples are fed from the same file. Am I correct in my assumption that if I can see the signal at the output when I try usrp_siggen.py (i.e. device works) then I should also be getting signal when I feed raw samples from gr.file_source (complex) to usrp.sink_c? Is there anything else to take care about except the usual settings (PGA, mux, etc.) and sampling frequency that should be same as it was during signal capture? Thanks, Peter ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio Hallo Peter, I have generated some samples of a sinesoid from Matlab and want to convert it to a binary file to the LFTX daughterboard. Can you tell me how i do to convert it? Thanks a lot, Chao -- View this message in context: http://www.nabble.com/gr.file_source-problem-tp14183927p20377514.html Sent from the GnuRadio mailing list archive at Nabble.com. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] usrp_server code
Hi, I am looking at the usrp_server code in the trunk and have the following question. Is there any difference between a tx/rx port and a channel? I see that the usrp_server is always initialized with N_PORTS=4 tx and N_PORTS=4 rx ports (total of 8 + one control port), but later on, we only work with d_nrx_chan = d_ntx_chan = 2 tx and rx channels. My understanding was that ports/channels are in one-to-one correspondence. So I thought that N_PORTS is the maximum number of ports/channels that the server can handle. In that case, I would expect that the parameters d_nrx_chan, d_ntx_chan are given to the constructor and used accordingly... The picture is more obscure considering that there is also a D_MAX_CHANNELS = 16 in the usrp_server.h file... What am I missing? Thanks Achilleas ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] usrp_server code
On Fri, Nov 07, 2008 at 01:53:11PM -0500, Achilleas Anastasopoulos wrote: Hi, I am looking at the usrp_server code in the trunk and have the following question. Is there any difference between a tx/rx port and a channel? I see that the usrp_server is always initialized with N_PORTS=4 tx and N_PORTS=4 rx ports (total of 8 + one control port), but later on, we only work with d_nrx_chan = d_ntx_chan = 2 tx and rx channels. My understanding was that ports/channels are in one-to-one correspondence. So I thought that N_PORTS is the maximum number of ports/channels that the server can handle. In that case, I would expect that the parameters d_nrx_chan, d_ntx_chan are given to the constructor and used accordingly... The picture is more obscure considering that there is also a D_MAX_CHANNELS = 16 in the usrp_server.h file... What am I missing? Thanks Achilleas The actual number of channels available depends on the fpga image loaded. I'm not sure how Geoerge is handling that, or whether he provides a method to query it. Eric ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] Use of bin_statistics
Working to understand sink block bin_statistics_f. Examining the User Manual, the sourcecode gr_bin_statistics_f.cc and related includes, and hacking qa_bin_statistics.py, this is my current understanding: 1. bin_statistics determines max values of vectors with length vlen over a number of samples dwell_delay after discarding tune_delay samples. 2. After processing N = dwell_delay samples, bin_statistics composes a message and inserts it in the message queue. 3. Each message from bin_statistics consists of a vector of max values, prefixed by the center frequency corresponding to the associated samples, i.e., it is just the frequency value delivered to bin_statistics with the input samples. I was hoping that bin_statistics would do more than the above, and perhaps I'm not yet understanding something. Any additional hints will be appreciated. In particular, I'd like to know the frequency of the highest peak in an FFT vector (see below). Unless I can find a better starting point, I intend to hack bin_statistics. I was also confused by some of the recent threads about usrp_spectrum_sense.py. In particular, there was the following advice from Firas Abbaz in this thread http://www.nabble.com/fft-realated-problems-td20308034.html#a20328754 -- Firas A. wrote: Hi, 1) use --tune-delay with 10e-3 -- Based on the above, I'd expect an integer tune delay parameter. Is 10e-3 just a way of specifying a value smaller than 1, so there's no tune delay? I actually need to do the following (I think) to implement a simple AFC: A. Find the highest peak in an FFT output vector. B. Compare highest peak freq to current tuning. If diff is significant, retune to new peak freq C. Allow settling time before looping If anyone is aware of existing code that would be a good starting point, please advise. Thanks. Paul Mathews Whidbey Island, WA ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Use of bin_statistics
Hi, Paul Mathews [EMAIL PROTECTED] wrote: use --tune-delay with 10e-3 Based on the above, I'd expect an integer tune delay parameter. Is 10e-3 just a way of specifying a value smaller than 1, so there's no tune delay? The tune delay timing parameter passed to bin_statistics is calculated in FFT frames which depends on USRP rate and FFT length as in : tune_delay_passed_to_bin_stats = int(round(required_tune_delay_in_sec*usrp_rate/fft_size)) if this calculated value is less than 1, then we should make it at least 1 FFT frame. For example: IF required_tune_delay_in_sec = 10e-3 and usrp_rate = 800 (decimation =8) and FFT size is 1024 THEN : tune_delay_passed_to_bin_stats = 78 (FFT Frames) This means we have to skip 78 incoming vectors (FFT frames) before we actually use the accuired samples in our spectrum statistics. Actually,I think the writer of the usrp_spectrum_sense.py code is genius and I consider it as the best given working example in the gnuradio project. Important Note: Beside tunning time depends on the hardware (RF syenthesizer speed), one should remameber that the time needed to collect 1024 samples with decimation rate=8 (minimum USRP decimation) is 128 usec while : Time needed to collect 1024 samples with decimation rate=256 (maximum USRP decimation) is 4.096 msec This means that the tune delay in the case of decimation rate =256 should be larger than that used for deimation = 8. A working tune delay value (which gives accurate results) can be known by experiments (for given decimation rate and FFT length). I Hope this clarify the mater. Regards, Firas ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio