Forum: GNU Radio How to use tune function?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ujala Q. (Guest)
on 2009-06-01 14:15
(Received via mailing list)
The code I am basically using for capturing samples is this:
http://gnuradio.org/trac/wiki/UsrpFAQ/CppInterface

As my code is completely based on C++, I can't use usrp.tune(self.u, 0,
self.subdev,106.2e6), instead can I use the following method from
usrp_standard:

bool usrp_standard_rx::tune(int chan, db_base_sptr db, double
target_freq,
usrp_tune_result *result)

in this manner:

// Set DDC center frequency
   urx->set_rx_freq (0, center_freq);
//What should be my center_freq here?

//Set Tuning Frequency
urx->tune(0, db, 106.2e6, result)

// How should I pass the value of db and result?

 // Set Number of channels
   urx->set_nchannels(1);

 // Set ADC PGA gain
   urx->set_pga(0,gain);

 // Set FPGA Mux
   urx->set_mux(0x32103210); // Board A only

 // Set DDC decimation rate
   urx->set_decim_rate(decim);

 // Set DDC phase
   urx->set_ddc_phase(0,0);
Kutik (Guest)
on 2009-06-01 15:57
(Received via mailing list)
I use following code to tune db A, subdevice 0 :

    usrp_tune_result result;
    int site = 0; // site A

    db_base_sptr dbsrx = urx->db(site)[0];
    urx->tune(0, dbsrx, freq, &result);

Where freq is your desired center frequency.

To check the applied configuration you can use:

printf("baseband_freq: %f, ddc_freq: %f, residual_freq: %f\n",
result.baseband_freq, result.dxc_freq, result.residual_freq);



ujala wrote:
>
>
>    urx->set_decim_rate(decim);
>
>  // Set DDC phase
>    urx->set_ddc_phase(0,0);
>
> _______________________________________________
> Discuss-gnuradio mailing list
> removed_email_address@domain.invalid
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>

--
View this message in context:
http://www.nabble.com/How-to-use-tune-function--tp...
Sent from the GnuRadio mailing list archive at Nabble.com.
This topic is locked and can not be replied to.