Hello Amey,
I assume that you would be using a TPM channel, in input capture mode, to acquire the waveform timing. Without seeing your code, there might potentially be problems in a number of areas.
Are you attempting to capture on either edge, or one edge at a time? The latter method would be recommended for better control of the capture process.
What is the overflow period of the timer? If any time interval should exceed this period, the coding will need to be significantly more complex to take this into account. Assuming that you store the results as a sequence of periods (in TPM clock cycles), see whether any of the longer delay periods is being interpreted as a much shorter period.
When you do a comparison of two sequences, there may be some mismatch, firstly by a capture measuremant uncertainty of one count for each time period within the protocol. There will be additional uncertainty because the timing intervals associated with two different generating devices may exhibit differences, dependent on the specified timing tolerances for the particular IR protocol. The timing of pulses may also be dependent, to some extent, on the level of signal reaching the IR receiver. These uncertainties will need to be taken into account, if not already so.
Regards,
Mac