Monday, September 22, 2014

Drop-In Gallery

Have a folder of images on a server running PHP?
Just drop-in a file to make it an online gallery!

Details here.
Or download the code here.

Envelope Detector for Modulated Signals

The following line of code will find the envelope of a modulated signal in Matlab.

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;