% this script is used to explain the FFT function
% with the addtional <为什么要进行傅立叶变换>
%----------------------------------------------
% Part1 Amplitude |
%----------------------------------------------
fs = 256;L =256; T=1/fs; %所以是1s的时长信号
t=(0:L-1)*T;
s=2+3*cos(2*pi*50*t-30*pi/180)+1.5*cos(2*pi*75*t+90*pi/180);
% i think the expression is clear enought to read
% what we do next is use a method to show the result
plot(t,s),xlabel('time(s)'),ylabel('Amplitude'),title('时域图');
% 时域图
complexAmplitude = fft(s);
fftA = abs(complexAmplitude);
fftA = fftA(1:L/2+1);
f = fs/2*lin