フィルターのクリア

Hi , I have a problem with phase plot for Fourier series coefficients for periodic function exp(-t/2) , why phase plot is not odd function ?

1 回表示 (過去 30 日間)
% FS for exp(-t/2) periodic signal
% Compelx exponential FS
clc
clear;
a=0
b=pi
T0=b-a
N=11
F0=1/T0
wi=[-N:N]*2*pi/T0;
t=(a:0.2:b)';
D=zeros(2*N+1,1);
xt=exp(-0.5*t);
fun1 = @(t)exp(-0.5*t);
q1 = integral(fun1, a,b);
D(N+1)=q1/T0;
for n=1:N;
fun2 = @(t)exp(-0.5*t).*(exp(-j*2*pi*n*F0*t));
q2= integral(fun2,a,b,'ArrayValued',true);
D(N+1+n)=q2/T0;
fun3 = @(t)exp(-0.5*t).*(exp(j*2*pi*n*F0*t));
q3= integral(fun2,a,b,'ArrayValued',true);
D(N+1-n)=q3/T0;
end
% I Repeat the triangle pulse and plot for 7 periods
M=3; % The number of periods needed
tp=[];
xtp=[];
for i=-M:M
tp=[tp i*T0+t];
xtp=[xtp xt];
end
subplot(311)
plot(tp,xtp)
set(gca,'XMinorTick','on','YMinorTick','on')
ylabel('Peiodic decayed exponential function')
grid on
grid minor
subplot(312)
stem(-N:N,abs(D))
set(gca,'XMinorTick','on','YMinorTick','on')
ylabel('abs D_n')
grid on
grid minor
subplot(313)
stem(-N:N,angle(D))
set(gca,'XMinorTick','on','YMinorTick','on')
ylabel('Angle D_n')
grid on
grid minor
  2 件のコメント
Dimitris Kalogiros
Dimitris Kalogiros 2018 年 10 月 11 日
Use this button:
...in order to present your code under a "readable" format.
Mohamad
Mohamad 2018 年 10 月 11 日
% FS for exp(-t/2) periodic signal % Compelx exponential FS clc clear; a=0 b=pi T0=b-a N=11 F0=1/T0 wi=[-N:N]*2*pi/T0; t=(a:0.2:b)'; D=zeros(2*N+1,1); xt=exp(-0.5*t); fun1 = @(t)exp(-0.5*t); q1 = integral(fun1, a,b); D(N+1)=q1/T0; for n=1:N; fun2 = @(t)exp(-0.5*t).*(exp(-j*2*pi*n*F0*t)); q2= integral(fun2,a,b,'ArrayValued',true); D(N+1+n)=q2/T0; fun3 = @(t)exp(-0.5*t).*(exp(j*2*pi*n*F0*t)); q3= integral(fun2,a,b,'ArrayValued',true); D(N+1-n)=q3/T0; end % I Repeat the triangle pulse and plot for 7 periods M=3; % The number of periods needed tp=[]; xtp=[]; for i=-M:M tp=[tp i*T0+t]; xtp=[xtp xt]; end
subplot(311) plot(tp,xtp) set(gca,'XMinorTick','on','YMinorTick','on') ylabel('Peiodic decayed exponential function') grid on grid minor subplot(312) stem(-N:N,abs(D)) set(gca,'XMinorTick','on','YMinorTick','on') ylabel('abs D_n') grid on grid minor subplot(313) stem(-N:N,angle(D)) set(gca,'XMinorTick','on','YMinorTick','on') ylabel('Angle D_n') grid on grid minor

サインインしてコメントする。

採用された回答

Torsten
Torsten 2018 年 10 月 11 日
q3= integral(fun3,a,b,'ArrayValued',true);
instead of
q3= integral(fun2,a,b,'ArrayValued',true);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by