RAW to LIR question

Everything related to protocols and IR codes
Post Reply
iotemi
Posts: 4
Joined: Fri Apr 28, 2023 6:35 am

RAW to LIR question

Post by iotemi »

Hello AnalysIR!

I'm trying to find a smart way to convert raw messages into a compact format. I've seen that LIR format has a smart way of coding the frame by defining a signal as a number of pulses of certain mark and space duration, with mark and spaces defined in the header of the LIR format.

I've studied the code to extract RAW from LIR, my question is if there is any information / source code of how you perform RAW2LIR conversion, specifically how do you normalize a raw input so that the number of marks and spaces timings is reduced into a subset that is accepted by a receiver.

Do you make analysis of the statistical distribution of the durations? How do you select the mark and spaces values?

Idk if you can or are willing to share some knowledge, if not I would understand.

Best regards!
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: RAW to LIR question

Post by AnalysIR »

Hi

The syntax is provided in the LearnIR guide which is part of the LearnIR app. This app is included with each LearnIR device purchased.

If you have a LearnIR device, you can also request an example LIR2RAW python script.

The LIR sytntax is the best lossless compression for an IR signal we have seen and has been specifically designed for easy integration with 8 bit systems allowing a very small SRAM footprint.
iotemi
Posts: 4
Joined: Fri Apr 28, 2023 6:35 am

Re: RAW to LIR question

Post by iotemi »

Hello,

yes I have purchased both AnalysIR and LearnIR. Didn't look at LearnIR docs though.

My question is regarding the lossless compression algorythm, if this is available.
I would like to output LIR code from embedded device, right after raw acquisition.

Thank you!
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: RAW to LIR question

Post by AnalysIR »

My question is regarding the lossless compression algorythm, if this is available.
Yes...in the LearnIR docs...it is all explained in the appendix.
iotemi
Posts: 4
Joined: Fri Apr 28, 2023 6:35 am

Re: RAW to LIR question

Post by iotemi »

Maybe I have not explained my self correctly...
I have read the documentation (LearnIrv2_Help, Chapter 15 - Appendix D), and is perfectly explained how the LIR format is constructed.

For what I have seen, when importing a RAW signal into AnalysIR and exporting in LIR format, there is some sort of normalization of the mark and spaces timings. If I convert the LIR signal back to RAW I can see that the mark and spaces timing for 0 and for 1 have been "uniformed".

It looks like the software does some analysis on the raw packet timinigs, computes a suitable pair of mark/spaces for zeros, and one for the ones, and leaves all the others timings (like header mark and space, pauses etc).


This is a smart compression of the raw signal BEFORE it gets described with LIR sintax (which is clear).

I have tried to do some statistical analysis, but I don't get how the mark and spaces timings for bits are chosen, and I really haven't found any information in the docs.
LIR does a lossless compression, but before LIR there is a lossy one, which is very interesting and would love to understand ;)
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: RAW to LIR question

Post by AnalysIR »

Ah OK..I misunderstood before.

Within the LearnIR device it is built in LIR format only (no RAW). This allows a very small & fixed RAM footprint for even the longest signals.

Unfortunately, our approach to building it up is not published because we sell this firmware to many companies around the world for use in their own IR products.

However, using a stats based approach or 'binning' will serve you well.

We also use some other algorithms including our 'Fuzzy Clean' which can recreate the original signal to within a few uSecs accuracy using LearnIR V2.

So the best way for users to create the initial LIR format is to use the LearnIR device or use our AnalysIR app to generate it.

I trust that clears things up.

If you just want to generate NEC style signals in LIR format, you can do it here. https://www.analysir.com/hex2nec.php
Post Reply