% uphonis1
% can we remove uphonics digitally?
%

clear
hold off

load shapes2
I=size(shapes2);
S=1600;           %max number of samples for trapezoidal filter
x=zeros(I(1,1),S/2);
x=[x ones(I(1,1),S/2)];
for i=1:I(1,1)
  x(i,(S/2+1):(S/2+50))=shapes2(i,:);
end

y=zeros(1,2000);
m=20;
k=400;
for n=600:1600
 y(n)=y(n-1)+x(1,n)-x(1,n-m)-x(1,n-m-k)+x(n-2*m-k);
end


