function y=rmstau(fre,S,tau)
% y=RMStau(fre,S,tau) computes the rms (square root of the power)
% within an exposure time tau, associated with the Power Spectral Density S, 
% %%between the frequency limits fmin and fmax.
%
% f: frequency vector 		(Hz)
% S: PSD			(unit^2/Hz)
% tau: exposure time		(sec)
% y : rms over tau			(unit) 
%

%
%  created:	B. Koehler,1992
%  
imin=1;
imax=length(fre);
unit=ones(size(fre));
df=fre(imin+1:imax)-fre(imin:imax-1);
filt=unit-(sin(pi*tau*fre)./(pi*tau*fre)).^2;
Sfilt=S.*filt;
ds=(Sfilt(imin:imax-1)+Sfilt(imin+1:imax))/2;
var=sum(ds.*df);
y=sqrt(var);

