display('Select two end points to remove noise');
[xcoord, ycoord] = ginput(2);
xcoord = round(xcoord);
xcoord = sort(xcoord);
Z=Ydec(xcoord(1):xcoord(2));
nshortsamples = length(Z)
figure(5);
plot(Z); axis([0,nshortsamples,min(Z),max(Z)]);
title('Beginning and End Noise Removed Wave Data');
xlabel('Samples n'),ylabel('Amplitude');
