Added support for multiple sample rates in IQ record

Support for any sample rate <= 500k in IQ replay
Fixed bias-t power not activating in TX
Removed RSSI pitch output option (awful code)
Udated binary
This commit is contained in:
furrtek 2018-02-22 07:04:19 +00:00
parent 57c759627d
commit 7fd987a2b4
23 changed files with 193 additions and 84 deletions

View file

@ -51,30 +51,40 @@ void ReplayAppView::on_file_changed(std::filesystem::path new_file_path) {
file_path = new_file_path;
auto file_size = data_file.size();
auto duration = (file_size * 1000) / (2 * 2 * sampling_rate / 8);
progressbar.set_max(file_size);
text_filename.set(file_path.filename().string().substr(0, 19));
text_duration.set(to_string_time_ms(duration));
// Get original record frequency if available
std::filesystem::path info_file_path = file_path;
info_file_path.replace_extension(u".TXT");
sample_rate = 500000;
auto info_open_error = info_file.open("/" + info_file_path.string());
if (!info_open_error.is_valid()) {
memset(file_data, 0, 257);
auto read_size = info_file.read(file_data, 256);
if (!read_size.is_error()) {
auto pos = strstr(file_data, "center_frequency=");
if (pos) {
pos += 17;
field_frequency.set_value(strtoll(pos, nullptr, 10));
auto pos1 = strstr(file_data, "center_frequency=");
if (pos1) {
pos1 += 17;
field_frequency.set_value(strtoll(pos1, nullptr, 10));
}
auto pos2 = strstr(file_data, "sample_rate=");
if (pos2) {
pos2 += 12;
sample_rate = strtoll(pos2, nullptr, 10);
}
}
}
text_sample_rate.set(unit_auto_scale(sample_rate, 3, 0) + "Hz");
auto file_size = data_file.size();
auto duration = (file_size * 1000) / (2 * 2 * sample_rate);
progressbar.set_max(file_size);
text_filename.set(file_path.filename().string().substr(0, 12));
text_duration.set(to_string_time_ms(duration));
button_play.focus();
}
@ -117,6 +127,8 @@ void ReplayAppView::start() {
if( reader ) {
button_play.set_bitmap(&bitmap_stop);
baseband::set_sample_rate(sample_rate * 8);
replay_thread = std::make_unique<ReplayThread>(
std::move(reader),
read_size, buffer_count,
@ -130,7 +142,7 @@ void ReplayAppView::start() {
radio::enable({
receiver_model.tuning_frequency(),
sampling_rate,
sample_rate * 8 ,
baseband_bandwidth,
rf::Direction::Transmit,
receiver_model.rf_amp(),
@ -172,6 +184,7 @@ ReplayAppView::ReplayAppView(
&labels,
&button_open,
&text_filename,
&text_sample_rate,
&text_duration,
&progressbar,
&field_frequency,