From: "Doug MacMynowski" Subject: RE: transfer functions Date: Thu, 6 Jan 2011 16:01:15 -0800 Attached are 3 files: - gest_simple has all the matlab code to create transfer function - gest is the version I use, that has a lot more control over plotting (as well as some archival commented out chunks of code to try different things for testing purposes, so its impossible to read) - TFexample is a piece of code I just wrote to illustrate with a simple example. The example being the system \tau\dot{T}=\mu H - T + n Where H is a known input to the system, and n is an unknown input, and I low-pass filtered H so that at low frequencies most of the response results from known input, and at high frequencies, most of the response comes from unknown inputs Though right now gest returns the parameters "mu" being mu/tau and "epsilon" being 1/tau Note that the code is currently set up to plot the magnitude, the phase, and the coherence. Due to aliasing, the phase in particular becomes garbage at high frequencies regardless of noise levels; in practice, with all the data we have, the phase becomes garbage due to poor coherence long before aliasing becomes an issue. Also, it seems that sometimes when I run this it gets fairly lousy estimates of the parameters; even with long time records, low noise, and large nfft, the parameter estimates can still be off a bit (e.g. change Tmax=1000 years, Namp=0.01; and nfft=10*Fsamp...) The phase is quite useful info too, though it seems to look noisier than magnitude (the errors are uniform in a real vs imaginary axis plot, but while a 20% error might look small in magnitude on a log plot, the corresponding phase errors don't look small on that plot; also looks like I'm getting a small nonzero bias on the phase... again, this is small compared to errors in real data, but I should figure out why its there). Some useful things on the phase are to see which signal "leads" the other signal, or whether they're both in phase; that can diagnose whether the correlation between the signals is x causes y, y causes x, or both x & y are caused by some third factor. doug