Beispiel #1
0
ModemQAM::ModemQAM() {
    demodQAM4 = modem_create(LIQUID_MODEM_QAM4);
    demodQAM8 = modem_create(LIQUID_MODEM_QAM8);
    demodQAM16 = modem_create(LIQUID_MODEM_QAM16);
    demodQAM32 = modem_create(LIQUID_MODEM_QAM32);
    demodQAM64 = modem_create(LIQUID_MODEM_QAM64);
    demodQAM128 = modem_create(LIQUID_MODEM_QAM128);
    demodQAM256 = modem_create(LIQUID_MODEM_QAM256);
    demodulatorCons.store(4);
    currentDemodCons.store(0);
    updateDemodulatorCons(4);
}
Beispiel #2
0
void ModemDigital::digitalStart(ModemKitDigital *kit, modem mod, ModemIQData *input) {
    int bufSize = input->data.size();
    
    if (demodOutputDataDigital.size() != bufSize) {
        if (demodOutputDataDigital.capacity() < bufSize) {
            demodOutputDataDigital.reserve(bufSize);
        }
        demodOutputDataDigital.resize(bufSize);
    }
    
    if (demodulatorCons.load() != currentDemodCons.load()) {
        updateDemodulatorCons(demodulatorCons.load());
        currentDemodLock.store(false);
    }
}
Beispiel #3
0
void ModemQAM::updateDemodulatorCons(int cons) {
    if (currentDemodCons.load() != cons) {
        currentDemodCons = cons;

        switch (demodulatorCons.load()) {
        case 2:
            demodQAM = demodQAM4;
            updateDemodulatorCons(4);
            break;
        case 4:
            demodQAM = demodQAM4;
            updateDemodulatorCons(4);
            break;
        case 8:
            demodQAM = demodQAM8;
            updateDemodulatorCons(8);
            break;
        case 16:
            demodQAM = demodQAM16;
            updateDemodulatorCons(16);
            break;
        case 32:
            demodQAM = demodQAM32;
            updateDemodulatorCons(32);
            break;
        case 64:
            demodQAM = demodQAM64;
            updateDemodulatorCons(64);
            break;
        case 128:
            demodQAM = demodQAM128;
            updateDemodulatorCons(128);
            break;
        case 256:
            demodQAM = demodQAM256;
            updateDemodulatorCons(256);
            break;
        default:
            demodQAM = demodQAM4;
            break;
        }
    }
}
Beispiel #4
0
void ModemASK::writeSetting(std::string setting, std::string value) {
    if (setting == "cons") {
        int newCons = std::stoi(value);
        updateDemodulatorCons(newCons);
    }
}