Message Boards Message Boards

GROUPS:

How do I calculate the Hilbert transform with WL?

Posted 7 years ago
6102 Views
|
2 Replies
|
2 Total Likes
|

I'm trying to calculate the Hilbert transform of the natural log of the modulus of the transfer function of a simple 1st order filter. This should give me the phase characteristic of the filter, however Mathematica doesn't give me the expected result $(-arctan(tau*omega))$, in fact it just gives me back my input without any processing. Could anyone here tell me how to make Mathematica solve this correctly. Here is what I entered:

Integrate[-0.5*
   ln[1 + (\[Tau]*\[Nu])^2]/(\[Nu] - \[Omega]), {\[Nu], -Infinity, \
+Infinity}, PrincipalValue -> True, Assumptions -> \[Tau] > 0, 
  GenerateConditions -> False]/Pi

thanks in advance hugo

POSTED BY: Hugo Coolens
2 Replies
Posted 7 years ago
Integrate[-1/2*Log[1 + (\[Tau]*\[Nu])^2]/(\[Nu] - \[Omega]), {\[Nu], -Infinity, Infinity},
 PrincipalValue -> True, Assumptions -> \[Tau] > 0, GenerateConditions -> False]/Pi

gives

(2 \[Pi] ArcCot[\[Tau] \[Omega]] + (Log[\[Tau]^2 + 1/\[Omega]^2] - Log[-(1/\[Omega])] - 
    Log[1/\[Omega]]) (Log[-(1/\[Omega])] - Log[1/\[Omega]]))/(2 \[Pi])

Always watch for the Mathematica way of spelling and capitalizing things. Using exact rationals instead of decimals often helps too. It is also gets cranky about leading plus signs and it is perhaps best to avoid those.

And if you tell it something about the domain of omega then you can avoid the default assumption that every variable takes on every value in the complex plane and you can do even better. Note: greater than or less than implies Real, as you probably expect.

Integrate[-1/2*Log[1 + (\[Tau]*\[Nu])^2]/(\[Nu] - \[Omega]), {\[Nu], -Infinity, Infinity},
 PrincipalValue -> True, Assumptions -> \[Tau] >0 && \[Omega] >0, GenerateConditions -> False]/Pi

gives

-ArcTan[\[Tau] \[Omega]]

When posting here, separating your Mathematica expressions from your text with blank lines, then selecting the expression by scraping with the mouse and then tapping control-K on your keyboard will let it format and highlight your expressions, will do somewhat less damage to the contents of your expressions, like "eating" all your backslashes when it displays them, but it still won't translate your Greek characters.

You might experiment with all the different combinations of Assumptions you can think of. You should get back a rainbow of different kinds of result, depending on those options. For example, because Tau Nu is squared and Nu should be able to be inferred to be Real inside the integration, it would seem reasonable that knowing Tau is Real should be sufficient to get the same ArcTan result. But assuming only Tau Real gives a completely different result from Tau positive. You can also try using Simplify or FullSimplify on the result, also with assumptions, but stated in a slightly different way. That gives even more possible results. I can't see any clear pattern with the various reasonable assumptions I tried. Perhaps you will be better.

POSTED BY: Bill Simpson
Posted 7 years ago

Dear Bill, Thank you very much for your reply, a lot of things became much clearer to me.

The last expression you gave, gives the correct result on my RPi2:

Integrate[-1/2Log[1 + ([Tau][Nu])^2]/([Nu] - [Omega]), {[Nu], -Infinity, Infinity}, PrincipalValue -> True, Assumptions -> [Tau] >0 && [Omega] >0, GenerateConditions -> False]/Pi

Result (as expected):

-ArcTan[[Tau] [Omega]]

Strange enough for the other expression you gave, Mathematica just gives me a zero as the result and not your result:

Integrate[-1/2Log[1 + ([Tau][Nu])^2]/([Nu] - [Omega]), {[Nu], -Infinity, Infinity}, PrincipalValue -> True, Assumptions -> [Tau] > 0, GenerateConditions -> False]/Pi

Result (unexpected and without any warning or error message):

0

kind regards, hugo

p.s. Is there a way to quote the mail to which one replies as a whole immediately?

POSTED BY: Hugo Coolens
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract