%mskspec.m
fc=10;
Tb=1;
res=[];
Eb=1;
for f=-10:0.01:10
res=[res (8*Eb/pi^2)*(cos(2*pi*Tb*f)/(16*(Tb^2)*(f^2)-1))^2];
end
f=-10:0.01:10;
[p,q]=find(res==inf);
for i=1:1:length(p)
res(q(i))=(res(q(i)-1)+res(q(i)+1))/2
end
part1=[zeros(1,length(f)) res];
f1=f-fc;
f2=f+fc;
final=[f1 f2];
part2=[res zeros(1,length(f))];
figure
plot(final,part1)
hold on
plot(final,part2)
