IQ transmission fails

Discussions related to embedded firmware, driver, and user mode application software development
Post Reply
lni_teamB_proj
Posts: 5
Joined: Mon Sep 21, 2015 10:29 pm

IQ transmission fails

Post by lni_teamB_proj »

I use Nuand BladeRF kit to transmit and receive data at 2.4GHz frequency, I followed the instructions on the official website of Github/Nuand.
https://github.com/Nuand/bladeRF/wiki/G ... -Operation
Firstly I transmitted a csv file, at the same time, I received that file with the same bladeRF and saved it back to a csv file. I found that the data I received were so different from the data I transmitted, the I and Q values were distorted and imbalance. Although I have calibrated LMS, IQ balancing and DC offset. But thing didn't get better. Do you have any idea how to fix this ?
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: IQ transmission fails

Post by jynik »

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
fdavies
Posts: 15
Joined: Wed Jul 15, 2015 6:52 pm

Re: IQ transmission fails

Post by fdavies »

I had problems transmitting and receiving at the same frequency. For instance if I set the transmit frequency and receive frequency both to 800MHz, and transmit a file containing a frequency sweep, the received file sometimes had irregularities. See post (https://nuand.com/forums/viewtopic.php?f=4&t=3757) for details.

Following bpadalino's suggestions, I tried transmitting and receiving at different frequencies. For instance, if you wish to transmit a sinewave at 800MHz, transmit a file with a +2.5MHz sinewave at 797.5MHz, and use a receive frequency of 802.5MHz. You will receive a -2.5MHz sinewave that is reliably clean and strong. I have been very successful with this approach.

Note that the received file will not be exactly the same as the transmitted file, since the frequencies will be switched around. If you are transmitting data with some modulation scheme, you will have to take this into account.

Good luck.
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: IQ transmission fails

Post by jynik »

fdavies,

Excellent point -- I definitely overlooked that in the problem scope. Just wanted to link to the associated discussion about this on the Lime Microsystems Google group.
lni_teamB_proj
Posts: 5
Joined: Mon Sep 21, 2015 10:29 pm

Re: IQ transmission fails

Post by lni_teamB_proj »

Hi jynik,
You were right, I started transferring I,Q samples with loopback mode, the result is surprisingly good. But then I used antena at 2.4GHz, the samples I received are distorted again.
Here are my samples:
https://www.dropbox.com/s/tswsaagpytho5 ... ar.gz?dl=0
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: IQ transmission fails

Post by jynik »

I'm guessing the loopback samples are from one of the baseband loop modes, correct? My guess is you'll see the same thing if you look repeat the process a few times using of the the internal RF loopback modes.

I would say the advice fdavies gave should apply here - the weird disturbances you see are a result of having the RX and TX PLLs interfering with one another while tuned to the exact same frequency. Try what he suggested - tune RX to a frequency F and TX to F+2.5MHz. Then in software you can mix your RX samples down to baseband.

As to why the I or Q is negated -- this is completely expected and normal. That's just the fact that your RX side isn't sync'd to some particular phase. In many receiver designs, you'd rotate your vector/constellations/etc to have it phase aligned properly.
lni_teamB_proj
Posts: 5
Joined: Mon Sep 21, 2015 10:29 pm

Re: IQ transmission fails

Post by lni_teamB_proj »

jynik wrote:As to why the I or Q is negated -- this is completely expected and normal. That's just the fact that your RX side isn't sync'd to some particular phase. In many receiver designs, you'd rotate your vector/constellations/etc to have it phase aligned properly.
Hi jynik,
Could you please tell me the process to fix the phase mismatch?
I see that the FPGA has IQ correction modules, but how I can control them?
Please provide me the detail steps to work around this issue.
Thank you,
-Ini
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: IQ transmission fails

Post by jynik »

Hi ini,

What you're referring to isn't an IQ imbalance, so the IQ correction isn't relevant here.

It also isn't a failure or an issue with the device, so to speak. Rather, this boils down to a synchronization problem that's commonplace in signal processing:
  • There are separate RX and TX mixers in the system. They are not synchronized, and thus not phase-aligned.
  • The sampling clocks of the RX ADC and TX DAC are not synchronized.
Consider two separate systems communicating wirelessly. It is nearly impossible that they power up to be perfectly synchronized. Thus, there's a large body of literature on techniques for synchronizing systems. As you'll see at the end of these slides and this thread in the GNU Radio mailing list, the Fred Haris paper, "Let's Assume the System is Synchronized," is commonly referenced.

As far as using a single device in loopback, I am not aware of any quick means of synchronizing the aforementioned components in the LMS6002D. Perhaps it's worth taking a step back and describing what the goal of your efforts, such that folks may be able to offer some thoughts and guidance?

Does this make sense, or am I misunderstanding your questions?

- Jon
Post Reply