function P1TestScript()
% Checks out TrigInterp
% A small example for correctness...
n = 1024;
m = n/2;
y = randn(n,1);
[a,b] = TrigInterp(y);
x = (2*pi/n)*(0:n-1)';
u = ones(n,1); u(2:2:n) = -u(2:2:n);
s = ones(n,1)*a(1)/2 + u*a(m+1)/2;
for j=1:m-1
s = s + a(j+1)*cos(j*x) + b(j)*sin(j*x);
end
clc
fprintf('Error in an n = 1024 problem: %10.3e\n\n',norm(y-s))
% A large example to check efficiency...
n = 2^20;
x = randn(n,1);
tic
y = fft(x);
tFFT = toc;
tic
[a,b] = TrigInterp(x);
tTrig = toc;
fprintf('For n = 2^20, timeTrigInterp/timeFFT = %5.2f\n\n',tTrig/tFFT)