MATLAB Answers

Obtaining the envelope of AM signal using hilbert transform

23 ビュー (過去 30 日間)
Bernardo Pinto
Bernardo Pinto 2021 年 3 月 25 日
コメント済み: Bernardo Pinto 2021 年 3 月 26 日
I have an amplitude modulated signal and want to extract the envelope
I tried using the hilbert transform and use the absolute value to obtain the amplitude.
The figure shows the original signal (wich is also the real part of the hilbert function) in red the imaginary part in blue and the envelope. I obtain the envelope as
As you can see the envelope is not smooth and shows part of the carrier signal.
I'm wondering how to obtain a better estimate of the amplitude (and phase) of the signal.

回答 (2 件)

David Goodmanson
David Goodmanson 2021 年 3 月 26 日
編集済み: David Goodmanson 2021 年 3 月 26 日
Hi Bernardo,
I don't think there is much doubt that the effect is due to a DC offset in the signal. In your figure, both the real and imaginary parts are shifted upward slightly as shown by the position of the positive and negative peaks. This code
x = (0:9999)/10000;
offset = .04;
y = cos(2*pi*10*x) + offset;
plot(x,y); grid on
h = hilbert(y) + i*offset; % imaginary offset post hilbert
plot(x,real(h),x,imag(h),x,abs(h)); grid on
shows the effect, with real in blue and imaginary in red. Setting offset = 0 gives a flat line for the envelope as expected.
The problem is, it is easy enough to presume an offset in the original real signal. But for hilbert, the imaginary part of the analytic signal has no DC offset. In order to reproduce your plot I had to apply a DC offset to the imaginary part after using hilbert.
  2 件のコメント
Bernardo Pinto
Bernardo Pinto 2021 年 3 月 26 日
The DC problem seems to be the case.
I think I need to do the average over a integer number of cycles in order for the mean to reflect the DC bias. Will substracting the mean fix the problem if you have a non integer number of cycles?
Greetings Bernardo


Paul Hoffrichter
Paul Hoffrichter 2021 年 3 月 26 日
In general, if you increase the carrier frequency, you will get a better envelope.
Specific to your figure, to remove the ripple, you can take the FFT of your resultant envelope signal in the middle region avoiding the AM amplitude shift from low to high and high to low (which will show up in the fft as the highest frequencies). Between the DC and the highest frequencies should be a fairly distince ripple frequency. You can now apply a notch filter to remove the ripple.

Community Treasure Hunt

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

Start Hunting!

Translated by