Ok, for all cases N=14 and input 2037 as before. Also sampling frequency is 1Ghz (10^9), let's call it Fs.
"Cout" is the output carry sequence with range [-3,4] from the 3rd order SD modulator and length 2*2^(N+1)=65536 samples ( 2 full sequence cycles as with an odd input , max sequence 2^(N+1) is guaranteed).
For SciLab:
Frequency construction : f=Fs*(1:length/2)/length -- ( frequency vector from 0 to Fs/2)
1) SciLab plot using fft()
spectrum=abs(fft(Cout)/(length/2))
spectrum=spectrum(1:length/2)^2
plot2d("ln",f(1:length-1),10*log10(spectrum)) -- (argument "ln" means that the x axis is logarithmic and the y axis is normal )
2) SciLab plot using pspect() function
spectrum=pspect(length/2,length,'hn',Cout)
plot2d("ln",f,10*log10(Cout(1:length)))
The arguments in pspect() function are : offset of each data window,number of points in window, window type (here Hanning), sampled vector)
3) Cadence Virtuoso using fft()
Start time : x ns
Stop time : (x + 2*length) ns
sample count/Freq= 2*length -- ( same result if i chose "length" sample count , but the maximum frequency would be Fs/2 )
Start/end Freq= 15.26k to 1G
Window type : Rectangular -- ( little to no difference with Hanning)
4) Cadence Virtuoso using psd()
Start/Stop : Same as above
Number of samples : 2*length
Window : Hanning
Smoothing factor : 1
Windows size : 2*length
Detrending Mode : Mean
Coherent gain : default
Coherent gain factor : 1
5) Ideal curve
spectrum= 1/(12*2^(N+1))* (2*sin(pi*f/Fs))^6 -- ( 3rd order SD modulator )
plot2d("ln",f,10*log10(spectrum))