|
|
| my_amdemod(s, fc, fs)
|
function s_demod = my_amdemod(s, fc, fs)
% here is the function for demodulating the original signal from the
% modulated signal, s is the modulated signal fc and fs are the same.
%santosh shah, The LNM IIT Jaipur (India)(santosh.jnt@gmail.com) 20/04/07
% butterworth filter parameter
N = 8 ; % filter order
fcut = fc /2;
% absolute value of the modulated signal
s_abs = abs(s);
% filtering with butterworth
[b, a] = butter(N, 2*fcut / fs, 'low');
%freqz(b,a,fcut,fs),title('frequency responce of the LPF');
s_filt = filter(b, a, s_abs);
% remove the means
s_rmvmn = (s_filt - mean(s_filt));
%biasing the signal aroung -1 and 1 V
s_demod = s_rmvmn / max(abs(s_rmvmn));
end
|
|
Contact us at files@mathworks.com