[phoenix-project] Re: Square wave

  • From: Ajith Kumar <bpajith@xxxxxxxxx>
  • To: Atanu Mandal <atanubuieit29@xxxxxxxxx>, Phoenix-project <phoenix-project@xxxxxxxxxxxxx>
  • Date: Mon, 3 Oct 2016 12:23:36 +0530

Use the attached program to generate square wave, uses Fourier series. Add
more harmonics, by changing the argument of the range() function



On Sun, Oct 2, 2016 at 8:48 PM, Atanu Mandal <atanubuieit29@xxxxxxxxx>
wrote:

Thank you for the reply. The curve I got from the python programming which
is from the equation of fourier series of the formula "amplitude * cos((2*
pi * f * t) + phase)" . Preciously I want the same square wave as u shown
in the attached file.


On Sun, Oct 2, 2016 at 8:29 PM, Georges Khaznadar <
georges.khaznadar@xxxxxxx> wrote:

Dear Atanu Mandal,

the "cosine" curves do not look as genuine cos() functions; for example
their pseudo-period is not constant.

Which square wave do you want exactly ? Please have a look at the
attached proposition.

Another question: I assume that both curves have been created with
expEYES... Which is the program used to create such curves?

Best regards,                   Georges.

Atanu Mandal a écrit :
Respected Everyone,

I was working on an experiment in physics. On the result I have got two
curves of cosine which i have attached. But I need help in creating the
square wave through which I can partitioned the graph in n sizes
respect of
the peaks and downs. Waiting for your reply.

--
Thanks and Regards,

Atanu Mandal
Contact : +91 9062866035





--
Thanks and Regards,

Atanu Mandal
Contact : +91 9062866035
vikaspedia.gov.in
follow us on: https://www.facebook.com/pages/Vikaspedia-Bengali/
921462494547508




-- 
Dr. Ajith Kumar B.P.
Scientist  H
Inter-University Accelerator Centre
Aruna Asaf Ali Marg
New Delhi 110067
www.iuac.res.in
Ph: (off) 91 11 26893955 (Ext.230)
      (res)91 11 26897867
      (mob) 91 9868150852, 91 9643258320
#Example fourier_square.py

from pylab import * 
N = 100    # number of points
x = linspace(0.0, 2 * pi, N)
y = zeros(N)
for n in range(5): 
    term = sin((2*n+1)*x) / (2*n+1)
    y = y + term
    plot(x,y)
show()

Other related posts: