[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## invfreqs -> invfreq and scaling

**From**: |
Sergei Steshenko |

**Subject**: |
invfreqs -> invfreq and scaling |

**Date**: |
Fri, 24 Jun 2011 13:19:55 -0700 (PDT) |

Hello,
I am trying to fit a bell-like curve (rather, a curve resembling frequency
response of oscillating loop) using 'invfreqs' function from 'signal'
package.
Under the hood the true job is done by 'invfreq' of the same package.
Conceptually the code I have looks like this:
H = <some_expression>;
[B,A] = invfreqs(H,F,4,6,W);
The 'W' vector is generated like this:
W(2:end) = (1 ./ (abs(H(2:end)) / max(abs(H(2:end)))));
, so it doesn't depend on 'H' scaling.
In my use case the leftmost point is quite critical, so I have this
W(1) = K * W(2); # K is much greater than 1
.
In order to improve quality of fitting I tried to increase 'K', but after
some 'K' value I'm getting messages like these:
"
warning: matrix singular to machine precision, rcond = 1.19893e-18
warning: attempting to find minimum norm solution
warning: matrix singular to machine precision, rcond = 1.19893e-18
warning: attempting to find minimum norm solution
",
and the quality of fitting deteriorates.
FWIW, max(abs(H)) is about 10 (i.e. about 20db).
For no good reason I've tried to replace
H = <some_expression>;
with
H = 10 * <some_expression>;
.
To my surprise the transfirmation allows me to increase 'K' 20x without
getting the above warning and I'm getting a "perfect" fit - it now
asymptotically behaves as it should.
I think this scaling issue/workaround is very fishy - because I am on X86,
i.e. an FPU and double precision is used, so with my 'H' values in dynamic
range less than 60db scaling by +20db should not really matter.
Any ideas ?
Thanks,
Sergei.
P.S. Octave version is 3.0.5, 'signal' version is 1.0.8.

[Prev in Thread] |
**Current Thread** |
[Next in Thread] |

**invfreqs -> invfreq and scaling**,
*Sergei Steshenko* **<=**