Question

1 point) Consider the Fourier series: nTTc a. Find the Fourier coefficients for the function f(x) 1.2 an b. Use the computer

0 0
Add a comment Improve this question Transcribed image text
Answer #1


万n ano 4 пт n 0.4X36 Co %Matlab code for Fourier Series clear all close all %All time values X-linspace (-6, 6,1001); %Loop for creating the functionPlotting of Actual data and Fourier summ 10 Actual data Fourier sum for 5 terms Fourier sum for 20 terms -4 -6 10 20 15 10 10

%Matlab code for Fourier Series
clear all
close all
%All time values
X=linspace(-6,6,1001);
%Loop for creating the function
zz=1.2*X;
figure(1)
%Plotting the function
hold on
plot(X,zz,'linewidth',3)
xlabel('x')
ylabel('f(x)')
title('Plotting of Actual data and Fourier sum')

%fourier series
XX=linspace(-18,18,1001);
a0=0;

an=@(n) 0;
bn=@(n) ((-0.4*36)/(n*pi))*cos(n*pi);

s=a0/2;
for nn=1:20
    s=s+an(nn).*cos(nn.*XX.*pi/6)+bn(nn).*sin(nn.*XX.*pi/6);
    if nn==5
        plot(XX,s,'linewidth',2)
    elseif nn==20
        plot(XX,s,'linewidth',2)
    end
end

legend('Actual data','Fourier sum for 5 terms','Fourier sum for 20 terms')
grid on
%%%%%%%%%%%%%% End of Code %%%%%%%%%%%

Add a comment
Know the answer?
Add Answer to:
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...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT