Hi there and thank you for moving this discussion to the forums!
In order to better understand your problem and make it clear for other readers who might be able to offer advice, let me start by summarizing your problem scope, as you previously described it.
- Transmitting and receiving using an antenna. A loopback mode is not used.
- Transmitting stream of (I = 800, Q= 800) in decimal, using antenna, I don't use loopback mode,
- Receiving (I = -790 and Q= - 680)
Code: Select all
bladeRF> rx config file=receive.csv format=csv n=10M
bladeRF> tx config file=transmit.csv format=csv repeat=10
bladeRF> tx start
Converted CSV to SC16 Q11 file and switched to converted file.
bladeRF> rx start
bladeRF> rx
State: Idle
Last error: None
File: receive.csv
File format: SC16 Q11, CSV
# Samples: 10485760
# Buffers: 32
# Samples per buffer: 32768
# Transfers: 16
Timeout (ms): 1000
bladeRF> tx
State: Running
Last error: None
File: bladeRF_samples_from_csv.bin
File format: SC16 Q11, Binary
Repetitions: 10
Repetition delay: none
# Buffers: 32
# Samples per buffer: 32768
# Transfers: 16
Timeout (ms): 1000
(2) Problem and Expectations
Am I correct in understanding that you are expecting to receive a constant stream of (I=800, Q=800) when you transmit a constant stream (I=800, Q=800)? If I am not understanding you correctly, I apologize and please skip to the next section. Otherwise, we need to discuss a concepts to adjust your expectations in light of the non-idealities of the real world. (I also apologize if this information is very below you. I figure I'll start from some basics so I can link people to this in the future.)
First, note that your digital values are being driven through a digital-to-analog converter (DAC) and then a number of analog stages. (See Figure 1 in the
LMS6002D data sheet). Specifically:
- Your digital values of (I=800, Q=800) are first driven into separate I and Q DACs
- Each path (I and Q) passes through a Low Pass Filter (LPF)
- Gain is applied ot the LPF outputs are then via TXVGA1
- Some DC offset correction can be applied via some DACs here
- The signal is then driven into the mixer
- Additional gain is applied via the TXVGA2 PAs
Take a look at the RX path - you'll see similarities in the sense that it is doing the "reverse."
Along each stage, there's room for non-idealities to creep in. Below are the two items you noted, which we can apply some corrections for. However, we can never quite get these to be "perfect."
- The signal's zero crossing might be shifted to an undesirable degree by some DC bias ("DC offset")
- Because the I and Q channels are separate their amplitudes might deviate as we apply gain ("IQ imbalance")
One of the neat features about the LMS6002D is that we can place it into some different loopback configurations, ruling out the contributions of various blocks. This is very handy for debug and development!
Once you start transmitting to and receiving from antennas on the SMA connectors, you bring in another level of "the real world isn't ideal." The wireless spectrum is a messy place when we consider interference, noise, channel fading, multipath, etc.
Additionally, in the use case you described, our RX and TX are very likely not going to be perfectly synchronized; we can't expect to be phase-aligned. If you're transmitting just a tone/vector, you can't expect to see that vector at the exact same phase. Fortunately, there's a plethora of techniques covered in DSP texts and papers regarding synchronization!
I would try starting with a loopback mode and transmitting (I=sin(2*pi*f*t), Q) and then plotting the received signal.
(3) Request for additional information
Could you share your transmitted and your received files? Putting them in to a .tar.gz or .zip and uploading them to dropbox.com is probably a good idea, since I expect the files to be a little large.
Alternatively, perhaps you could use MATLAB, Octave, GNU Plot, Python, etc. to create and share some plots of I,Q over time for what you are transmitting and what you expect to see?
Best regards,
Jon