function out = newmodel(data,numtrpoints,threshold)

data = data(1:numtrpoints);
B = dct(data);
temp = find(abs(B)<threshold);  %find all coefficients that are smaller than given coeff (remove smaller ones first) 
B(temp) = zeros(size(temp));
out = idct(B);