dc offset in discontinous functions

93 Views Asked by At

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

2

There are 2 best solutions below

1
On

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.\,$

0
On

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.