Hi Kostas,
In the two spectra I see two superimposed plots. Why? Nevertheless, the spectrum is clear.
1) The distorsion is probably an artifact due to the high pole. This spourious signal should not be there. Why dont’you use an ideal integrator K/s?
2) Note that the two spectra are identical except for scale factors. The factor in frequency is the ratio of the sampling frequencies 1e7/3.2e6=3.125. The difference in vertical scale is 4.945 dB, that is 10*log10(1e7/3.2e6). I think that this is because you used two different sampling frequencies but the same call: spektrumfromdata(yout,1e4,3.2e6,100,1). The third parameter is the sampling frequency, and it should be 1e7 for the other case.
Anyway, there is still something wrong (the peak doesn’t appear at 10 KHz in neither case).
3) The spectrum should have two spectral lineas: a peak at DC (frequency=0) and another one at the frequency of the signal. Both are present. The other lines at higher frequencies correspond to the high-frequency spourious seen in the data: there are a fundamental frequency and its harmonics. You should try the ideal integrator as said in 1).
Let me know.
Regards,
Z