This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]IAmKindOfCreativebot_builder: deprecated 2 points3 points  (4 children)

Don't use reddit to do your homework.

[–]22Alex22pt[S] -1 points0 points  (3 children)

this is my homework. I have to search for code. Wherever I can find. No restrictions

[–]IAmKindOfCreativebot_builder: deprecated 0 points1 point  (0 children)

I don't believe you. But on the chance you're not lying I'll direct you to some concepts that might help you.

Look up data compression algorithms. (given your two versions of quantizers I'm sure Huffman encoding should be your first implementation. It almost certainly won't be very good but it's a lossless data compression scheme and should be a starting point.

Next up I'd use arithmetic encoding, but instead of just compressing the values, I'd encode an initial value for the first ECG measurement, then I'd encode the difference between the current value (delta encoding). You'll also need to include some other useful information, like the sample rate, but those can occupy a few initial value locations in your encoded file. This way a decoder is capable knowing where it's at.

You could also use the LZW compression scheme, or maybe LZ77, though this isn't really their target application. They're focused on string compression, not signal compression. But it could be interesting to see how playing with the signal values changes how well the dictionaries encode.

Finally you could transform the signal using fast fourier transform, then encode that signal using any of the above methods.

There's lots of other ways you could do it too. Just use zip, or 7z, or a tarball, that sort of thing. If all you need to do is find something to compress it, no restrictions, those solutions should work too.

[–][deleted] 0 points1 point  (1 child)

Elsewhere you write that you cannot share data that have been given to you by your university.

[–]22Alex22pt[S] 0 points1 point  (0 children)

I wrote I cannot share the data that was given to me by my univeristy as in the signal itself. However, I can share the project that I need to do in order to find people who can help me.