Question:
What math tool should I use to find the Fourier Series of a given data set?
craizdwei
2006-07-31 20:41:51 UTC
Basically, I want to find the Fourier series of a data set and graph it on top of the original series to see how well it converges to the original data set for different orders. I tried using matlab, but I'm having some trouble getting it to work. Anyone got any suggestions on what would be easiest to use? Also, it would be nice if you could give me basic instructions or direct me to a site that would show me how to do this. Thanks!

PS. I have some basic knowledge of Matlab and Excel. I know how to program in C and Java, but I really don't want to use anything that low level.
Four answers:
DanE
2006-07-31 20:46:57 UTC
http://www.mathphysics.com/pde/ch4wr.html

http://www.eecircle.com/applets/001/001.html

http://www.martindalecenter.com/Calculators3A_2_S-FP.html
DoctaB01
2006-07-31 22:26:20 UTC
Matlab would be the easiest way to go. It should be pretty easy. I am assuming that your data is based on voltage and time over say one period or two periods. Well you will need to make a vector that contains all the voltage levels in the correct order. Then make a vector that has all time values in the correct order. These vectors need to be the same length. Once you have done that you should define the Fourier series you are doing. The Fourier series should last the same amount of time as the data does. Then plot then on the same graph.

Functions you may need:

plot

length

linspace

figure



If you are having trouble with the Fourier series you may want to convert it into the A and B coefficients. They are much easier to plot in maltab than the complex version. You can use a For statement to create the Fourier series.



I would search MATLAB and Fourier series. I am sure you will find some sites to help you with it.
sparrowhawk
2006-07-31 22:04:32 UTC
Here is a matlab function i wrote to plot a Fourier series of different orders that I wrote for homework a while ago. It does not find the Fourier series but once you know the series representation you can enter it into the 6th and 8th lines and it plots the 3,6, and 20th orders. The 6th line is for the first term in the series.





x=[-pi:2*pi/100:pi];

y=zeros(20,101);

for i=1:20

for j =1:101

if i ==1

y(i,j) = pi/4 - 2/pi * cos (x(j)) + sin (x(j));

else

y(i,j)= y(i-1,j)-2/pi*cos((2*i-1)*x(j))/(2*i-1)^2

+(-1)^(i+1)/i * sin (i*x(j));

end

end

end

plot(x,y(20,:),x,y(3,:),x,y(6,:))

set(gca, 'XTick', -pi:pi/2:pi);

set(gca, 'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'});

xlabel('-\pi \leq \Theta \leq \pi');





If you have any questions feel free to email me.
?
2016-12-11 09:06:47 UTC
ok , omega0 is your needed frequency = 2*pi/era and the era is the time between 2 comparable factors on your repeating sawtooth waveform (say the time that it strikes from 0 to a million). n is the index indicating which harmonic you're pondering, whilst n=a million the frequency is omega_0*a million = omega) and it quite is your needed it quite is comparable to the 1st harmonic. the 2d harmonic is at (n=2) 2*omega0 and its amplitude is a million/2 that of the needed, 0.33 harmonic is a million/3 of the needed etc.etc on till you attain infinity (the 8 on its facet). in case you basically paintings it out for the 1st 6 or 7 harmonics you notice that it gets further and extra like a sawtooth as you upload greater advantageous words (there's an excellent style of ripple on the properly suited and the upward push and fall cases don't have limitless slope (squarewave) on account which you have not lined the better harmonics in spite of the shown fact that it quite is getting closer to sawtooth(sq.) for all time). you may desire to additionally see that the summation term supplies something that strikes between plus and - pi/2 so once you divide by using pi and then subtract it from a a million/2 this strikes your practically sawtooth wave to between 0 and a million (plus all the ripply bits). appropriate of success


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...