mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* new RX delays based on SNR
This commit is contained in:
parent
29e62b9ce2
commit
7da0a5f7ec
13 changed files with 116 additions and 23 deletions
|
|
@ -18,4 +18,14 @@ public:
|
|||
}
|
||||
float getLastRSSI() const override { return ((CustomLLCC68 *)_radio)->getRSSI(); }
|
||||
float getLastSNR() const override { return ((CustomLLCC68 *)_radio)->getSNR(); }
|
||||
|
||||
float packetScore(float snr, int packet_len) override {
|
||||
int sf = ((CustomLLCC68 *)_radio)->spreadingFactor;
|
||||
const float A = 0.7;
|
||||
const float B = 0.4;
|
||||
|
||||
float ber = exp(-pow(10, (snr / 10)) / (A * pow(10, (snr / 10)) + B * (1 << sf)));
|
||||
|
||||
return pow(1 - ber, packet_len * 8);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue