My question relates to Fourier transform of signals with different lengths in time but the same fixed length of the digitized signal with different sampling rates.

Specifically, how does the number of cycles recorded effect the SNR of the FFT spectrum of a signal given a fixed number of NFFT points(the number of samples recorded is kept constant)?

My first signal(square wave of frequency 500 Hz) was sampled at a sampling rate of 100 kilosamples/sec and the signal was sampled for 10 sec, so a total of 1000001 samples.

The second signal(square signal of frequency 500 Hz) i used was sampled for 0.02 seconds at a sampling rate of 50,000 kilo-samples/second. So again the data vector length was 1000001 samples.

The FFT spectrum that i got for signal 1 was much sharper and had a high SNR compared to signal 2(second signal). intuitively it makes more sense that the signal with more cycles would give a better result.

Is this correct ? more importantly can anyone help me in finding a quantitative relationship for this behavior?

your help will be much appreciated.


enter image description hereenter image description here

  • $\begingroup$ What do you mean by SNR? $\endgroup$
    – MBaz
    May 28, 2018 at 17:56
  • $\begingroup$ @MBaz Signal-to-Noise ratio $\endgroup$
    – PDuarte
    May 28, 2018 at 21:22
  • 1
    $\begingroup$ But what is the noise in your case? You don't mention any noise. $\endgroup$
    – MBaz
    May 28, 2018 at 21:51
  • $\begingroup$ Apologies, what i have not explained clearly is the fact that, there is no noise added to the signal. 'SNR' was a bad choice of words. What i meant simply was that the FFT of signal 2 is not the same as FFT of signal 1 and the values of FFT at frequencies like 1000 or 250 Hz etc is much higher than the FFT of signal 1. $\endgroup$
    – Mohsin.A
    May 29, 2018 at 11:38

1 Answer 1


Ok, so, what you need to understand is that FFT has particularities that if not taken into account produces erroneous conclusions out of its results. Firstly, both of your signals have the same SNR. Why? The way you described the problem led me understand that you tried to put two identical signals into different process paths to understand why they came out differently. Am I right? So, what are you really trying to ask is “Why both paths led to different results?”. If that’s the truth, allow me: - FFT can generate lobes around the real frequency in many cases: 1. when you are trying to see a frequency that is not part of the indexes when you selected the FFT lenght; 2. When you don’t use a proper window function prior to FFT analysis; 3. When you have a small window relative to the frequency you’re trying to see and you produce a discontinuity. This is because the FFT algorithm considers that everything you have in your analysis window is a periodic pattern. Probably the 3rd reason is letting you believe that your second measurement has a higher SNR when the truth is your window has only 10 periods of your frequency, and it’s much likely that you have a discontinuity between the beginning of it and the end. If you fix this discontinuity you should see a clear FFT in your second case.

  • $\begingroup$ I think i may have been unable to explain properly in my original question. $\endgroup$
    – Mohsin.A
    May 29, 2018 at 11:39
  • $\begingroup$ I think i may have been unable to explain properly in my original question. What i am simply saying is that why is the FFT in the second case is not as 'sharp' as the one for signal 1. and why mathematically is this different. When you say discontinuity, i believe you are talking about spectral leakage. i believe this is not the case for my simulatio $\endgroup$
    – Mohsin.A
    May 29, 2018 at 11:44
  • $\begingroup$ That’s the only explanation I see. The “sharpness” shouldn’t be a function of any the parameters you mentioned. You should also see evidences by visually checking that the energy in your 1st FFT is higher at 500Hz, while in the 2nd the energy in 500Hz is lower, meaning it has spread in the frequencies around 500. $\endgroup$
    – PDuarte
    May 29, 2018 at 12:07
  • $\begingroup$ so would it be correct to say that if the total number of samples acquired is kept constant, the FFT for both the signals should be same regardless of how many cycles are sampled ? $\endgroup$
    – Mohsin.A
    May 29, 2018 at 12:18
  • $\begingroup$ @Mohsin.A That’s correct, and this is due to the fact that the FFT considers the measurement window as a periodic function, meaning 1 cycle repeated infinite times is the same as 1000 cycles repeated infinite times. $\endgroup$
    – PDuarte
    May 29, 2018 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.