Envelope extraction of a time domain signal

5 views (last 30 days)
I have a signal like this: t=[-10*10^(-9):0.0001*10^(-9):10*10^(-9)]; dt=394*10^(-15); betaL=1.2378*10^(-21); tao=15*10^(-12); i=0.5*exp(-(t./betaL.*dt).^2./(4*log(2))).*(1+cos(tao.*t./betaL)); I want to get its envelop so I tried Hilbert Transformation in this way: Y = hilbert(i); am = abs(Y); but it is not what I want, I want the envelope that goes through the peaks smoothly. Is there anybody know about this problem? Thank you very much!
CODE: t=[-10*10^(-9):0.0001*10^(-9):10*10^(-9)]; dt=394*10^(-15); betaL=1.2378*10^(-21); tao=15*10^(-12); i=0.5*exp(-(t./betaL.*dt).^2./(4*log(2))).*(1+cos(tao.*t./betaL)); Y = hilbert(i); am = abs(Y); plot(t,i,t,am)

Accepted Answer

Mark Schwab
Mark Schwab on 26 Jan 2018
If you are not concerned with the length of the envelope signal you can use the "findpeaks" function.
[pks, locs] = findpeaks(i); % Where pks is a vector with amplitude of peaks and locs is a vector of peak indeces
envelope = interp(pks,floor(length(i)/length(pks)); % Interpolate peaks to vector close in size to i
Please note that the interpolation function only works with integer multiples of length so this will not produce an envelope vector equal in size to the original signal. You can refer to the following MATLAB answers post for more information on this:
Also, I have included a link to the findpeaks function documentation for your convenience:

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!