[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r11435 - gnuradio/branches/developers/eb/vrt/gr-vrt/sr
From: |
jblum |
Subject: |
[Commit-gnuradio] r11435 - gnuradio/branches/developers/eb/vrt/gr-vrt/src |
Date: |
Tue, 14 Jul 2009 18:59:19 -0600 (MDT) |
Author: jblum
Date: 2009-07-14 18:59:19 -0600 (Tue, 14 Jul 2009)
New Revision: 11435
Modified:
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt.i
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.h
Log:
method to set iq imbalance taps
Modified: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt.i
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt.i 2009-07-14
23:27:46 UTC (rev 11434)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt.i 2009-07-15
00:59:19 UTC (rev 11435)
@@ -54,48 +54,10 @@
~vrt_source_32fc();
};
-%include <vrt/quadradio.h>
-
// ----------------------------------------------------------------
GR_SWIG_BLOCK_MAGIC(vrt,quadradio_source_32fc)
-vrt_quadradio_source_32fc_sptr
-vrt_make_quadradio_source_32fc(const std::string &ip,
- size_t rx_bufsize = 0,
- size_t samples_per_pkt = 0)
- throw (std::runtime_error);
+%include "vrt_quadradio_source_32fc.h"
-class vrt_quadradio_source_32fc : public vrt_source_32fc
-{
-protected:
- vrt_quadradio_source_32fc();
-
-public:
- ~vrt_quadradio_source_32fc();
-
- bool write_dboard_pins(int v);
-
- bool set_center_freq(double target_freq);
-
- bool set_band_select(const std::string &band);
-
- void set_10dB_atten(bool on);
-
- bool select_rx_antenna(const std::string &ant);
-
- bool set_attenuation(int attenuation);
-
- void set_adc_gain(bool on);
- void set_dc_offset_comp(bool on);
- void set_digital_gain(float gain);
- void set_test_signal(int type);
-
- bool set_setting_reg(int regno, int value);
- bool set_hsadc_conf(int which_dboard, int regno, int value);
- bool set_lsdac(int which_dboard, int which_dac, int value);
- bool set_mem32(int addr, int value);
-
-};
-
-
+%include <vrt/quadradio.h>
Modified:
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.cc
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.cc
2009-07-14 23:27:46 UTC (rev 11434)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.cc
2009-07-15 00:59:19 UTC (rev 11435)
@@ -151,3 +151,29 @@
{
return d_qr->set_mem32(addr, value);
}
+
+/*--------------------------------------------------------------------*/
+#define IQ_IMBAL_NUM_TAPS 30
+#define IQ_IMBAL_REG_NO 162
+
+//helper function to set the iq imbalance register with a tap
+static int get_iq_imbal_reg(bool real, int index, float tap){
+ int val = static_cast<int>(round(tap));
+ val &= 0x1fff; //lower 25 bits for tap
+ val |= (real?0:1) << 30; //30th bit for filter type
+ val |= (index?0:1) << 31; //31st bit for initialization
+ return val;
+}
+
+void
+vrt_quadradio_source_32fc::set_iq_imbal_taps(const std::vector<gr_complex>
taps){
+ int i = 0;
+ /* set the real part of the taps */
+ for (i = 0; i < IQ_IMBAL_NUM_TAPS; i++){
+ set_setting_reg(IQ_IMBAL_REG_NO, get_iq_imbal_reg(true, i,
taps[i].real()));
+ }
+ /* set the imaginary part of the taps */
+ for (i = 0; i < IQ_IMBAL_NUM_TAPS; i++){
+ set_setting_reg(IQ_IMBAL_REG_NO, get_iq_imbal_reg(false, i,
taps[i].imag()));
+ }
+}
Modified:
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.h
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.h
2009-07-14 23:27:46 UTC (rev 11434)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.h
2009-07-15 00:59:19 UTC (rev 11435)
@@ -94,6 +94,8 @@
*/
bool set_attenuation(int attenuation);
+ void set_iq_imbal_taps(const std::vector<gr_complex> taps);
+
void set_adc_gain(bool on);
void set_dc_offset_comp(bool on);
void set_digital_gain(float gain);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r11435 - gnuradio/branches/developers/eb/vrt/gr-vrt/src,
jblum <=