function test_noisegen()

% TEST_NOISEGEN tests the Franklin noise-generator algorithm.
% 
%  
% $Id: test_noisegen.m,v 1.11 2008/07/18 15:53:58 anneke Exp $
% 



%% poles and zeros
pole = [pz(5,1) pz(1)];
zero = pz(3);
gain = 1;
pzm   = pzmodel(gain, pole, zero);%% convert to get a and b coefficients

% parameter list for noise generation
pl = plist('nsecs', 100000,'fs', 10,'pzmodel', pzm, 'ndigits',50);

%% calling the noisegenerator
b  = ao(pl);

%% Make LPSD  
% Window function
w = specwin('Kaiser', 10, 150);
% parameter list for lpsd
lpl = plist('Kdes', 1000,'Kmin', 2,'Jdes', 1000,'Win', w,'order',0,'scale','ASD');

% LPSD
noise = lpsd(b, lpl); % matlab

rpl = plist('f1',1e-5,'f2',10,'nf',5e3);
%% Plot
% iplot(b)
% iplot(analyt)
plpl = plist('lengend','off');
iplot(noise,abs(resp(pzm,rpl)),plpl)

% plot(noise.hist)
