JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

How to get IRP from ProntoHex

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> Non-JP1
View previous topic :: View next topic  
Author Message
skmagiik



Joined: 01 Feb 2022
Posts: 2

                    
PostPosted: Tue Feb 01, 2022 6:52 pm    Post subject: How to get IRP from ProntoHex Reply with quote

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 Smile
Back to top
View user's profile Send private message
Barf
Expert


Joined: 24 Oct 2008
Posts: 1402
Location: Munich, Germany

                    
PostPosted: Wed Feb 02, 2022 4:42 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Wed Feb 02, 2022 4:44 am    Post subject: Reply with quote

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
View user's profile Send private message
skmagiik



Joined: 01 Feb 2022
Posts: 2

                    
PostPosted: Wed Feb 02, 2022 11:59 am    Post subject: Reply with quote

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
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 21210
Location: Chicago, IL

                    
PostPosted: Thu Feb 03, 2022 8:59 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> Non-JP1 All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control