![]() This code does not use any function from the symbolic toolbox that may not be available depending on your version of MATLAB. Fourier (x): In this method, x is the time domain function whereas the independent variable is determined by symvar and the transformation variable is w by default. Input can be provided to the Fourier function using 3 different syntaxes. X(i) = xt(t(i),N) % calculates the value for each t(i) in the array t In MATLAB, the Fourier command returns the Fourier transform of a given function. t = -2*T:T/100:T*2 % plots from -2T to 2T, with a step of T/100 Now, the (truncated) Fourier series may be give as: xt (t,n) 4A/pisum(a(1:n).sin(w(1:n)t)) fourier series This is a function of the number of terms n you want to include in your approximation of the infinite series and the also a number of the independent variable t. If you want to create a plot of the function, you must create the independent variable array and the dependent variable array. This is a function of the number of terms n you want to include in your approximation of the infinite series and the also a number of the independent variable t. ![]() Now, the (truncated) Fourier series may be give as: xt = 4*A/pi*sum(a(1:n).*sin(w(1:n)*t)) % fourier series ![]() Now, the amplitude and frequency as function of the iterator n is: a = 1./(2*n-1) % amplitude Using the values you provided, you have: A = 10 You can create a function of the amplitude and frequency of the term inside the summation, depending only on n - the dummy variable.
0 Comments
Leave a Reply. |