%% m file to compute a 8 point goertzel test data w=0..7
h=2:2:16;
x=h+j*h;
w=input(' Enter Value k for w=exp(-j2pi*k/8)  k=  ');
W=exp(-j*2*pi*w/8);
y=0;reg1=0;
for k=1:8
  y=floor((x(9-k)+reg1));
  str= sprintf('y(%d) = %d+j%d  reg Wy=%d+j%d',...
     k-1,real(y),imag(y),real(reg1),imag(reg1));
  disp(str);
  reg1=floor(y.*W);
end
