




%Matlab code for Fourier Series
clear all
close all
%All time values
X=linspace(-pi,pi,1001);
%Loop for creating the function
for i=1:length(X)
if X(i)>=-pi && X(i)<0
zz(i)=(X(i)).^2;
else
zz(i)=pi^2;
end
end
figure(1)
%Plotting the function
hold on
plot(X,zz)
xlabel('x')
ylabel('f(x)')
title('Plotting of Actual data and Fourier sum for 4 terms')
%fourier series
a0=4*pi^2/3;
an=@(n) (2./(n.^2)).*cos(n*pi);
bn=@(n) pi./n+(2./(n.^3*pi)).*(1-cos(n.*pi));
s=a0/2;
for nn=1:4
s=s+an(nn).*cos(nn.*X)+bn(nn).*sin(nn.*X);
end
plot(X,s)
legend('Actual data','Fourier sum ')
grid on
%%%%%%%%%%%%%% End of Code %%%%%%%%%%%
3. Consider the function f(t) = ' π2 , with f(t) = f(t +2r). 0<t<π (a)...
Consider the function f(t)= -r< t〈0, with fit (a) Sketch f(t) by hand for-3r 〈 t 〈 3T. (b) Determine the general Fourier Series for f(t)
Consider the function f(t)= -r
4. Consider the periodic function 0, -1<t<- f(t) cos(#(t + 1)), } <t< 0 cos(at), 0<t< 0, }<t<i with f(t) = f(t+2). (a) Determine a general expression for the Fourier series of f. (b) Use MATLAB to plot both f and the sum of the first 5 non-zero terms of the Fourier series for f on the same set of axes for -1<t<3.
3. Consider the periodic function defined by -ae sin(x) 0 x < 7T f(x) and f(x) f(x2t) - (a) Sketch f(x) on the interval -37 < x < 3T. (b) Find the complex Fourier series of f(x) and obtain from it the regular Fourier series
Problem 1. Expand f(x) em 1. Expand fo) (1.0 ,-π < x < 0 0, 0<X<T in a sine, cosine Fourier series. write out a few 0, 0<x<π in sine,cosine Fourier series Write out aferw terms of the series
1. Consider the function defined by 1- x2, 0< |x| < 1, f(x) 0, and f(r) f(x+4) (a) Sketch the graph of f(x) on the interval -6, 6] (b) Find the Fourier series representation of f(x). You must show how to evaluate any integrals that are needed 2. Consider the function 0 T/2, T/2, T/2 < T. f(x)= (a) Sketch the odd and even periodic extension of f(x) for -3r < x < 3m. (b) Find the Fourier cosine series...
x < π Find the Fourier series representation of the function f (x)-1 over the interval-r
Question 6 Consider the function defined over the interval 0<x<L. Extend f(x) as a function of period 2L by using an odd half-range expansion 1) Sketch the extended function over the interval -3L<XS3L. 2) Calculate the coefficients for the Fourier Series representation of the extended function. 3) Write the first 5 non-zero terms of the Fourier Series. (10 marks)
Problem 2 x < π; f(x)-x-2π when π Function f(x) =-x when 0 f(x + 2π) = f(x). x < 2π. Also 1. draw the graph of f(x) 2. derive Fourier series
Please show all steps with clear hand writing
3. Consider the periodic function defined by sin(x) 0<x< f(r) = and f(x) = f(x + 27). (a) Sketch f(x) on the interval-3r < r 〈 3T. etch fx on the interva (b) Find the complex Fourier series of f(x) and obtain from it the regular Fourier series.
3. Consider the periodic function defined by sin(x) 0
2.4. HARMONIC FOURIER SERIES 57 Problem 2. Consider the function f in L? (0,2m) given by f(t) = sin( 1.5) (when 0 < t < 2π Find the sine and cosine Fourier series expansion (3.1) for f. Choose a partial Fourier series approximation pn(t) for f (t). Then plot pn(t) and f(t) on the same graph. Compute the error llf - Pall. Does this Fourier series converge for t 2mj where j is an integer, and if so what does...