function NonUniform2Uniform(filename, frequency)

M = load(filename);
N = size(M,1);
cs = spline(M(:,1)',[M(1,2) M(:,2)' M(N,2)]);
dxmin = min(-M(1:N-1,1)+M(2:N,1));
Nmax = round((M(N,1)-M(1,1))/dxmin);
xx = linspace(0.0, M(N,1), Nmax);
yy = ppval(cs, xx);

figure, plot(xx,yy);

filename_opal = 'test.T7';
fh = fopen(filename_opal, 'wt');
fprintf(fh, '%s\n', '1DDynamic 20');
fprintf(fh, '%10.6f %10.6f %d\n', M(1,1)*100, M(N,1)*100, Nmax-1);
fprintf(fh, '%10.6f\n', frequency);
fprintf(fh, '%s\n', '0.0 1.0 100');
fprintf(fh, '%10.6f\n', yy);
fclose(fh);