|
JP1 Remotes
|
View previous topic :: View next topic |
Author |
Message |
skmagiik
Joined: 01 Feb 2022 Posts: 2
|
Posted: Tue Feb 01, 2022 6:52 pm Post subject: How to get IRP from ProntoHex |
|
|
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 |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1416 Location: Munich, Germany |
Posted: Wed Feb 02, 2022 4:42 am Post subject: |
|
|
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.
Quote: | In the general spec it has the value 526. I know it's related to the frequency bytes (006D) |
It isn't really. |
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4524 Location: Cambridge, UK |
Posted: Wed Feb 02, 2022 4:44 am Post subject: |
|
|
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 |
|
Back to top |
|
|
skmagiik
Joined: 01 Feb 2022 Posts: 2
|
Posted: Wed Feb 02, 2022 11:59 am Post subject: |
|
|
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. |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21248 Location: Chicago, IL |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|