I am interested to implement LZ algorithms for the compression of ECG signal and want to optimized the code with relevant to Micro controller. 
So that it would Entropy efficient and take less time to compress and decompress the ECG signal. I am totally stuck how I go through to achieve this. I am open to any programming language. 
I have searched the internet for the source codes and I found a very long code which is difficult to understand in a short period of time.
Any suggestion...?
Reconsider your choice of the LZ 77/78 algorithms. ECG waves look similar but they are not binary identical so the dictionary-based compression algorithms don't provide ideal results.
Complicated algorithms can hardly be expressed in few lines of code.
LZ 77, 78 algorithm for ECG Compression