%qpskspec.m
fc=10;
Tb=1;
res=[];
Eb=1;
for f=-10:0.01:10
res=[res Eb*(sinc(2*f*Tb))ˆ(2)];
end
u=isnan(res);
[p,q]=find(u==1)
for i=1:1:length(p)
res(q(i))=1;
end
f=-10:0.01:10;
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)