Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect I/Q calibration with LMS_Calibrate #327

Open
maxspb89 opened this issue Nov 20, 2020 · 0 comments
Open

Incorrect I/Q calibration with LMS_Calibrate #327

maxspb89 opened this issue Nov 20, 2020 · 0 comments
Assignees

Comments

@maxspb89
Copy link

maxspb89 commented Nov 20, 2020

I'm doing calibration upon initializing LimeSDR receiver and upon changing the sampling rate.

if(_antenna == LMS_PATH_LNAL){
        // LNAL matching workaround
        if(LMS_SetLOFrequency(_device, LMS_CH_RX, _chan, 200e6))
            result = false;
        else if(LMS_Calibrate(_device, LMS_CH_RX, _chan, bandwidth, 0))
            result = false;
        else if (LMS_SetLOFrequency(_device, LMS_CH_RX, _chan, _freq))
            result = false;
}
    else if(_freq >= 31e6){
        // Normal calibration
        if(LMS_Calibrate(_device, LMS_CH_RX, _chan, bandwidth, 0))
            result = false;
    }
    else{
        // Lower than 31 MHz center frequency workaround
        if(LMS_SetLOFrequency(_device, LMS_CH_RX, _chan, 50e6))
            result = false;
        else if(LMS_Calibrate(_device, LMS_CH_RX, _chan, bandwidth, 0))
            result = false;
        else if (LMS_SetLOFrequency(_device, LMS_CH_RX, _chan, _freq))
                result = false;
    }

This is the way, provided with the basic LimeSuite API. But it fails to compensate I/Q value, so resulting spectrum looks nasty.
I've tried to calibrate I/Q with LimeSuiteGUI, and it worked fine. So I have to use:

LMS7002M* lms = ((LMS7_Device*)_device)->GetLMS();
    if(lms->CalibrateRx(_sampRate)){
        state(LimeSdrDeviceState::Error);
        return false;
    }

Please fix this problem with API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants