Mercurial > hg > ltpda
comparison m-toolbox/classes/@ao/ngprop.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % NGPROP is called by the function fromPzmodel | |
2 % | |
3 % Inputs calculated by ... | |
4 % ... NGCONV: | |
5 % - num: numerator coefficients | |
6 % ... NGSETUP: | |
7 % - Tprop: matrix to calculate propagation vector | |
8 % - E: matrix to calculate propagation vector | |
9 % ... NGINIT | |
10 % - y: initial state vector | |
11 % - num: numerator coefficients | |
12 % ... USER | |
13 % - ns: number of samples given as input from the user | |
14 % Outputs: | |
15 % - x: vector of timesamples | |
16 % - y: last calculated state vector (could be used as input | |
17 % for next LTPDA_NOISEGEN call) | |
18 % A Monsky 24-07-07 | |
19 % | |
20 % $Id: ngprop.m,v 1.3 2008/10/20 08:38:29 anneke Exp $ | |
21 | |
22 function [x y] = ngprop(Tprop, E, num, y, ns) | |
23 | |
24 lengT = length(Tprop); | |
25 lengb = lengT+1; | |
26 | |
27 num=num'; | |
28 num = [num zeros(1,(lengb-length(num)-1))]; | |
29 | |
30 | |
31 x = zeros(ns,1); | |
32 for i=1:ns | |
33 r = randn(lengT,1); | |
34 y = E * y + Tprop * r; | |
35 x(i) = num*y; | |
36 end | |
37 | |
38 end |