Fourier Series Coefficients with MATLAB

In summary, the problem is that the programmer wants to calculate the arithmatic-geometric mean, but does not know what the value of q is for a given value of p. The first program is to find the agm, and the second program is to find the pair of values of p and q which will give the same arithmatic and geomatric mean.
  • #1
mejykl
3
0
Hi,

I'm trying to write a MATLAB Script to solve the Fourier series coefficients of a square wave via simultaneous equations in MATLAB. Any advice? I can write the expression out by hand, but cannot code it. Please advice.
 
Physics news on Phys.org
  • #2
hi i have a porgraming project.the porblem is
"let agm(a,b) indicate the arithmetic-geometric mean of a and b.
1) plot the solution of agm(a,b)=1.
2) how can we use the result of part 1) to graph agm(a,b)=k for a given k>0?"

arithmatic mean=(a+b)/2 and geometric mean=(a*b)^(1/2). there is a program that calculate the arithmatic-geometric mean.that is

function[i,p,q]=agm(x,y)
format long
fprintf('i p q\n\n')
for i=1:50
p=(x+y)/2;
q=((x*y))^(1/2);
x=p;
y=q;
fprintf('%d %2.14f %2.14f\n',i,p,q)
if (abs(p-q)<10^(-14)),break,end
end
fprintf('\nthe agm is = %2.14f\n',q)
end

if we calculate the program then we will find once that both p and q are equal.then we will call any of the value of p or q as the agm of p and q.
but my program is to find the value of q for a given value of p such that both the arithmatic and the geomatric mean are equal.that mean if (a+b)/2=?? then (p*q)^(1/2)=?? that means the same value. like if we put a fixed value p=1 then for q=1 both (a+b)/2=1 and (p*q))^(1/2)=1.; that means for 1 value of p i will get only one value of q so that both arithmatic and geomatric mean will be equal.if we put p=2 then there is a certain value of q so that both arithmatic and geomatric mena mean have the same value(that is 1).
but if we don't know for a fixed value of p waht is the value of q for which both arithmatic and geomatric mean are equal then how will i calculate.there is 1 related program

function root=pro(a,b)
k=1;
for i=1:100
m=(a+b)/2;
if(agm(2,m)-1)*(agm(2,a)-1)<0
b=m;
else
a=m;
end
if abs(agm(2,m)-k)<10^(-10),break,end
end
fprintf('value is %4.7f\n',m)
end
combining these two program i need to calculate the pair of values of p
and q so that both p and q will give the same arithmatic and geomatric
value
summary: that mean the summary is to find those values of p and q
for those the arithmatic and geomatric mean will be same.and
then keep those values in an array.i don't need the values of
p and q that will give another value of agm that is not 1.how
it can be done? first program is to find agm.and the second program
is to find the pair which will giev the same arithmatic and geomatric
mean.
 
Last edited by a moderator:
  • #3
Thank you so much, I now see how to approach the issue.
 
  • #4
Definition: when H, K are subgroups of G, we define HK to be the set of all elements of G that can be written in the form hk where h is in H and k is in K.

1) let H be a subgroup of a group G and N be a normal subgroup of G.show that HN is a subgroup of G and N be a normal subgroup of HN.
2) let H,K and N be a subgroup of a group G, K is normal subgroup of H and N is normal subgroup of G.prove that NK is normal subgroup of NH.
3) let H1 and H2 be subgroups of a group G and N1 subgroup of H1 and N2 subgroup of H2.then show that
N1(H1 intersection N2) is normal subgroup of N1(H1 intersection H2)
and (H1 intersection N2)(H2 intersection N1) normal subgroup of (H1 intersection H2)

can u help me of these 3 proofs?
 
Last edited by a moderator:
  • #5
hi pleasezzzzzzz help me out in writing programs for Fourier series in MATLAB ...and also regarding fft's and dft's also please help me out
 
Last edited by a moderator:

What is a Fourier Series?

A Fourier Series is a mathematical representation of a periodic function using a combination of sine and cosine functions. It allows us to break down a complex function into simpler components, making it easier to analyze and manipulate.

How do I calculate Fourier Series coefficients using MATLAB?

MATLAB has built-in functions for calculating Fourier Series coefficients, such as 'fft' and 'ifft'. These functions take in the input signal and return the corresponding coefficients. You can also use the 'fsolve' function to solve the equations manually.

What is the significance of Fourier Series coefficients?

The Fourier Series coefficients represent the amplitude and phase of each component in the function. They provide valuable information about the behavior and characteristics of the function, such as its periodicity, frequency, and smoothness.

Can I use MATLAB to visualize Fourier Series coefficients?

Yes, MATLAB has powerful plotting capabilities that allow you to visualize the Fourier Series coefficients. You can use the 'plot' or 'stem' functions to plot the coefficients and observe their patterns and variations.

What are some common applications of Fourier Series coefficients?

Fourier Series coefficients have a wide range of applications in fields such as signal processing, image processing, data compression, and differential equations. They are also used in audio and video compression algorithms and in the analysis of electrical circuits and waves.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
264
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
738
  • Calculus and Beyond Homework Help
Replies
3
Views
352
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top