IR Raw data processing

So this is all new to me. I have set a custom rawcode to send over IR. Once I receive the data over IR, I understand that it will not be identical to the original unsigned int. How would I go about comparing each bit and converting it to the rounded number I want. For instance if the original bit was 1800 and I receive 1675, how do I round that up for every bit so that it is identical to what was originally sent? Sorry if this is bad wording. I'm literally totally not knowing how to do this haha

Please post your send and receive sketches

if the original bit was 1800 and I receive 1675,

That is not a meaning of bit that I understand

So I may be totally confused! haha (I told you so) Here is the send sketch:

#include <IRremote.h>

IRsend irsend;

void setup()
{

}

void loop() {
  int khz = 38; // 38kHz carrier frequency for the NEC protocol
  unsigned int irSignal[] = {3000,6000,3000,
                             2000,800,2000,800,2000,800,2000,800,
                             2000,1800,2000,800,2000,800,2000,800,
                             2000,1800,2000,800,2000,800,2000,800,
                             2000,800,2000,800,2000,800,2000,800,
                             1000};
  
  irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz); //Note the approach used to automatically calculate the size of the array.

  delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.
}

Here is the receive sketch (It uses a different library, but that's not important)

#include <IRLibRecvPCI.h> 

IRrecvPCI myReceiver(2);//pin number for the receiver

void setup() {
  Serial.begin(9600);
  delay(2000); while (!Serial); //delay for Leonardo
  myReceiver.enableIRIn(); // Start the receiver
}

void loop() {
  //Continue looping until you get a complete signal received
  if (myReceiver.getResults()) { 
    unsigned int irSignal[] = recvGlobal
    for(bufIndex_t i=1;i<recvGlobal.recvLength;i++) {
      Serial.print(recvGlobal.recvBuffer[i],DEC);
      Serial.print(F(", "));
    }
    Serial.println("");
    myReceiver.enableIRIn();      //Restart receiver
  }
}

What is important is that the receive outputs these numbers

2902, 6106, 2902, 2114, 694, 2114, 694, 2090, 718, 2090, 722, 2114, 1694, 2086, 722, 2114, 694, 2090, 722, 2086, 1718, 2090, 722, 2086, 722, 2090, 718, 2090, 722, 2086, 718, 2086, 722, 2062, 746,

As you can see they are close to what was specified but not the same. I want to round them to be the same.

I want to round them to be the same.

You have a very strange definition of rounding.

It uses a different library, but that's not important

You don't really believe that, do you?

For each pulse width you send there will be a range of numbers you receive. For each pulse width you receive, look up the pulse width range it falls in and use that value.

The reason the receive library isn't important is that it is receiving the data. That's not the problem. The problem is how do I go about figuring which custom length that particular bit is?