view m-toolbox/test/test_ao_linSubtract.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line source

% Test script for ao/linSubtract
%
% M Nofrarias 14-05-09
%
% $Id: test_ao_linSubtract.m,v 1.1 2009/08/06 09:04:34 miquel Exp $
%

%% Make test AOs

% clear all

nsecs = 1000;
fs    = 10;


pl1 = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'randn(size(t))');
a1 = ao(pl1);

pl2 = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', '5*sin(2*pi*0.01*t)');
a2 = ao(pl2);
a2.setName('signal')

% linear coupling
a3 = a1 + a2
a3.setName('signal+noise')

%%  Linear Subtraction

pl = plist('type','bandpass',...
  'fc',[5e-4 0.1],...
  'order',2,...
  'times',[1 1e3],...
  'coupling',...
  {{'n(1)'}});

b = [a3 a2];

a4 = linSubtract(b,pl);


%% Plot

iplot(a4)

iplot(a3,a2)


%% Test Subtraction

b = lpsd(a3,a4)
b.iplot

%% History

plot(a4.hist)