Skip to content

Commit

Permalink
Fix gain and QPSK Demod
Browse files Browse the repository at this point in the history
  • Loading branch information
Aang23 committed Jul 20, 2021
1 parent 3507f1b commit fd33ff6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ satellites:
rrc_alpha: 0.6
rrc_taps: 31
costas_bw: 0.005
iq_invert: true
- norad: 25338 # NOAA 15
min_elevation: 10
priority: 1
Expand Down
2 changes: 1 addition & 1 deletion src/dsp/dsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DeviceDSP::DeviceDSP(int samplerate, int frequency, int gain) : d_samplerate(sam

setSamplerate(d_samplerate);
setFrequency(d_frequency);
setGain(49);
setGain(d_gain);
}

DeviceDSP::~DeviceDSP()
Expand Down
7 changes: 3 additions & 4 deletions src/dsp/modem/modem_qpsk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ ModemQPSK::ModemQPSK(int frequency, int samplerate, std::map<std::string, std::s
d_symbolrate(std::stoi(parameters["symbolrate"])),
d_rrc_alpha(std::stof(parameters["rrc_alpha"])),
d_rrc_taps(std::stoi(parameters["rrc_taps"])),
d_loop_bw(std::stof(parameters["costas_bw"])),
d_iq_invert(parameters.count("iq_invert") > 0 ? (parameters["iq_invert"] == "true") : false)
d_loop_bw(std::stof(parameters["costas_bw"]))
{
output_file = std::ofstream(d_parameters["file"], std::ios::binary);

Expand Down Expand Up @@ -50,8 +49,8 @@ void ModemQPSK::work(std::complex<float> *buffer, int length)

for (int i = 0; i < rec_out; i++)
{
sym_buffer[i * 2 + d_iq_invert] = clamp(rec_buffer[i].imag() * 100);
sym_buffer[i * 2 + (1 - d_iq_invert)] = clamp(rec_buffer[i].real() * 100);
sym_buffer[i * 2 + 0] = clamp(rec_buffer[i].real() * 100);
sym_buffer[i * 2 + 1] = clamp(rec_buffer[i].imag() * 100);
}

output_file.write((char *)sym_buffer, rec_out * 2);
Expand Down
1 change: 0 additions & 1 deletion src/dsp/modem/modem_qpsk.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class ModemQPSK : public Modem
float d_rrc_alpha;
int d_rrc_taps;
float d_loop_bw;
bool d_iq_invert;

std::complex<float> *agc_buffer;
std::complex<float> *rrc_buffer;
Expand Down

0 comments on commit fd33ff6

Please sign in to comment.