Hello there,

In digital signal processing, one indicator that a signal may be quasi-periodic is that the ratio between the pair of frequencies (f1/f2) provides an irrational number as result. What I want to do is check if the result is irrational or not in the form of a function, just as ge(a,b) returns a boolean relative to 'a' being greater or equal to 'b' or not. However, I was not able to find any function appropriate for this (and no other posts regarding this too).

P.S.: I know that the user will know if (s)he is inputing an irrational number. As silly as it seems, I still want to display a message saying whether it is periodic or quasi-periodic. By the way, of course, there is still the possibility of inputing two irrational numbers, one for each frequency, and having a rational result. This is why such a check becomes helpful.

----------------------------------------------

EDIT 1: As an addition, I guess the aformentioned may have mislead most of you to believe that I wanted MATLAB to tell me if a number is rational or not only by its double or int value. However, I'm thinking about what is going in the Symbolic Toolbox level.

Take, for instance, these parameters:

f1 = 2;

f2 = sqrt(2);

a = f1/f2;

Provides (or must provide) in symbolical level...

Since I can work, for instance, with functions. I'm considering that this is different from

We know that if we type this, say, in the command window, f1/f2 will yield the same as double(f1/f2), but the processing is not exactly the same for these cases. My knowledge on MATLAB may fail at this point, but I believe that in some point in the processing of data, f1/f2 still is a symbolic value before it is converted to double to be displayed. That is the level of processing that I'm trying to work with. It seems reasonable to me that, at this stage, it may be easy to infer the "class" of our symbolic number... or isn't it?