Click here to Skip to main content
14,981,770 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi everyone,

I'm trying to represent a ECG signal contained in a Xml File. I'm wondering what's the best way to do that?
Seems that the signal of all channels are encoding in base64, so i've got to decode it into readable values, to represent the graph.

Here's a piece of the Xml Signal:

CHANNEL
OFFSET="0"
BITS="16"
FORMAT="SIGNED"
UNITS_PER_MV="400"
DURATION="10000"
SAMPLE_FREQ="1000"
NAME="aVR"
ENCODING="BASE64"
DATA="6v/q/+n/6f/p/+n/6v/s/+z/6//r/+v/6//r/+z/7v/u/+7/7v/u/+7/7v/u
/+//7//w//H/8f/x//D/8P/w//D/7//v//D/8P/v/+//8P/x//H/8f/x//H/
8P/v/+7/7v/u/+7/7//v/+//7P/p/+n/6f/q/+z/7f/v/+//7//u/+7/7f/r
/+v/6//r/+r/6v/r/+r/6f/p/+r/6v/q/+r/6//p/+f/5v/k/+T/5f/l/+X/
5f/l/+T/5P/k/+T/5f/k/+L/4f/i/+H/4v/h/+L/4f/i/+H/4v/k/+T/5P/k
/+T/4//k/+b/5f/i/+H/4P/f/97/3//g/+D/4f/h/+T/4v/j/+X/5P/k/+T/
5P/j/+L/4//k/+T/5P/l/+X/5f/l/+b/6f/l/+f/5v/l/+b/5v/m/+b/5//n
/+f/5v/o/+X/5//l/+T/4v/i/+L/5f/p/+r/7P/s/+7/7f/u/+3/6//p/+b/
5//n/+j/6f/n/+f/6f/p/+v/6v/o/+b/6f/n/+n/6f/p/+v/6f/q/+v/7P/r
/+v/7v/v/+7/7//u/+7/7//v/+7/7v/t/+v/6//q/+z/7P/s/+7/7v/v/+v/
6v/s/+z/7v/v/+7/7v/t/+z/7f/v//H/7v/u/+7/7f/v/+7/7v/v/+z/7f/r
/+3/6//s/+v/7//u/+3/7v/r/+z/6//r/+z/7v/v/+//7f/u/+7/7//t/+7/
7v/u/+7/7v/t/+7/7//x//H/8//x//D/7v/w/+7/7v/s/+7/7v/u/+3/7v/t
/+z/7P/s/+//7v/u/+7/7v/w//D/7//t/+7/7//v//H/8P/v/+//7//v/+3/
7//x//H/8P/x//H/8//y//H/8f/w/+7/7v/v//D/8P/w//H/8P/w//H/8//z
//D/7//x//D/8f/w//H/8f/v//H/8v/0//D/8P/y//P/8f/z//H/8P/x//D/
7//v/+//7//z//T/8f/x//P/8f/x//H/8//x//H/8f/u/+z/7P/w/+//9P/z
//X/9f/z//H/7//w/+//8f/x//P/8//x//H/9P/0//P/9f/0//T/9f/2//T/
8//y//H/8f/x//L/8P/w/+//8f/x//H/8f/y//P/8//z//H/8P/t/+v/6//p
/+n/6f/n/+r/5//n/+j/5//l/+X/5v/l/+T/5f/l/+T/4f/g/+D/3//g/+H/
3//f/97/3f/d/9//3v/d/9z/1//T/9L/0P/R/9H/0f/O/87/0P/R/9D/0P/P
/87/0v/S/9D/0P/S/9H/1P/V/9b/1//V/9P/1P/T/9b/1//b/9//3f/f/9//
4P/f/+D/4P/f/9//4f/i/+L/5f/p/+j/6f/r/+z/7v/v//D/8P/x//P/9P/1
//X/9f/z//b/+P/6//j/+f/3//j/+f/5//j/9v/z//P/9//2//b/9v/2//X/
9v/4//n/9v/4//j/9v/z//P/9P/z//b/+P/5//z////+//3/+f/2//b/9P/v
/+v/5P/d/9f/zv/H/7z/tf+p/6L/mf+S/4z/gP92/2v/ZP9V/0b/N/8n/xb/
Ev8X/yL/Mf9G/17/dP+I/6H/w//i//f/AQAJAAwAEwAVABoAHwAlACkALwA2
ADYANAA2ADgANwA2ADQAMwAyAC8AKwApACUAIAAeABsAHAAYABUAEQARAAwA
CAABAP7/+f/1//T/9v/2//X/9f/2//X/9v/1//f/+f/5//n/+f/5//r/+f/4
...

Please help me, congrats
Posted
Updated 27-Oct-19 7:13am

1 solution

Hoping that your data is real XML (including lots of < and > characters which were not visible in your question) you should look at standard deserialization.

This site holds good articles, and has a search facility; which would yield stuff like this: XML Serialization and Deserialization: Part 1[^] and XML Serialization and Deserialization: Part 2[^]

If that is not sufficient, have a look at the official documentation, starting here: Introducing XML Serialization | Microsoft Docs[^] , and don't skip How to: Deserialize an Object | Microsoft Docs[^] .


If it is not real XML, you probably have to dive in the data yourself; to decode a Base64 string, have a look at the Convert Class (System) | Microsoft Docs[^] which has a couple of FromBase64... methods.

:)
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900