On 07/10/2018 04:18 PM, Mike Gilmer wrote:
> I've had no problem implementing several command line options using
> GNU Radio's parameters blocks. I can set sample rate, bandwidth,
> center frequency successfully.
>
> My command line looks like this:
>
> python E310_GP.py --samprate 200000 --ctrfrq 915000000 ...
>
> However, I wanted to also set the "master clock rate" or whatever it's
> called. After significant googling and hacking I found the term I
> wanted was apparently "clock_rate" .
>
> I added a parameter block (like I had for sample rate, etc.,
> previously) and generated a grc (and .py) but had several key errors.
>
> 1) It listed clock-rate (not clock_rate) in the def
> argument_parser(): part of the script :
>
> parser.add_option(
> "", "--clock-rate", dest="clock_rate", type="eng_float",
> default=eng_notation.num_to_str(32000000.0),
> help="Set clock_rate [default=%default]")
>
> ( I have not used a dash anywhere in my grc that I can tell )
>
> 2) The .py was missing the call to the *set* function which I had to
> add manually. As such
>
> self.uhd_usrp_source_0.set_clock_rate(clock_rate)
>
> It seems to work properly. I get indications during start up that the
> E310 is selecting the clock_rate per my settings, and it's also not
> throwing any decimation error when I deliberately mismanage the
> clock-sample rate ratio.
>
> So, does anyone see a problem with what I've done or how?
> Is there a doc with these settings spelled out? I recall digging hard
> even for samp_rate and center_freq.
>
> Thanks!
>
> Mike
>
Actually, normally, the master_clock_rate is set in a device argument:
https://files.ettus.com/manual/page_configuration.html
Although gr-uhd exposes a set_clock_rate() method, GRC doesn't
necessarily make use of that.
The UHD USRP source block, at least in GRC, already includes Sample Rate
and Tuning parameters, so I'm not sure where the
"digging hard" would be, and the documentation for g-uhd, if you're
not using GRC, is relatively easy to find:
https://www.gnuradio.org/doc/doxygen/group__uhd__blk.html
There's nothing AT ALL special about the "samp_rate" variable, other
than many blocks, by default, use it. There's no *requirement* to
use that variable.
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
No comments:
Post a Comment