Hello, I am trying to use this simulation (qrs complex only) and trying to insert chaotic and random behavior into the signal. The chaotic and random behavior needs to be inputted in the time intervals between the pulses. I am trying to isolate and identify the time intervals in order insert the chaos and randomness. I have been having a lot of trouble identifying this region though. I have tried to use a for loop to create an array of indices where the ecg signal is equal to -0.5505 (which is where the time intervals are). I then tried to plot the ecg signal at those indices. After simulating the ecg signal qrs complex this is the code I used:
int=0:1:length(ecg);
c=100;
for i=1:length(ecg)
for j=1:length(ecg)
if(ecg(i)==-0.5505)
int(j)=i;
else
end
end
end
hold on
plot(ecg(int), 'r');
Using this I get int where each index has a value that's the same as the index. Therefore when I plot it I get the entire signal. I tried setting it to if (ecg(i)~=-.05505 and I got a line going through the entire signal at -.5505 but I only want the portions which aren't the qrs pusle. I have been working on this for a couple of days and I am very confused as to what I am doing wrong. Please offer any input.
ajay pawar, I would recommend using nonlinear spline filtering instead of standard linear filtering (hamming, rectangular). It's really useful for this kind of time-domain signals. We have used it extensivley while developing the TechPatient ecg simulator ( http://www.heinstruments.com ). Spline filtering can input a synthetic ecg waveform and output a realistic signal without compromising its final amplitude or timing.