1
$\begingroup$

Sorry for using an engineering term but i dont know the mathematical term for it so i am going to clarify what it is quickly If f(x)= sin(x) +3 then the dc offset is 3 . So i have the table (values of x and f (x)) of a discontinous function f (x)= tan (x) + cot (x) + 4 Is there any numerical method i can find out the dc offset from the values in the table? The usual method which FFT or some sort of fourier transform doesnt work

$\endgroup$
8
  • $\begingroup$ Usually the "DC offset" is the average value over a period (possibly with some scale factor depending on the context). I don't really know why you would want to isolate the "4" in $\tan(x)+\cot(x)+4$. $\endgroup$
    – Ian
    Jun 14, 2018 at 19:12
  • $\begingroup$ Welcome to MSE. It is in your best interest that you use MathJax. $\endgroup$ Jun 14, 2018 at 19:17
  • $\begingroup$ @Ian i can't integrate over the period because of the infinity disconnuity, or can i ? i am not really sure, i tried to integrate like we do in the fourier series to the a0 but didnt work, is there any other way? $\endgroup$
    – user28324
    Jun 14, 2018 at 20:10
  • $\begingroup$ @Ian the actual function is a little more compilcated than that but it's a sum of tans and cots $\endgroup$
    – user28324
    Jun 14, 2018 at 20:12
  • $\begingroup$ Multiply the data by $\sin 2x$ and extract the coefficient at $\sin 2x$ by Fourier integration in the new table. If you post the actual setup, we can discuss it too. $\endgroup$
    – fedja
    Jun 14, 2018 at 20:26

2 Answers 2

0
$\begingroup$

The function $$ g(x) = \tan x + {1 \over {\tan x}} = {2 \over {\sin \left( {2x} \right)}} $$ is periodic (of period $\pi$) and it is anti-symmetric $$ g(-x)=-g(x) $$

So its DC offset (average value) is zero. And that of your $f(x)$ is therefore $4$.

You can get the above result if you split the integral symmetrically between $-\pi/2+a,-b$ and $b, \pi/2-a$, and then take the limit for $a$ and $b$ going to $0$.

Since the $f(x)^2$ is not integrable in the period, you cannot get a Fourier transform.

$\endgroup$
0
$\begingroup$

I am not sure what you intend with your quest for DC offset, but I have a suggestion that may help. Simplify $\, \tan(x) + \cot(x) = 2 \csc(2x). \,$ This has simple poles at all integer multiples of $\,\pi/2.\,$ You can assume that any simple pole has DC offset of $\,0,\,$ which implies that the infinite sum does also.

In the situation where you have table of values, then you would need to identify the poles and their residues, namely $\, a/(x-b), \,$ and then subtract the pole values from all the values in the table. Then you can take the average of the resulting values to get the DC offset. The values for $\,b\,$ are easy to spot because of the discontinuity and shooting off to infinity. The value of $\,a\,$ is the residue or strength of the pole. You can estimate it by multiplying table values by $\,x-b\,$ when $\,x\,$ is near $\,b\,$ with the resulting values approaching $\,a.\,$

$\endgroup$
1
  • $\begingroup$ well, i can do that but i don't know the functions to begin with , i have a table of values and also the function is usually more complicated than that. $\endgroup$
    – user28324
    Jun 14, 2018 at 21:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .