clear

R = 33;
C = 100e-12;
freq = 6.5e6;
period = 0.5 / freq;
dt = .1e-9;

time = 0:dt:period;

inSig = [zeros(1, length(time)) 3.3*ones(1, length(time)) zeros(1, length(time)) 3.3*ones(1, length(time)) zeros(1, length(time))];
alpha = dt / (R*C + dt);

%   y[i] = y[i-1] + alpha * (x[i] - y[i-1])
outSig(1) = 0;
for i=2:length(inSig)
   outSig(i) = outSig(i-1) + alpha * (inSig(i) - outSig(i-1));
end
 
index = 1:length(inSig);
time = dt * index;
plot(time,inSig,time,outSig)