Hi Fabio,
Good observation. The reason for this is when there are an exact integer number of cycles in the time record, you have a periodic trig function and the fft gives the peak that you expect. When there are not an exact integer number of cycles in the time record, the function is still periodic in the time record (by definition of the fft), but the function being repeated is a trig function that's lopped off at the end. That function requires frequencies other than the fundamental to define it, which takes away from the amplitude of the fundamental and spreads the peak in the frequency domain.
For a time record of length T, the number of cycles n = fT, and here
T = N/fs = 2/3 sec
f = ii+10 (in Hz)
and
n = (ii+10)*2/3
Then n is an integer and you get a full peak a third of the time, when ii+10 is divisible by 3.
Best Answer