I am new to encoding signals ... However, I have a problem that I am not sure how to solve:
- I have a 12-bit linear signal, which I want to encode/compress into the 6-bit logarithmic signal representing 0:-0.5:-31,5 dB from max amplitude. How can I do that?
The nature of a signal tells a lot about the suited technique to encode it. As you are referring to a linear signal, depending on the slope maybe even a compression would be not necessary.
I don't hear the OP requiring lossless compression. Logarithmic compression is used for some applications, e.g. good old telecom µ-law. If performed on a digital input signal, it's simple number mapping.