%Matlab code for Fourier Series
clear all
close all
%All time values
x=linspace(-1,3,3001);
%Loop for creating the function
for i=1:length(x)
if x(i)>-1 && x(i)<=0
zz(i)=x(i);
elseif x(i)>0 && x(i)<=2
zz(i)=2+2.*x(i)-(x(i)).^2;
else
zz(i)=2;
end
end
%Plotting the function
hold on
plot(x,zz,'Linewidth',4)
a1=x(1); b1=x(end);
l=(b1-a1)/2;
%Fourier series of the function for finding a and b
coefficients
fprintf('First 10 terms of Fourier series\n')
for j=1:50
ss1=zz.*cos(j*pi*x/l);
%all a values of the Fourier series
aa(j)=(1/l)*trapz(x,ss1);
ss2=zz.*sin(j*pi*x/l);
%all b values of the Fourier series
bb(j)=(1/l)*trapz(x,ss2);
if j<=10
fprintf('\tFourier term
a(%d) is %f\n',j,aa(j))
fprintf('\tFourier term
b(%d) is %f\n\n',j,bb(j))
end
end
N=[1 2 3 5 10 20 50];
%a0 value of Fourier series
aa0=(1/l)*trapz(x,zz);
s=aa0/2; k=1;
%Fourier series of the function
for i=1:50
s=s+bb(i)*sin(i*pi*x/l)+aa(i)*cos(i*pi*x/l);
if i==N(k)
k=k+1;
plot(x,s)
lgnd{k}=sprintf('fourier
term=%d',i);
end
end
lgnd{1}='Actual data';
%Plotting Fourier series of the function
xlabel('time')
ylabel('f(t)')
title('Fourier series of given function')
legend(lgnd,'Location','northwest')
%%%%%%%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%%%%%
Consider the function -1.0<xs0 0<x S 2 r. (a) Find the Fourier series of the function(x) (b) Use any graphing software to plot the function (x) (c) Graph the partial sums Sfor N-1,2,3,,10,2050 in ONE graph. (d) Analyse your results. END Consider the function -1.0
Consider the function -1.0xs0 0cxs2 x: 2 + 2x-x": 2: (x) = (a) Find the Fourier series of the function(x) (b) Use any graphing software to plot the function ,f(x). (c) Graph the partial sums S (x) for N 1,2,3,5,10,20,50 in ONE graph (d) Analyse your results. Consider the function -1.0xs0 0cxs2 x: 2 + 2x-x": 2: (x) = (a) Find the Fourier series of the function(x) (b) Use any graphing software to plot the function ,f(x). (c) Graph the...
11.1 and 11.2 Fourier Series Q1 Find the Fourier series of the given function f(x), which is assumed to have the period 2π. Show the details of your work. Sketch or graph the partial sums up to that including cos 5x and sin 5x. Note: Plot the partial sum using MATLAB. Hint: Make use of your knowledge of the line equation to find f(x) from the given graph. -π 0 11.1 and 11.2 Fourier Series Q1 Find the Fourier series...
Consider the function y = x2 for x E (-7,7) . a) Show that the Fourier series of this function is n cos(nz) . b) (i) Sketch the first three partial sums on (-π, π) (ii) Sketch the function to which the series converges to on R . c) Use your Fourier series to prove that 2and1)"+1T2 12 2 2 Tu . d) Find the complex form of the Fourier series of r2. . e) Use Parseval's theorem to prove...
(1 point) Consider the Fourier sine series: ) 14, sin( f(z) a. Find the Fourier coefficients for the function f(x)-9, 0, TL b. Use the computer to draw the Fourier sine series of f(x), for x E-15, 151, showing clearly all points of convergence. Also, show the graphs with the partial sums of the Fourier series using n = 5 and n = 20 terms. (1 point) Consider the Fourier sine series: ) 14, sin( f(z) a. Find the Fourier...
12-21 FOURIER SERIES Find the Fourier series of the given function f(x), which is assumed to have the period 2T. Show the details of your work. Sketch or graph the partial sums up to that including cos 5x and sin 5x. 9. f(x) - 12-21 FOURIER SERIES Find the Fourier series of the given function f(x), which is assumed to have the period 2T. Show the details of your work. Sketch or graph the partial sums up to that including...
1 point) Consider the Fourier series: nTTc a. Find the Fourier coefficients for the function f(x) 1.2 an b. Use the computer to draw the Fourier series of f(a), for x E[-18, 18], showing clearly all points of convergence. Also, show the graphs with the partial sums of the Fourier series using n5 and n20 terms. What do you observe? 1 point) Consider the Fourier series: nTTc a. Find the Fourier coefficients for the function f(x) 1.2 an b. Use...
Please solve for part (b) and (c) thank you! 1. Consider the function f(x) = e-x defined on the interval 0 < x < 1. (a) Give an odd and an even extension of this function onto the interval -1 < x < 1. Your answer can be in the form of an expression, or as a clearly labelled graph. [2 marks] (b) Obtain the Fourier sine and cosine representation for the functions found above. Hint: use integration by parts....
2) (15 marks) Consider the function ffo E [0,1 (a) Construct the even extension of f and find its Fourier series. You may use MuPAD to check your calculations, but you will have to show your working for computing each integral to get any marks. (b) Construct the odd extension of f and find its Fourier series. You may use MuPAD to check your calculations, but you will have to show your working for computing each integral to get any...
l etisalat 5:45 PM 슐 moodle.ud.ac.ae 11.1 and 11.2 Fourier Series Q1 Find the Fourier series of the given function f(x), which is assumed to have the period 2π. Show the details of your work. Sketch or graph the partial sums up to that including cos 5x and sin 5x Note: Plot the partial sum using MATLAB Hint: Make use of your knowledge of the line equation to find f) from the given graph. 2 Find the Fourier integral representation...