function dspInput = loadDspInputFromRunId(run_id, database, options) %LOADDSPINPUTFROMRUNID Query run metadata and prepare canonical DSP input. arguments run_id database options struct end dataTable = queryRunid(run_id, database); % Load signal files referenced by the run metadata, verify/synchronize the % received signal, optionally cache the sync result, and cap occurrences. [Tx_bits, Symbols, Scpe_cell, found_sync] = loadAndSyncRunSignals(dataTable, options); dspInput = struct(); dspInput.run_id = run_id; dspInput.dataTable = dataTable; dspInput.Tx_bits = Tx_bits; dspInput.Symbols = Symbols; dspInput.Scpe_cell = Scpe_cell; dspInput.found_sync = found_sync; dspInput.fsym = dataTable.symbolrate; dspInput.M = double(dataTable.pam_level); dspInput.duob_mode = parseDbMode(dataTable.db_mode); end function mode = parseDbMode(rawMode) if isnumeric(rawMode) mode = db_mode(rawMode); return end if iscell(rawMode) rawMode = rawMode{1}; end mode = db_mode(strrep(string(rawMode), '"', '')); end