function [dt,freq,amp,slope,arms,drms] = dpsd_syn_data_entry(freq,amp,tmax);
%
%  psd_syn_data_entry.m    ver 1.0
%  by Tom Irvine  Email: tomirvine@aol.com
%
n = length(amp);
%
sdg = 1.;
%
sr=max(freq)*10.;
dt=1./sr;
%
 for( i=1:(n-1))
    if(freq(i) > 1.0e-12)
        slope(i)=log( amp(i+1)/amp(i) )/log( freq(i+1)/freq(i) );
    else
        slope(i) = 0.;
    end
end
%
drms=0.;
ra=0.;
%
for( i=1:(n-1))
	if(slope(i) < -1.0001 ||  slope(i) > -0.9999 )
		ra=ra+ ( amp(i+1)*freq(i+1)- amp(i)*freq(i))/( slope(i)+1.);
	else
		if(freq(i) < 1.0e-12)
            freq(i)=1.0e-12;
        end    
		ra=ra+ amp(i)*freq(i)*log( freq(i+1)/freq(i));
    end
end    
drms=sqrt(ra);
%
%
for(i=1:n)
    amp(i)=amp(i)*(2*pi*freq(i))^4;
end
%
clear slope;
%
 for( i=1:(n-1))
    if(freq(i) > 1.0e-12)
        slope(i)=log( amp(i+1)/amp(i) )/log( freq(i+1)/freq(i) );
    else
        slope(i) = 0.;
    end
end
%
arms=0.;
ra=0.;
%
for( i=1:(n-1))
	if(slope(i) < -1.0001 ||  slope(i) > -0.9999 )
		ra=ra+ ( amp(i+1)*freq(i+1)- amp(i)*freq(i))/( slope(i)+1.);
	else
		if(freq(i) < 1.0e-12)
            freq(i)=1.0e-12;
        end    
		ra=ra+ amp(i)*freq(i)*log( freq(i+1)/freq(i));
    end
end    
arms=sqrt(ra);