How to get IRP from ProntoHex

If you're not a JP1 user, but would like help from the JP1 experts, post your question here.

Moderator: Moderators

Post Reply
skmagiik
Posts: 2
Joined: Tue Feb 01, 2022 5:47 pm

How to get IRP from ProntoHex

Post by skmagiik »

I would like to understand at a code/byte level how to get the IRP data from pronto hex.
irpTransmogrify and Ir Scrutinizer are great but I want to learn about how to do it myself for personal project I'm doing.

Can anyone help me understand how to get the Time Unit part of the IRP out of the pronto hex?

Example Pronto Hex:

0000 006D 0022 0022 0156 00AB 0014 0014 0014 0040 0014 0014 0014 0040 0014 0014 0014 0040 0014 0040 0014 0040 0014 0040 0014 0040 0014 0040 0014 0014 0014 0014 0014 0014 0014 0040 0014 0040 0014 0040 0014 0040 0014 0040 0014 0014 0014 0040 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0040 0014 0014 0014 0040 0014 0040 0014 0040 0014 05A3 0156 00AB 0014 0014 0014 0040 0014 0014 0014 0040 0014 0014 0014 0040 0014 0040 0014 0040 0014 0040 0014 0040 0014 0040 0014 0014 0014 0014 0014 0014 0014 0040 0014 0040 0014 0040 0014 0040 0014 0040 0014 0014 0014 0040 0014 0014 0014 0014 0014 0040 0014 0014 0014 0014 0014 0014 0014 0040 0014 0014 0014 0040 0014 0040 0014 0014 0014 05A3


IRP:
{38.0k,526,msb}<1,-1|1,-3>(17,-4497u,A:32,1,-37.945m,(17,-4497u,B:32,1,-37.945m)*){A=0x57e3e817,B=0x57e3e916}

In the general spec it has the value 526. I know it's related to the frequency bytes (006D) but am unsure the formula to go from there to the IRP Time Unit value. I tried changing and checking on my own but I got stuck there. Any help would be appreciated :)
Barf
Expert
Posts: 1524
Joined: Fri Oct 24, 2008 1:54 pm
Location: Munich, Germany
Contact:

Post by Barf »

The frequency is easy: For the frequency f in Hertz, the pronto code is the number 1000000/(f*0.241246) expressed as a four-digit hexadecimal number. It can be conveniently computed by the Time/Frequency Calculator in IrScrutinizer, available under the Tools menu. See this explanation.

The rest is harder. Note that there is no unique "the IRP", there may be many different ones that could generate the given signal. There is no simple formula for e.g. the time base.

What IrpTransmogrifier does is (simplified) the following: First the duration are collected and grouped into clusters, representing (so we assume) one timing + a random error. Then all members of the cluster are replaced by their mean. (Simpler programs just round of the measurements instead.) This is called "cleaning". Then the time base is, basically, the least common denominator of the (important) timings. This is computed using (a floating point version of) Euclid's algorithm. This is all governed by a lot of user settable parameters. Then the cleaned timings are matched against a number (around 10) of possible "decoders" to generate a "nice" IRP. The "simplest" one is selected as the answer, unless directed otherwise by use parameters.

I recommend that you experiment a bit with IrpTransmogrifier from the command line, and/or study the source code -- subdirectory analyze. Note that you can also call the functionality using the Java API -- this is what RMIR is doing.
In the general spec it has the value 526. I know it's related to the frequency bytes (006D)
It isn't really.
mathdon
Expert
Posts: 4726
Joined: Tue Jul 22, 2008 8:53 am
Location: Cambridge, UK

Post by mathdon »

You want the document ProntoEdit IR CodeFormats by Eigeny Oulianov. This is described as an in-depth description of all current Pronto IR formats, current referring to when it was written, which was 2003. This is the document on which I based the import of Pronto signals into RMIR as Learned Signals.
Graham
skmagiik
Posts: 2
Joined: Tue Feb 01, 2022 5:47 pm

Post by skmagiik »

Thanks for the feedback!
Without an existing IRP library there isn't a great way to calculate the time base, and theoretically I don't seem to need it for playback/output of a prontohex code over IR anyway.

I appreciate the resources and it helped me better understand the source code of the IrpTransmogrifier. I was looking at it yesterday but code without explanation sometimes isn't the easiest to follow without a long time spent going through it.
The Robman
Site Owner
Posts: 21886
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post by The Robman »

Maybe some of the articles here will help:
http://www.hifi-remote.com/infrared/index.shtml
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Post Reply