Set sr to 4m (#1636)

* Set sr to 4m

* Rename variable
This commit is contained in:
Totoo 2023-12-10 23:40:11 +01:00 committed by GitHub
parent c3bb9c0a16
commit 5e9d92d65c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -101,6 +101,7 @@ WeatherView::WeatherView(NavigationView& nav)
nav_.push<WeatherRecentEntryDetailView>(entry); nav_.push<WeatherRecentEntryDetailView>(entry);
}; };
baseband::set_weather(); baseband::set_weather();
receiver_model.set_sampling_rate(4'000'000); // needed too
receiver_model.enable(); receiver_model.enable();
signal_token_tick_second = rtc_time::signal_tick_second += [this]() { signal_token_tick_second = rtc_time::signal_tick_second += [this]() {
on_tick_second(); on_tick_second();

View File

@ -47,10 +47,10 @@ void WeatherProcessor::execute(const buffer_c8_t& buffer) {
tm += mag; tm += mag;
if (meashl == currentHiLow && currentDuration < 10'000'000) // allow pass 'end' signal if (meashl == currentHiLow && currentDuration < 10'000'000) // allow pass 'end' signal
{ {
if (currentDuration < UINT32_MAX) currentDuration += usperTick; if (currentDuration < UINT32_MAX) currentDuration += nsPerDecSamp;
} else { // called on change, so send the last duration and dir. } else { // called on change, so send the last duration and dir.
protoList.feed(currentHiLow, currentDuration / 1000); protoList.feed(currentHiLow, currentDuration / 1000);
currentDuration = usperTick; currentDuration = nsPerDecSamp;
currentHiLow = meashl; currentHiLow = meashl;
} }
} }
@ -71,8 +71,9 @@ void WeatherProcessor::on_message(const Message* const message) {
} }
void WeatherProcessor::configure(const WeatherRxConfigureMessage& message) { void WeatherProcessor::configure(const WeatherRxConfigureMessage& message) {
constexpr size_t decim_0_output_fs = baseband_fs / decim_0.decimation_factor; // unused:
constexpr size_t decim_1_output_fs = decim_0_output_fs / decim_1.decimation_factor; // constexpr size_t decim_0_output_fs = baseband_fs / decim_0.decimation_factor;
// constexpr size_t decim_1_output_fs = decim_0_output_fs / decim_1.decimation_factor;
decim_0.configure(taps_200k_wfm_decim_0.taps); decim_0.configure(taps_200k_wfm_decim_0.taps);
decim_1.configure(taps_200k_wfm_decim_1.taps); decim_1.configure(taps_200k_wfm_decim_1.taps);

View File

@ -41,8 +41,7 @@ class WeatherProcessor : public BasebandProcessor {
private: private:
static constexpr size_t baseband_fs = 4'000'000; // it works, I think we need to write that master clock in the baseband_threat , even later we decimate it. static constexpr size_t baseband_fs = 4'000'000; // it works, I think we need to write that master clock in the baseband_threat , even later we decimate it.
static constexpr uint32_t usperTick = 500 * 8; // In current sw , we do not scale it due to clock. We scaled it due to less array buffer sampes due to /8 decimation. static constexpr uint32_t nsPerDecSamp = 1'000'000'000 / baseband_fs * 8; // Scaled it due to less array buffer sampes due to /8 decimation. 250 nseg (4Mhz) * 8
// TODO , Pending to investigate , why ticks are not proportional to the SR clock, 500 nseg (2Mhz) , 250 nseg (4Mhz) ??? ;previous comment : "we nees ms to has to divide by 1000"
/* Array Buffer aux. used in decim0 and decim1 IQ c16 signed data ; (decim0 defines the max length of the array) */ /* Array Buffer aux. used in decim0 and decim1 IQ c16 signed data ; (decim0 defines the max length of the array) */
std::array<complex16_t, 512> dst{}; // decim0 /4 , 2048/4 = 512 complex I,Q std::array<complex16_t, 512> dst{}; // decim0 /4 , 2048/4 = 512 complex I,Q

View File

@ -1242,7 +1242,6 @@ class WeatherRxConfigureMessage : public Message {
public: public:
constexpr WeatherRxConfigureMessage() constexpr WeatherRxConfigureMessage()
: Message{ID::WeatherRxConfigure} { : Message{ID::WeatherRxConfigure} {
// todoh give some more info
} }
}; };