%priklady na DTFS, signaly na intervale clear all; close all; axis equal subplot(5,1,1) Tsig=10; %Tsig=4; A=3; Tbox=1; plot_points=100; tn=0:Tsig/plot_points:Tsig; syms ts; mysig_n=zeros(1,plot_points+1); mysig_n(1:Tbox/Tsig*plot_points)=A; mysig_s=A plot(tn,mysig_n); grid on; N=10 n=-N:N; product=mysig_s*exp(-i*n*2*pi/Tsig*ts) cn=1/Tsig*eval(int(product,ts,0,Tbox)); subplot(5,1,2); %stem(n,abs(cn)) stem(n/Tsig,abs(cn)) grid on; subplot(5,1,3); stem(n/Tsig,angle(cn)) grid on; recon=zeros(1,plot_points+1); actsig=cn(N+1) recon= recon + actsig; subplot(5,1,4); plot(tn,recon); hold on; for idx=1:N actsig=cn(N+1-idx)*exp(i*-idx*2*pi/Tsig*tn) + cn(N+1+idx)*exp(i*idx*2*pi/Tsig*tn) subplot(5,1,4); plot(tn,actsig); hold on; recon= recon + actsig; end grid on subplot(5,1,5); plot(tn,recon) grid on