Skip to content

Commit

Permalink
add gain.
Browse files Browse the repository at this point in the history
  • Loading branch information
anarkiwi committed Apr 3, 2024
1 parent f767fde commit 6f39df6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/sample_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ void sample_pipeline_start(const std::string &file, const std::string &fft_file,
}

void sample_pipeline_stop(size_t overflows, const std::string &file,
size_t rate, size_t freq, double timestamp) {
size_t rate, size_t freq, double timestamp, double gain) {
samples_input_done = true;
writer_threads->join_all();
sample_writer->close(overflows);
fft_sample_writer->close(overflows);
sample_writer->write_sigmf(file + ".sigmf-meta", timestamp, "s16", rate, freq, 0);
sample_writer->write_sigmf(file + ".sigmf-meta", timestamp, "s16", rate, freq, gain);
if (useVkFFT) {
free_vkfft();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/sample_pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ void sample_pipeline_start(const std::string &file, const std::string &fft_file,
size_t sample_id);
size_t get_samp_size();
void sample_pipeline_stop(size_t overflows, const std::string &file,
size_t rate, size_t freq, double timestamp);
size_t rate, size_t freq, double timestamp, double gain);
void set_sample_pipeline_types(const std::string &type,
std::string &cpu_format);
4 changes: 2 additions & 2 deletions lib/sample_pipeline_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BOOST_AUTO_TEST_CASE(SmokeTest) {
set_sample_pipeline_types("short", cpu_format);
BOOST_TEST(cpu_format == "sc16");
sample_pipeline_start("", "", 1e6, 1, false, 0, 0, 1, 1, 1e6, 0, 0);
sample_pipeline_stop(0, "", 1e6, 1e6, 1.1);
sample_pipeline_stop(0, "", 1e6, 1e6, 1.1, -1);
}

BOOST_AUTO_TEST_CASE(RandomFFTTest) {
Expand All @@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE(RandomFFTTest) {
memcpy(buffer_p, samples.memptr(),
samples.size() * sizeof(std::complex<float>));
enqueue_samples(write_ptr);
sample_pipeline_stop(0, file, 1e3 * 1024, 100e6, 1.1);
sample_pipeline_stop(0, file, 1e3 * 1024, 100e6, 1.1, -1);
arma::Col<std::complex<float>> disk_samples;
disk_samples.copy_size(samples);
FILE *samples_fp = fopen(file.c_str(), "rb");
Expand Down
2 changes: 1 addition & 1 deletion lib/uhd_sample_recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void sample_record(uhd::usrp::multi_usrp::sptr usrp, const std::string &type,
stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;
rx_stream->issue_stream_cmd(stream_cmd);
std::cerr << "stream stopped" << std::endl;
sample_pipeline_stop(overflows, file, rate, freq, timestamp);
sample_pipeline_stop(overflows, file, rate, freq, timestamp, gain);
std::cerr << "pipeline stopped" << std::endl;
}

Expand Down

0 comments on commit 6f39df6

Please sign in to comment.