Thursday 11 August 2016

Envelope of time domain signal // Hilbert transform


to get the envelope of a time domain signal, s(t), I use the absolute of its analytical time domain signal. But there occur the problem that sometimes the envelope is not as desired a true envelope but it follows more or less the original time domain signal.


Just for illustration some python code where the plot looks good:


from pylab import *
import numpy
import scipy.signal.signaltools as sigtool


x = linspace(0,5,1e4)

s= numpy.sin(2*numpy.pi*x)*numpy.exp(-x**2/2)
env = numpy.abs(sigtool.hilbert(s)) # hilbert(s) actually returns the analytical signal

plot(x,s,label='Time Signal')
plot(x,env,label='Envelope')
legend()
show()


By changing the data for example to (taking abs):


s = numpy.abs(numpy.sin(2*numpy.pi*x)*numpy.exp(-x**2/2))

the resulting envelope is following the "ripples" instead of being an envelope.


--- WHY? ---




No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...