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