function [ptaufc] = ptau(tau,fcvec)

% This function generates the ptaufc
% used for the expected value calculation

% This is an implementation of ptauLogFD, as describe in Stern and Shear.


numtau = length(tau);
numfc = length(fcvec);

ptaufc = zeros(numfc,numtau);

kl = .1*(fcvec.^1.1);
kh = (3e6)*ones(size(fcvec));

% Accounting for thresholds/plateaus

tau = sign(tau).*max(abs(tau),.2);
tau((numtau+1)/2) = .2;

% generate values of ptau

ptaufc = (exp(-2*pi*(fcvec.*kl)'*abs(tau))-exp(-2*pi*(fcvec.*kh)'*abs(tau)));

%Dividing by abs(tau)

tauinv = 1./(tau+eps);

for i = 1:numtau,		
	ptaufc(:,i) = ptaufc(:,i)*abs(tauinv(i));
end


% Normalization of ptaufc (calculating C)

for i = 1:numfc,
	ptaufc(i,:) = ptaufc(i,:)./sum(ptaufc(i,:));
end

