function Sig = EnvelopeDetector( ModSig, b_Lp )
% EnvelopeDetector - non-coherent AM demodulator
%
% Absolute value of ModSig is lowpass filtered using FIR filter with
% coefficients b_Lp. Then, mean (DC) is removed and signal is scaled so
% that the maximum sample value is 1.
%
% Syntax:
%
% Sig = EnvelopeDetector( ModSig, b_Lp );

% Author: BPP

Sig = filter( b_Lp, [1], abs(ModSig) );

% remove mean and scale
Sig = Sig - mean(Sig);
Sig = Sig/max(abs(Sig));
