view m-toolbox/test/test_noisegen.m @ 1:2014ba5b353a
database-connection-manager
Remove old code
author |
Daniele Nicolodi <nicolodi@science.unitn.it> |
date |
Sat, 03 Dec 2011 18:13:55 +0100 (2011-12-03) |
parents |
f0afece42f48 |
children |
|
line source
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)