Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Luke
Posts:
2
Registered:
8/14/14


rfmodel.rational Complex Filter/Input?
Posted:
Aug 14, 2014 5:39 PM


Hi All,
I'm working in Matlab (R2014a) with complex filters (not all complex poles are in conjugate pairs), which I've represented with rfmodel.rational objects. When I run rfmodel.rational.timeresp with these models, I notice that I
a. Get a warning saying "Input U must be a real vector." when I try to use a complex input in my simulations.
b. If I use a real input for these complex filters, my output is real. Applying a complex filter to a real signal should produce a complex signal.
Executing "open('timeresp')", I see these lines in the source code:
if isempty(u)  ~isvector(u)  ~isnumeric(u)  any(isnan(u))  ... any(~isreal(u))  any(isinf(u)) error(message('rf:rfmodel:rational:timeresp:WrongUInput')); end
and additionally see this line:
y = real(y(:));
So these snippets of code explain why I get the behavior I described above. In the rest of the code though, I can't see a single place where the input vector u would fundamentally need to be real, and I see no reason for y to be made real.
I am planning on just defining my own version of the function which removes these limitations, but I was just wondering if anyone knew of a reason these limits were put into the code to begin with? I am trying to make some relatively precise simulations and do not want to generate false results.
Thanks, Luke



