function wav = taper(wav);
    if(length(wav) < 320)
        error("Input is too short!");
    end
    rampup = reshape((1:160),size(wav(1:160)))/160;
    rampdown = reshape((160:-1:1),size(wav(1:160)))/160;
    wav(1:160) .*= rampup;
    wav(end-159:end) .*= rampdown;
end
