% consider the comparametric eq'n g=f+1, having d.c. sol'n f=log2(q), f=Q
Q=linspace(-3,3,6000);
f=1/2/pi*sin(2*pi*Q) + Q; % sine plus slope
q=2..^Q;
%% not used anywhere: F=log(f)/log(2);
grid
gset nokey
xlabel('q')
ylabel('f(q)')
%plot(q,f)
qintegers=[1/8 1/4 1/2 1 2 4 8];
fintegers=log(qintegers)/log(2);
ftrue=log(q)/log(2);
subplot(231);
axis(); % set axis to "normal"
plot(q,f,qintegers,fintegers,'+',qintegers,fintegers,"*",q,ftrue)
Qintegers=log(qintegers)/log(2);
subplot(232);
xlabel('Q')
ylabel('f(Q)')
plot(Q,f,Qintegers,fintegers,'+',Qintegers,fintegers,"*",Q,ftrue)
subplot(233); % Periodizer is df/dQ
xlabel('Q')
ylabel('df/dQ')
%%%axis([-3 3 -4 3])
Qt=Q(1:length(Q)-1); % Qtruncated
dfdQ=1000*diff(f);
dfintegers=1*ones(size(Qintegers));
x=[-3 3]; y=[1 1];
plot(Qt,dfdQ,Qintegers,dfintegers,'+',Qintegers,dfintegers,'*',x,y)
subplot(111);

