env = abs(hilbert(x));
Here is some test code:
% create modulated signal
fc = 100;
fm = 17;
fs = 8000;
t = 0:1/fs:1;
x = sin(2*pi*fc*t) .* (1.5+sin(2*pi*fm*t));
plot(t, x);
%% get modulation envelope
env = abs(hilbert(x));
hold on;
plot(t, env, 'r');
hold off;
No comments:
Post a Comment