garimella
Full Member level 5
I have an array(arry(k)) that contains the sampled waveform. All that I am trying to do is to subject the array data to 2nd order IIR HPF and store the result in another array. But I am getting error when running the matlab code. What could be the problem?
error:
Code:
b0=0.9693;
b1=-1.9386;
b2=0.9693;
a1=-1.9381;
a2=0.9390;
for k=1:16
y=b0*arry(k)+b1*x1+b2*x2-a1*y1-a2*y2;
y1=y;
y2=y1;
x2=x1;
x1=arry(k);
filt_arry(k)=y;
end
error:
Undefined function or variable 'x1'.