# how to contaminate ecg signal with noise

조회 수: 6(최근 30일)
sai lakshmi 16 Nov 2019
댓글: Daniel M 23 Nov 2019
I am working on the project namely "FALSE ALARM REDUCTION IN ATRIAL FIBRILLATION DETCTION USING DEEP BELIEF NETWORKS".
In this i need to download two databases, namely 07910m.mat{MIT_BIH ATRIAL FIBRILLATION DATABASE} which is attached here,and also the 'em' recording {MIT_BIH NOISE STRESS TEST DATABASE} is attached.
The afib database has Fs=250Hz and 10h in length,and 'em' recording is 30 min and has Fs=360Hz
now i need to make the 'em' recording 10h in length
in the paper its told that i can be done using auto regressive model,iam not knowing how to do it
can anyone suggest me the coding for this

#### 댓글 수: 11

표시 이전 댓글 수: 8
sai lakshmi 20 Nov 2019
Known epsilon(n) (1*1000000)which is a white noise defined earlier,also psi(I) is also defined earlier which are AR coefficients.now I need to execute the summation inside a for loop of finding x(n)
Daniel M 20 Nov 2019
Well you know there will be a loop involved. Can you show me the code you currently have? I can help you get there.
sai lakshmi 20 Nov 2019
x1=(val(1,:))/200;
n=length(x1);
fs=250;
t=0:1/fs:(n-1)/fs;
%plot(t,x1);
%[qrs_amp_raw,qrs_i_raw,delay]=pan_tompkin(x1,fs,0);
x2=(val(1,:));
Fs=360;
x3=resample(x2,25,36);
figure(1);
subplot(2,1,1);
plot(x2);
subplot(2,1,2);
plot(x3);
[d1,p1,rc] = aryule(x3,20);
for c=1:20
psi(c)=d1(c+1);
end
zmwn=randn(size(x1));
z=double.empty(0,1000000);
for i=1:length(x1)
z(i)=(-1.8909*z(i-1)+1.2973*z(i-2)-0.7229*z(i-3)+0.4524*z(i-4)-0.2636*z(i-5)+0.2620*z(i-6)-0.2307*z(i-7)+0.2164*z(i-8)-0.8175*z(i-9)+0.1536*z(i-10)-0.1285*z(i-11)+0.0878*z(i-12)-0.0736*z(i-13)+0.0682*z(i-14)-0.0679*z(i-15)+0.0487*z(i-16)-0.0268*z(i-17)+0.0249*z(i-18)-0.0153*z(i-19)+0.0026*z(i-20))+zmwn(b);
end
I am getting an error "subscript indices must be either of positive values or logicals"
I understood the occurence for error,but am not recognizing of how to simulate the noise signal in this.

로그인 to comment.

### 답변(2개)

Daniel M 20 Nov 2019
편집: Daniel M 21 Nov 2019
I obviously cannot run this code because I don't have the data nor any of the associated functions. By the way, you are getting an error because you are trying to access z at negative index locations.
Here is an example of how you would plot the equation. Keep in mind the assumptions I've made, which I've tried to comment.
clearvars
clc
sz = [1 1000];
e = randn(sz); % epsilon
X = nan(sz); % preallocate
X(1) = 0; % set first value. Don't know what this should be.
c = 1; % a constant, don't know what this should be
p = 5; % set the order of the model. Don't know what this should be.
% note that p cannot be greater than the iterating variable of the loop
% otherwise, it would try to access negative index locations
% So, either initialize your loop index at a value greater than 2 (and have the starting values of X)
% or do it this way, using increasing values of p, up to n-1
phi = rand(1,p); % your values of phi
for n = 2:sz(2)
ii = 1:min(p,n-1); % see the note above
sigma = dot(phi(ii), X(n-ii)); % sum of the products of the elements
X(n) = c + sigma + e(n);
end

#### 댓글 수: 7

표시 이전 댓글 수: 4
Daniel M 22 Nov 2019
Sai I noticed you unaccepted the answer citing it did not work for you. What is not working? This is the code for how to implement that equation. Just because you don't know how to use it does not mean the answer is incorrect.
sai lakshmi 23 Nov 2019
the values of X are recorded as infinity!
so thought it wouldn't work.
Daniel M 23 Nov 2019
Did you not see my response that phi must be << than 1? Did you even try it? It works.

로그인 to comment.

sai lakshmi 21 Nov 2019
I have provided the databases at the top of the question as links,please check it once and provide me with the required coding.

#### 댓글 수: 1

Daniel M 22 Nov 2019
I think you're looking for a consultant.

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

Translated by