C5505 evm ecg interface in simulink

1 view (last 30 days)
Talha
Talha on 31 May 2011
Answered: mak carlos on 15 Jan 2018
hi, I have C5505 EVM, and I am doing ECG implementation on it. So far I have successfully got the results of ECGs. Now I am trying to interface the Kit with the Matlab/Simulink. i achieved signals Simulink using Instrument Toolbox in simulink but the output is all noisy. i also have to differentiate between ecg leads signals for further analysis. i have applied the DeMux but the scope is showing all output of different leads of ECG together...
i used 9 scopes cause i thought serial data is comprise of 9 channels. but all scopes have output with some changes and amplitude is very much...
(One thing more i dont understand the DATA SIZE option in SERIAL RECIEVE BLOCK PROPERTIES...And is there any S function that i can use for dsp serial communication??)
Regards,
Talha

Answers (3)

Shankar Subramanian
Shankar Subramanian on 31 May 2011
Data Size field refers to the number of values to read (of the type specified by Data Type field) from the Serial port at every simulation time step.
For example - If you specify 5 as data size and uint8 as data type, the Serial Receive block reads 5 uint8 values at every time step. Optionally you can also specify the size as a matrix, say [2 3]. In this case, the block reads 6 values from the serial port and outputs it in the matrix format specified.
The Serial Receive block currently supports only fixed size outputs specified by the data size field.
Thanks
Shankar
  3 Comments
Talha
Talha on 1 Jun 2011
Answers to both of your post...
1)Yes the maximum amplitude is about 3 x 10^4 but sometimes exceeds also. and i have selected signed 16 bit integer.
2)Yes i am not sure about the orders of both.
I was hoping that there exist a toolbox or a component in simulink for separation?? and can you tell me how can i achieve original amplitude???

Sign in to comment.


Walter Roberson
Walter Roberson on 1 Jun 2011
Reference material: here. See pdf page 16 for information about the serial data transmission. Note that there is a periodic header (every 1 second) that is in a different format.
The data itself is repetitions of sets of samples from each of the 8 leads, 16 bits per channel, low (less significant) byte first. After the header mentioned earlier, the samples repeat in the order shown in section 2.4, pdf page 8.
I am a bit uncertain as to the serial data format: I don't see how a simple 8 bit packet number would work if it is incremented for each sample sent.
  2 Comments
Walter Roberson
Walter Roberson on 2 Jun 2011
It doesn't restart it at zero-zero for the next packet as far as I could see. If you do not need the heart rate or lead on/off information, then the header and following status information sent out periodically become noise to be skipped.
One thing I noticed about the synchronization header was that the first two words of it are equivalent to having two words each of which are the maximum negative value -- the pair 00 80, because the less significant byte is first for the data, is equivalent to hex '8000' which in signed format is the minimum integer (a number that has no equivalent maximum). Once you have gotten yourself synchronized with the data stream and are reading a bunch of data, use a comparator block to detect the -32768 and when found, handle the five bytes that follow distinctly and then return to the data gathering.

Sign in to comment.


mak carlos
mak carlos on 15 Jan 2018
Hi
I not so familiar with the Matlab software, recently I am doing my project relate Real time Signal processing ECG, I facing the problem is come out too much noise, even the lead electrode do not touch skin, the output automatically detected. Can I know how to solve the problem, even I use Matlab m code method or Simulink method connect with the arduino and ECG lead electrode get same problem ?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!