Home > Archive > Compression > September 2004 > Coding question 2.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Coding question 2.
|
|
| Ernst Berg 2004-09-21, 8:55 am |
| Hello again.
This a restated question; I hope I ask it well.
I have an encoder I'm working on and I wanted to see if there is a
better way to code an output.
My encoder codes two different events.
I have chosen to use zeros for one of the events and ones with a zero
termination for the other. The length of these emitted strings is
variable with the minimum length for one being zero and the other a
minimum length of 1.
The logic of it is that the event coded by the ones terminated by a
zero bit may be next to another event coded by the ones terminated by
a zero bit in the stream and the event coded by the zeros will be
terminated by the event coded by the ones terminated by a zero bit.
That sounds confusing so let me explain better.
My encoder has two states.
The states have a grammar such that the state expressed by the code
string-segment containing zeros alone will not lead or follow a
another code string-segment containing zeros alone.
A code string-segment of ones delimited by a zero may follow or lead
another code string-segment of ones delimited by a zero bit.
Thus there will be length zero or greater "zeros code string-segment"
followed by a "ones code string-segment" of length one or greater
terminated by a zero bit.
A = state 1 all zeros. " 00000000000000000"
B = state 2 ones terminated by a zero. " 111111111111110"
The minimum length of A is 0 ( may not emit any code for some
instance. )
The Minimum length of B is 1 yet, I am having to code B at minimum
length of 2.
The length of B only needs to be a length of 1. Yet, there is the
intermittent code-segment of A so what do I do?
: Example " 1000000011110000000111111111111010 "
Breaks into "10, 000000, 11110, 000000, 1111111111110, 10 "
My question is: Is there a better coding then the terminating ones
with a zero bit.
I would like to get the size of B down to 1 as a minimum length not
two.
Your advice is apreciated.
Ernst
| |
| michael 2004-09-21, 3:55 pm |
| Does the signal typically toggle from A to B and back again?
There are several good approaches for this.
1. use two models. one which models the sequence of A and B.
the other which models the length of the run. This eliminates
the need for the terminating '0' on type B.
2. or just leave the terminating '0' in place and encode the lengths
of the runs of '0' and '1'. Each run must be at least 1 symbol
in length (or there would be no break in a previous run). Just
model the lengths of the alternating runs. Maybe preceed that with
a logarithmic RLE before encoding.
Just a few ideas.
- Michael A Maniscalco
Ernst_Berg@sbcglobal.net (Ernst Berg) wrote in message news:<be9ae35b.0409210022.41db12bb@posting.google.com>...
> Hello again.
>
> This a restated question; I hope I ask it well.
>
>
> I have an encoder I'm working on and I wanted to see if there is a
> better way to code an output.
>
> My encoder codes two different events.
>
> I have chosen to use zeros for one of the events and ones with a zero
> termination for the other. The length of these emitted strings is
> variable with the minimum length for one being zero and the other a
> minimum length of 1.
>
> The logic of it is that the event coded by the ones terminated by a
> zero bit may be next to another event coded by the ones terminated by
> a zero bit in the stream and the event coded by the zeros will be
> terminated by the event coded by the ones terminated by a zero bit.
>
> That sounds confusing so let me explain better.
>
> My encoder has two states.
> The states have a grammar such that the state expressed by the code
> string-segment containing zeros alone will not lead or follow a
> another code string-segment containing zeros alone.
> A code string-segment of ones delimited by a zero may follow or lead
> another code string-segment of ones delimited by a zero bit.
>
>
> Thus there will be length zero or greater "zeros code string-segment"
> followed by a "ones code string-segment" of length one or greater
> terminated by a zero bit.
>
> A = state 1 all zeros. " 00000000000000000"
> B = state 2 ones terminated by a zero. " 111111111111110"
>
> The minimum length of A is 0 ( may not emit any code for some
> instance. )
> The Minimum length of B is 1 yet, I am having to code B at minimum
> length of 2.
>
> The length of B only needs to be a length of 1. Yet, there is the
> intermittent code-segment of A so what do I do?
>
>
> : Example " 1000000011110000000111111111111010 "
>
> Breaks into "10, 000000, 11110, 000000, 1111111111110, 10 "
>
> My question is: Is there a better coding then the terminating ones
> with a zero bit.
> I would like to get the size of B down to 1 as a minimum length not
> two.
>
> Your advice is apreciated.
>
>
> Ernst
| |
| David A. Scott 2004-09-22, 3:55 am |
| Ernst_Berg@sbcglobal.net (Ernst Berg) wrote in
news:be9ae35b.0409210022.41db12bb@posting.google.com:
>
> A = state 1 all zeros. " 00000000000000000"
> B = state 2 ones terminated by a zero. " 111111111111110"
>
> The minimum length of A is 0 ( may not emit any code for some
> instance. )
> The Minimum length of B is 1 yet, I am having to code B at minimum
> length of 2.
>
> The length of B only needs to be a length of 1. Yet, there is the
> intermittent code-segment of A so what do I do?
>
>
> : Example " 1000000011110000000111111111111010 "
>
> Breaks into "10, 000000, 11110, 000000, 1111111111110, 10 "
>
> My question is: Is there a better coding then the terminating ones
> with a zero bit.
> I would like to get the size of B down to 1 as a minimum length not
> two.
>
> Your advice is apreciated.
>
>
>
Still does not make since. If the min length of A is ZERO when you
decode the string how do you know A has not occured example based on
your explanation
11101110 is that two B signals since you clain they can occur together
or is that a One B followed by a ZERO A in which you don't encode followed
by another B
Which is it????
Know if its always ABABABABABABAB where some of the A's are zero do
this take the number of zeros you used in A state and add 1 then for
the B get a number that represents the number of ONES then at start
of list use a lead 0 for A and a leading 1 for B after which you just
encode a sequence of universal numbers. I prefer fibinocci (bad spelling)
other might prefer Elas gamma or delta ( bad spelling again ) but look
it up.
David A. Scott
--
My Crypto code
http://bijective.dogma.net/crypto/scott19u.zip
http://www.jim.com/jamesd/Kong/scott19u.zip old version
My Compression code http://bijective.dogma.net/
**TO EMAIL ME drop the roman "five" **
Disclaimer:I am in no way responsible for any of the statements
made in the above text. For all I know I might be drugged.
As a famous person once said "any cryptograhic
system is only as strong as its weakest link"
| |
| Ernst Berg 2004-09-22, 3:55 am |
| "David A. Scott" <daVvid_a_scott@email.com> wrote in message news:<Xns956BC5B7C9B4H110W296LC45WIN3030R@130.133.1.4>...
> Ernst_Berg@sbcglobal.net (Ernst Berg) wrote in
> news:be9ae35b.0409210022.41db12bb@posting.google.com:
Just got home from work. Thanks for the reply.
>
>
> Still does not make since. If the min length of A is ZERO when you
> decode the string how do you know A has not occured example based on
> your explanation
The way I have it figured each B has a termination of a zero to mark
the end of that event so a following zero or more zeros signals an A
event.
>
> 11101110 is that two B signals since you clain they can occur together
> or is that a One B followed by a ZERO A in which you don't encode followed
> by another B
> Which is it????
>
>
Actually you are correct it is the non A or ZERO length A.
> Know if its always ABABABABABABAB where some of the A's are zero do
> this take the number of zeros you used in A state and add 1 then for
> the B get a number that represents the number of ONES then at start
> of list use a lead 0 for A and a leading 1 for B after which you just
> encode a sequence of universal numbers. I prefer fibinocci (bad spelling)
> other might prefer Elas gamma or delta ( bad spelling again ) but look
> it up.
>
Thank you David. I am going to look at what you suggested.
Ernst
| |
| Ernst Berg 2004-09-22, 3:55 am |
| michael@michael-maniscalco.com (michael) wrote in message news:<8da60968.0409210943.27ce3d83@posting.google.com>...
> Does the signal typically toggle from A to B and back again?
> There are several good approaches for this.
>
> 1. use two models. one which models the sequence of A and B.
> the other which models the length of the run. This eliminates
> the need for the terminating '0' on type B.
>
> 2. or just leave the terminating '0' in place and encode the lengths
> of the runs of '0' and '1'. Each run must be at least 1 symbol
> in length (or there would be no break in a previous run). Just
> model the lengths of the alternating runs. Maybe preceed that with
> a logarithmic RLE before encoding.
>
> Just a few ideas.
>
> - Michael A Maniscalco
>
Thank you Michael.
| |
| Ernst Berg 2004-09-24, 3:55 am |
| "David A. Scott" <daVvid_a_scott@email.com> wrote in message news:<Xns956BC5B7C9B4H110W296LC45WIN3030R@130.133.1.4>...
> Ernst_Berg@sbcglobal.net (Ernst Berg) wrote in
> news:be9ae35b.0409210022.41db12bb@posting.google.com:
>
>
> Still does not make since. If the min length of A is ZERO when you
> decode the string how do you know A has not occured example based on
> your explanation
>
> 11101110 is that two B signals since you clain they can occur together
> or is that a One B followed by a ZERO A in which you don't encode followed
> by another B
> Which is it????
>
>
> Know if its always ABABABABABABAB where some of the A's are zero do
> this take the number of zeros you used in A state and add 1 then for
> the B get a number that represents the number of ONES then at start
> of list use a lead 0 for A and a leading 1 for B after which you just
> encode a sequence of universal numbers. I prefer fibinocci (bad spelling)
> other might prefer Elas gamma or delta ( bad spelling again ) but look
> it up.
>
>
> David A. Scott
>
David
I have converted both A and B to Unary coding by emitting a
termination bit for an A of zero length.
This keeps the sequence ABABABABABAB while still being a 1toOne
encoding or there abouts 415240 bytes with 16 bits control data; so
415242 bytes....
I wish I could drop one bit each AB cycle tho... I think you get the
idea...
I had a secondary question about Fibonacci codes. Do you think
encoding to that would introduce redundancy?
Ernst
| |
| Ernst Berg 2004-09-24, 8:55 am |
| michael@michael-maniscalco.com (michael) wrote in message news:<8da60968.0409210943.27ce3d83@posting.google.com>...
> Does the signal typically toggle from A to B and back again?
> There are several good approaches for this.
>
> 1. use two models. one which models the sequence of A and B.
> the other which models the length of the run. This eliminates
> the need for the terminating '0' on type B.
>
> 2. or just leave the terminating '0' in place and encode the lengths
> of the runs of '0' and '1'. Each run must be at least 1 symbol
> in length (or there would be no break in a previous run). Just
> model the lengths of the alternating runs. Maybe preceed that with
> a logarithmic RLE before encoding.
>
> Just a few ideas.
>
> - Michael A Maniscalco
>
>
Michael
I think I have an encoding that combines both events into one enumeration system.
Unary for both A and B. I use 1, o1, oo1, ooo1 ...
I assume from here all other enumerations are possible.
Very interesting.
Ernst
|
|
|
|
|