Skip to content

Commit 8995768

Browse files
author
JongChern
committed
minor update to PRR
1 parent 6eb24cf commit 8995768

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ShimmerCapture/ShimmerBluetooth.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5117,7 +5117,10 @@ protected double CalibrateTimeStamp(double timeStamp)
51175117
//if (timeDifference > (1 / ((clockConstant / ADCRawSamplingRateValue) - 1)) * 1000)
51185118
if (timeDifference > adjustedETD)
51195119
{
5120-
PacketLossCount = PacketLossCount + 1;
5120+
//calculate the estimated packet loss within that time period
5121+
int numberOfLostPackets = (int)Math.Ceiling(timeDifference / adjustedETD);
5122+
PacketLossCount = PacketLossCount + numberOfLostPackets;
5123+
//PacketLossCount = PacketLossCount + 1;
51215124
long mTotalNumberofPackets = (long)((calibratedTimeStamp - CalTimeStart) / (1 / (clockConstant / ADCRawSamplingRateValue) * 1000));
51225125
PacketReceptionRate = (double)((mTotalNumberofPackets - PacketLossCount) / (double)mTotalNumberofPackets) * 100;
51235126

0 commit comments

Comments
 (0)