how can plot this Periodic Signal with E Amplitude using Matalb and calculate FFT for it.

1 次查看(过去 30 天)
  2 个评论
Walter Roberson
Walter Roberson 2015-7-17
The value is ambiguous at t = T/2, being both +E and -E. Your ranges are inclusive so the boundary conditions are part of two different ranges, but it only makes a difference at t = T/2

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2015-7-18
编辑:Star Strider 2015-7-23
You’re not calculating the fft but the analytic Fourier transform. To do this, use the definition of the Fourier transform of x(t):
X(w) = int(x(t) * exp(j*w*t), t, T1, T2)
defining w=2*pi*f.
Specifically, with the Symbolic Math Toolbox:
syms E T t w
S1 = int(4*E/T*t * exp(j*w*t), t, 0, T/4);
S2 = int(E * exp(j*w*t), t, T/4, T/2);
S3 = int(-E * exp(j*w*t), t, T/2, 3*T/4);
S4 = int(4*E/T*(t-T) * exp(j*w*t), t, 3*T/4, T);
X(w) = S1 + S2 + S3 + S4;
X(w) = simplify(collect(X(w))) % Exponential Expression
X(w) = simplify(collect(rewrite(X(w), 'sincos'))) % Trigonometric Expression
X(w) =
-(4*E - 4*E*exp(T*w*1i) - 4*E*exp((T*w*1i)/4) + 4*E*exp((T*w*3i)/4) + E*T*w*exp((T*w*1i)/2)*2i - E*T*w*exp((T*w*3i)/2)*1i + E*T*w*exp((T*w*3i)/4)*1i)/(T*w^2)
X(w) =
((E*T*cos((3*T*w)/2)*1i + 2*E*T*sin((T*w)/2) - E*T*sin((3*T*w)/2) + E*T*sin((3*T*w)/4) - E*T*cos((3*T*w)/4)*1i - E*T*cos((T*w)/2)*2i)*w + 4*E*cos(T*w) - 4*E + 4*E*cos((T*w)/4) - 4*E*cos((3*T*w)/4) + E*sin(T*w)*4i + E*sin((T*w)/4)*4i - E*sin((3*T*w)/4)*4i)/(T*w^2)
  7 个评论
abdo daood
abdo daood 2015-7-22
>> >> C(1)
ans =
- (((pi*1i)/2 - 1)*5i)/pi^2 + ((pi*1i + 2 - 2i)*5i)/(2*pi^2) + (- 5/2 + 5i/2)/pi - 5/pi^2
>> ans =
-0.7958 + 1.8090i
so the real term is not zero ???? are there problem in my code ??
Star Strider
Star Strider 2015-7-22
编辑:Star Strider 2015-7-23
The constant term is X(0) because it is the direct-current term where omega is zero. When I evaluate it as my X(w)/T, it equals 1.25. That may be an artifact of the way the waveform was defined. (The X(0) value should never be complex.) I calculated it exactly the way the problem defined it, and calculated the Fourier transform, not the Fourier series, so there was no ‘k’ term because no sampling interval or sampling frequency was stated in the problem you posted. I trust the maths.
The use of -j or +j in the Fourier transform is a matter of convention. (I followed the convention in the MATLAB documentation.) Both are correct, so long as the opposite signs are used in the Fourier and inverse Fourier transforms.
The integral from -Inf to +Inf is not appropriate to this waveform because it is not defined as a periodic function, at least as the problem was posted. It was defined as a single pulse on the interval (0,T).
EDIT — There was a typographical error in transcribing ‘S3’. It should be:
S3 = int(-E * exp(j*w*t), t, T/2, 3*T/4);
With that correction, everything works.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by