Digital frequency spectrum analysis is widely used in signal processing and analyzing, which indicates the physical information and characteristics of components in a signal. According to the Nyquist sampling theorem, a sampling procedure is required to convert a continuous time signal into a discrete time signal, and the sampling rate should be more than twice the signal's maximum frequency. After sampling, windowing is used to truncate the signal and avoid spectrum leakage. Different windows are applied in different situations due to their different function expressions with different characteristics and they have different main lobe width and different side lobe levels. Discrete Fourier transform (DFT) process is needed to sample the signal after windowing. N-point DFT means sampling () j w Xe with the interval of 2/ N but the larger N does not guarantee a better performance of DFT signal. Fast Fourier transform (FFT) is a fast algorithm to calculate the DFT and often used in signal processing technology because of its obvious advantages of small computation and fast calculation. There are two typical functions in MATLAB which carry the FFT sequence with different functions. This paper introduces basic definitions of sampling and using Nyquist sampling theorem to determine sampling rate, compares different window functions and discusses how DFT length effect the frequency spectrum analysis.