Envelope extraction of a time domain signal

조회 수: 8 (최근 30일)
Lijie Zhao
Lijie Zhao 2018년 1월 24일
답변: Mark Schwab 2018년 1월 26일
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)

채택된 답변

Mark Schwab
Mark Schwab 2018년 1월 26일
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:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 描述性统计量에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!