Skip to content

IQ gain/phase balancing #40

Description

@ka9q

Using the Fobos with my ka9q-radio SDR at a 25 MHz sample rate, I see that the callback thread takes almost as much CPU time as my forward FFT. That's a lot! So I've added a raw mode to libusb that gives me the integer samples directly from the USB interface without passing through fobos_rx_convert_samples(). I've also written a new AVX2 input routine for my own code to use this mode. CPU consumption in the input thread has dropped to about 1/4 of what it was, a very substantial improvement. Much of the improvement is coming from my doing my own conversion from integer to floating point, avoiding the extra trip through memory taken by fobos_rx_convert_samples for the floating point samples it creates. At 50 Ms/s, that's 400 MB/s of writes and 400 MB/s of reads that can be avoided. I will submit a PR for libfobos when I am done. It does not disturb the existing interface; it simply adds functions to read raw data.

I noticed while looking at fobos_rx_convert_samples() that it estimates and removes DC from the samples and also balances the gain of the I and Q channels, but it does not correct for phase imbalance. This is also necessary to maximize image rejection. My own user code will do this. I'm not going to add it to libfobos because it could not be used in raw mode, but you would be free to borrow from it as you like.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions