Matlab interpretation array questions

5 views (last 30 days)
Zoltan Szabo
Zoltan Szabo on 21 Nov 2016
Answered: Zoltan Szabo on 21 Nov 2016
Hi All,
I find and ECG signal generator code in matlab and I want to translate to my controller in C and some lines are unclear for me. Any help is welcome. What the below codes does ? 1) t_line=0:1/fs:duration; %time line, seconds fs and duration are constant values
2) QRS_wave=zeros( size(t_line) ); %QRS waveform is declared, but on the code I see referencies to QRS1=m2*index2time(i_t1:i_t2)-(m2*t1-left); QRSwave(i_t1:i_t2)=QRS1; What is QRS1 and what is QRSwave ? relation to QRS_wave ?
Thanks for anyone who can help ! Zoltan

Answers (2)

KSSV
KSSV on 21 Nov 2016
qrs_start=t1; % begining time
t2=t1+d1; % d1 = d1=0.4375*d; d can be changed
i_t1=time2index(t1); i_t2=time2index(t2); % change time to indices, this is a function given
left=0; right=0.875*amp;
m1=(right-left)/(t2-t1);
QRS1=m1*index2time(i_t1:i_t2)-(m1*t1-left); % picking times from the indices
QRSwave(i_t1:i_t2)=QRS1; % append first segment data to final result

Zoltan Szabo
Zoltan Szabo on 21 Nov 2016
Yes KSSV, is that one. :)

Products

Community Treasure Hunt

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

Start Hunting!