Tweeted twitter.com/#!/StackSignals/status/434048163536965632 occurred Feb 13 '14 at 19:35 5 added 25 characters in body edited Jan 5 '14 at 17:51 eeecoder 15111 silver badge66 bronze badges After decoding process I am using a lowpass filterlowpass filter to remove some noiseunwanted high frequency harmonics. After decoding process I am using a lowpass filter to remove some noise. After decoding process I am using a lowpass filter to remove unwanted high frequency harmonics. 4 added 2297 characters in body edited Jan 5 '14 at 10:23 eeecoder 15111 silver badge66 bronze badges Here is used codes for adaptive delta modulation:  function [ cn ] = adm_enc( signal ) delta_min = 0.6250/5; % minimum step size k=1.5; m = 0.85 % scaling constant L = length(signal); % length of input signal Mq = zeros(1,L); %aproximated or quintized signal dq = zeros(1,L); %quantized error or difference between original signal and aproximated signal cn = zeros(1,L); %encoded output as a binary signal delta=ones(1,L); for n=2:L d = signal(n) - Mq(n-1); % error or difference between input (original) signal and approximation if d>0 % if error is greater than 0 dq(n)=delta_min; % equate output to delta_min else dq(n)=-1.*delta_min; % equate output to -delta_min end if dq(n)==dq(n-1) && dq(n-1) == dq(n-2) % if two previous outputs are equal delta(n)=k.*delta(n-1); % scale step size else delta(n)=delta_min; % otherwise equate output to min step size end Mq(n) = Mq(n-1) + delta(n).*dq(n); % calculate approximation signal end for i=1:length(cn) % encode the output as a binary signal if dq(i)==delta_min cn(i)=1; else cn(i)=0; end end end Codes used for adaptive delta demodulation (decoding process): function [ signal ] = adm_dec( cn ) delta_min = 0.6250/5; % minimum step size L = length(cn); % length of input signal k=1.5; % scaling constant signal = zeros(1,L); % initializations delta=ones(1,L); for i=1:length(cn) % decode binary input as output of adm if cn(i)==1 Mq(i)=delta_min; else Mq(i)=-1.*delta_min; end end for n=2:L if Mq(n)==Mq(n-1) % if two sequential input values are equal delta(n)=k.*delta(n-1); % scale step size else delta(n)=delta_min; % otherwise equate step size to min step size end signal(n) = signal(n-1) + delta(n).*Mq(n); % calculate output of adm end end  After decoding process I am using a lowpass filter to remove some noise. Here is used codes for adaptive delta modulation:  function [ cn ] = adm_enc( signal ) delta_min = 0.6250/5; % minimum step size k=1.5; m = 0.85 % scaling constant L = length(signal); % length of input signal Mq = zeros(1,L); %aproximated or quintized signal dq = zeros(1,L); %quantized error or difference between original signal and aproximated signal cn = zeros(1,L); %encoded output as a binary signal delta=ones(1,L); for n=2:L d = signal(n) - Mq(n-1); % error or difference between input (original) signal and approximation if d>0 % if error is greater than 0 dq(n)=delta_min; % equate output to delta_min else dq(n)=-1.*delta_min; % equate output to -delta_min end if dq(n)==dq(n-1) && dq(n-1) == dq(n-2) % if two previous outputs are equal delta(n)=k.*delta(n-1); % scale step size else delta(n)=delta_min; % otherwise equate output to min step size end Mq(n) = Mq(n-1) + delta(n).*dq(n); % calculate approximation signal end for i=1:length(cn) % encode the output as a binary signal if dq(i)==delta_min cn(i)=1; else cn(i)=0; end end end Codes used for adaptive delta demodulation (decoding process): function [ signal ] = adm_dec( cn ) delta_min = 0.6250/5; % minimum step size L = length(cn); % length of input signal k=1.5; % scaling constant signal = zeros(1,L); % initializations delta=ones(1,L); for i=1:length(cn) % decode binary input as output of adm if cn(i)==1 Mq(i)=delta_min; else Mq(i)=-1.*delta_min; end end for n=2:L if Mq(n)==Mq(n-1) % if two sequential input values are equal delta(n)=k.*delta(n-1); % scale step size else delta(n)=delta_min; % otherwise equate step size to min step size end signal(n) = signal(n-1) + delta(n).*Mq(n); % calculate output of adm end end  After decoding process I am using a lowpass filter to remove some noise. 3 edited tags | link edited Jan 5 '14 at 10:19 Phonon 3,68033 gold badges2929 silver badges6060 bronze badges 2 change code format edit approved Jan 4 '14 at 20:28 lennon310 3,27744 gold badges1616 silver badges2222 bronze badges 1 asked Jan 4 '14 at 10:49 eeecoder 15111 silver badge66 bronze badges