|  | 
 
| [i = s] This post was last edited by wanglu3716 at 2021-6-5 21:45 [/ i] 
 %% 200khz
 CLC
 Clear all
 Close All
 
 f = 200000;% frequency of 200kHz
 FS = 2e7;% sampling rate (time incremental step)
 N = 500;% 5 wave number sampling points
 
 T = 0: 1 / fs: (n-1) / fs;% time
 L = Length (T);% time length
 C = sin (2 * pi * f * t);% sinusoidal signal
 H = HANN (500);% Hanning window function
 S = h. * c ';% amplitude
 P = FFT (s);% Fast Fourier transformation
 P1 = ABS (P / L);
 P2 = P1 (1: l / 2 + 1);
 P2 (2: end-1) = 2 * p2 (2: End-1);
 FF = fs * (0: (l / 2)) / L;% frequency (X-axis in the frequency domain)
 Temp1 = [t 's];% corresponds to the time and the amplitude
 Figure (1)
 Plot (T, S)% time domain drawing
 Temp2 = [ff 'p2];% corresponds to the frequency and the amplitude
 Figure (2)
 Plot (ff, p2)
 % Xlswrite ('s_200khz_hann.xlsx', Temp)% is written to Excel (remove the comment number when you write)
 | 
 |