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