Obtaining the envelope of AM signal using hilbert transform
36 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
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
abs(hilbert(signal)))
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.
Thanks!
0 comentarios
Respuestas (2)
David Goodmanson
el 26 de Mzo. de 2021
Editada: David Goodmanson
el 26 de Mzo. de 2021
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;
figure(1)
plot(x,y); grid on
h = hilbert(y) + i*offset; % imaginary offset post hilbert
figure(2)
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 comentarios
Paul Hoffrichter
el 26 de Mzo. de 2021
So, to fix the problem, just remove the DC component from the signal. (If the DC component changes from one section of the signal to another, then adjust accordingly.)
% remove the DC component from y
ym = y - mean(y);
hm = hilbert(ym);
hmabs = abs(hm);
figure(4)
plot(x,real(hm),x,imag(hm),x,hmabs); grid on; title('abs(hm) with DC removed from signal')
Paul Hoffrichter
el 26 de Mzo. de 2021
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.
0 comentarios
Ver también
Categorías
Más información sobre Transforms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!