You will only ask this question if you have not studied signal processing. The reason why the second sentence is divided by 2 is because of the sampling theorem. The maximum frequency obtained by fft is half of the sampling frequency, and because the odd or even number of wav points is not known, round is used; the third sentence is to generate a sequence, and this sequence is The second and third sentences can calculate the relationship sequence between the frequency value after fft and the sampling frequency; the fifth sentence is to calculate the frequency value after fft based on the sampling frequency fs and the relationship sequence; so the last sentence should be plot(f, abs(fwav(1:lwav))); This is the standard FFT program. The most interesting thing about FFT is that FFT can only get the y-axis value on the ordinate, while the frequency value on the abscissa needs to be calculated manually based on the sampling frequency.