Hi everyone,
As I was trying to tune usrp from my python thread, I am not able to
use
my thread to tune the USRP. I am trying to tune using my python
function,
def tune_usrp(ms,freq):
print "Tuning to frequency : "+str(freq)
ms.tune_freq(freq)
where my “ms” is an object of a class which is use to connect the graph
between usrp [source ] and file [sink].
and in the class for the object “ms”, i am using the tune_freq() to tune
the
usrp.
unfortunately, i am wrestling with my code for the past 5 days. Can
anyone
help me in guiding me in locating my
problem cause…
and in the class for the object “ms”, i am using the tune_freq() to tune
the usrp.
unfortunately, i am wrestling with my code for the past 5 days. Can anyone
help me in guiding me in locating my
problem cause…
Thanks in advance.
If anybody was able to guess what your problem was based on the paltry 3
lines of code you posted, I would be amazed. How about posting more
info,
like what ms.tune_freq does, and what the error message is?
explaination of my problem…
line = proc.stdout.readline()
the subprocess runs a command in “cmd” variable using pipe. pythonProg1
problem …
Thanks.
samp_rate = 125e3 #or something low, match with decimation rate
tt.join()
print('tuner thread exited')
if name == ‘main’:
main()
Ok, so there is no problem with tuning (initially you said “i am not
able to
use my thread to tune the usrp”).
Instead, you have a problem with timing/synchronization. I don’t know if
you
will ever be able to achieve the perfect timing you are looking
for…after
you issue a tune command, there will always be some number of samples
that
come out of the USRP at the old frequency (due to buffering) followed by
some number of samples (~200us worth) during which the LO is unstable
(locking to new frequency), followed by samples at new frequency. The
best
you can do is to try to keep the FIFO as empty as possible to minimize
the
lag, and try to calibrate out the remaining lag as best as possible, and
throw away samples in the uncertain period. Otherwise, you can stop the
flowgraph when your condition is met, let the remaining samples flush
out,
issue the tune, wait a little bit, then restart the flowgraph.
Also, don’t forget to keep addressing replies to the mailing list, so
others
have a chance to help you (I am not a guru by any stretch of the
imagination).
-Steven
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.