Are you sure you did your hand calculation correctly? I think the second result is correct.
The result you are seeing is due to aliasing. Your signal x has a 250Hz component of about 3.6 (= 1.8*2), and 750Hz component of exactly 0.5 (=0.25*2).
In the first plot, you have sampled the signal at 1000Hz, which means any component over half that (500Hz) will get picked up as a lower frequency signal. In this case the 750 Hz signal ends up getting picked up as a 750-500 = 250 Hz signal. So the peaks at 250Hz end up being 1.8+0.2 = 2, which is not correct.
In the second plot, you are sampling at 2000Hz, and you can see all frequencies up to 2000/2 = 1000Hz. In that case, the 750Hz component is correctly identified, and you get two frequency peaks, one at 250Hz with amplitude 1.8, and one at 750Hz with amplitude 0.2.
Best Answer