One , code implementation
%% Discrete time Fourier transform DTFT
% if x（t）=cos(2*pi*t), The sampling time was 0.1s, Get one 32 Finite sequence of , utilize matlab Count him DFT And draw the image ; clear;
ts=0.1;% Sampling time fs=1/ts;% cycle N=32;% Total sampling times n=0:N-1; xn=cos(2*pi*n*ts);% Take discrete signal data
stem(n,xn);% Drawing time domain sampling diagram title(' Time domain sampling diagram '); k=0:N-1; wn=exp(-j*2*pi/N); nk=n'*k;
wnnk=wn.^nk; xk=xn*wnnk; figure; subplot(2,1,1); stem(k*fs/N,abs(xk));
xlabel(' Amplitude frequency characteristic '); subplot(2,1,2); stem(k*fs/N,angle(xk)); xlabel(' Phase frequency characteristics ');

Two , Amplitude frequency characteristic

The amplitude frequency characteristic refers to the frequency response of the system
<https://baike.baidu.com/item/%E9%A2%91%E7%8E%87%E5%93%8D%E5%BA%94>
The curve of amplitude versus frequency , The area with large amplitude corresponds to passband , That is to say, the corresponding frequency component has a small attenuation through the system , Small amplitude corresponds to stopband , In other words, the corresponding frequency component has a large attenuation through the system , According to this characteristic , It can be used to observe and compare the filter , Observe whether it meets the requirements, that is to say
wave filter <https://baike.baidu.com/item/%E6%BB%A4%E6%B3%A2%E5%99%A8> Technical indicators of .

Three , Phase frequency characteristics