You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
consider the data created by the following commands
x=0.51: 0.01:0.7;
data =round(sin(x),3);
data=1000*data
to do delta encoding on a dataset, the first element of the dataset is saved
compressed_data(1)=data(1);
the second element of the compressed data will contain the difference from second element to first element and so, on till the last element.
for i =2:length(data)
compressed_data(i)=data(i)-data(i-1);
end
for the decompression the first entry of the compressed data will be the first element of the decompressed data and the second element will be the sum of second element t of the compressed data and the first element of the decompressed data,
decompressed_data(1)=compressed_data(1);
for i =2:length(compressed_data)
decompressed_data(i)=compressed_data(i)+decompressed_data(i-1);
end
Cite As
Hamza Irfan (2026). Simplest Example in Delta Encoding and Decoding (https://se.mathworks.com/matlabcentral/fileexchange/83168-simplest-example-in-delta-encoding-and-decoding), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.1 (1.17 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
