That is a fact of life. When the receiver locks on to a signal, then in the absence of external interference, the pulses obey certain timing rules. Your program has to know those rules, and apply them to determine whether a signal is valid. If you spend some time looking at other people's code, it should become clear how it works.
I did not write any code for the W091, I just used Audacity to visualize the signal, and verify the encoding.
Here is some example receiver code for a similar sensor:
// update 1/8/2019 tank monitor, working
// receives and decodes LaCrosse TX6U temp sensor (433 MHz)
// YXR15 has RF ON = active high O/P (see definition of RF_ON/OFF below
// superregenerative receivers have mostly active low O/P
// SJR initially written 11/2017
// this version prints only one of 1st and 2nd copy of message
//
#define RF_IN (1<<PD2) //RF data in PORTD, PD2, ACTIVE HIGH receiver (Arduino digital pin 2)
#define LED (1<<PB5) // digital pin 13
// The following defines are for a receiver with RF ON = active low output
// switch them if RF ON = active high
// also, definitions must be consistent with definition for RF_IN port bit
#define RF_OFF 0
#define RF_ON (1<<PD2)
#define BUFSZ 10
char buf[BUFSZ + 1]; //packet character buffer
// parity table 0 1 2 3 4 5 6 7 8 9
char ptable[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2}; //# bits set in BCD nibble
unsigned char Bit, BitCnt, ErrCnt, ErrCode, BufPtr;
unsigned char c, idx;
unsigned char BitTime, sensor_id;
signed int tempc, tempf;
int p; //parity bit for data digits
unsigned long LastMsgPrint = 10000UL; //satisfies test in loop()
void setup() {
Serial.begin(9600);
Serial.println("TX6U-rx 01/08/2019");
// set up Timer2 for 8 usec ticks
TCCR2A = 0; //normal counter mode
TCCR2B = (1 << CS22) | (1 << CS20); //Timer2 prescaler = CPU clock/128 = 8 usec ticks
}
void loop() {
PORTB &= ~LED; //LED off
ErrCode = 0;
//
// loop: wait for possible transmissions.
//
while (1)
{
while ((PIND & RF_IN) == RF_OFF); //wait for RF on
TCNT2 = 0; //zero 8 usec counter
while ((PIND & RF_IN) == RF_ON); //wait for RF off, time the on pulse
if (TCNT2 > 162) break; //got long RF pulse (expect ~ 172 ticks)
}
/*
if (TCNT2 > 182) bail_out(); //probably not LaCrosse protocol
*/
ErrCnt = 0;
PORTB |= LED;
// possible start of packet, RF is OFF. Check for rest of preamble (3 more zero bits)
for (idx = 0; idx < 3; idx++)
{
TCNT2 = 0;
while ((PIND & RF_IN) == RF_OFF); //time RF off period, expect 1 ms = 125 ticks
BitTime = TCNT2;
if ((BitTime < 115) || (BitTime > 135)) ErrCnt++;
TCNT2 = 0;
while ( (PIND & RF_IN) == RF_ON); //time the RF on period, expect ~1.5 ms ~ 172 ticks
BitTime = TCNT2;
if ((BitTime < 162) || (BitTime > 182)) ErrCnt++;
}
if (ErrCnt > 0) ErrCode |= 1; //glitchy preamble, or not LaCrosse protocol
// attempt to read and decode packet
BitCnt = 0;
BufPtr = 0;
c = 0;
while (BitCnt < 40) //0 to 39
{
PORTB |= LED; //led on
while ((PIND & RF_IN) == RF_OFF); //wait for on, expect 1 ms = 125 ticks
TCNT2 = 0; //time the RF pulse
while ((PIND & RF_IN) == RF_ON); //wait for off, expect 0.6 ms = 0 or 1.5 ms = 1
BitTime = TCNT2;
Bit = 0;
if (BitTime < 125) Bit = 1; // ~ bisect 0/1 timing (measured 72/172 ticks)
c = (c << 1) | Bit; //get bit, LSB first
BitCnt++;
if (BitCnt % 4 == 0) //remainder modulo 4
{
buf[BufPtr++] = c; //got 4 bits, store nibble in buf[]
c = 0;
}
} //end while BitCnt
BufPtr--; //point to last character in buffer
// check message integrity
// Lacrosse TX6U, TX3, version 1: 10 nibbles
if (buf[0] != 10) ErrCode |= 2; //message length not ten nibbles
if (buf[1] != 0) ErrCode |= 2; //not a temperature sensor (humidity?)
// checksum
c = 0;
for (idx = 0; idx < BufPtr; idx++) c += buf[idx]; // add chars in first 9 positions
if ( (c & 0x0F) != buf[BufPtr]) ErrCode |= 4 ; //checksum doesn't match
// check that first two digits of temperature are repeated
if ( (buf[4] != buf[7]) || (buf[5] != buf[8]) ) ErrCode |= 8; // don't repeat
p = ptable[buf[4]] + ptable[buf[5]] + ptable[buf[6]]; //calculate data parity
if ( (p & 1) != (buf[3] & 1) ) ErrCode |= 16; //parity error
// done decoding RF
if ( (ErrCode & 0x1E) == 0 ) // OK except for possibly forgivable glitches in preamble
{
PINB &= ~LED; //LED off
sensor_id = ((buf[2] << 4) | buf[3]) >> 1;
tempc = 100 * ((int) buf[4]) + 10 * ((int) buf[5]) + (int) buf[6]; //celcius*10
tempc = tempc - 500; //subtract offset applied by sensor
tempf = (tempc * 90 + 25) / 50 + 320; //deg F*10 rounded up for positive temperatures
// convert entire message to hex for display
for ( idx = 0; idx <= BufPtr; idx++)
{
c = buf[idx];
if (c < 10) c += '0'; else c += 'a' - 10;
buf[idx] = c;
} //end for idx
buf[BufPtr + 1] = 0; //end the string
if (millis() - LastMsgPrint > 2000UL) { //skip second copy if first was printed
LastMsgPrint = millis(); //save the time!
Serial.println(tempc); //deg C*10
}
} //end if ErrCode
} //end loop()