DSPRelated.com
Forums

How to do square pulse wave?

Started by crippler November 6, 2006
Hi. 
 
I require help with the following 
 
Given 
 
t=(0:0.001:1)'; 
 
y=sin(2*pi*50*t) + 2*sin(2*pi*120*t); 
 
plot(t,y) 
 
How can you generate a square pulse wave using many sine functions? 
    - Vary number of terms and comment on the convergence


"crippler" <crip_pler2003@yahoo.com> wrote in message 
news:T7SdnelxJOxLztLYnZ2dnUVZ_qmdnZ2d@giganews.com...
> Hi. > > I require help with the following > > Given > > t=(0:0.001:1)'; > > y=sin(2*pi*50*t) + 2*sin(2*pi*120*t); > > plot(t,y) > > How can you generate a square pulse wave using many sine functions? > - Vary number of terms and comment on the convergence > >
This appears to be a homework problem. Read up on Fourier Series. Fred
Fred Marshall wrote:
> "crippler" <crip_pler2003@yahoo.com> wrote in message > news:T7SdnelxJOxLztLYnZ2dnUVZ_qmdnZ2d@giganews.com... >> Hi. >> >> I require help with the following >> >> Given >> >> t=(0:0.001:1)'; >> >> y=sin(2*pi*50*t) + 2*sin(2*pi*120*t); >> >> plot(t,y) >> >> How can you generate a square pulse wave using many sine functions? >> - Vary number of terms and comment on the convergence >> >> > This appears to be a homework problem. Read up on Fourier Series.
It appears to be two separate homework problems. Jerry -- "The rights of the best of men are secured only as the rights of the vilest and most abhorrent are protected." - Chief Justice Charles Evans Hughes, 1927 &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:

> Fred Marshall wrote: > >> "crippler" <crip_pler2003@yahoo.com> wrote in message >> news:T7SdnelxJOxLztLYnZ2dnUVZ_qmdnZ2d@giganews.com... >> >>> Hi. >>> >>> I require help with the following >>> >>> Given >>> >>> t=(0:0.001:1)'; >>> >>> y=sin(2*pi*50*t) + 2*sin(2*pi*120*t); >>> >>> plot(t,y) >>> >>> How can you generate a square pulse wave using many sine functions? >>> - Vary number of terms and comment on the convergence >>> >>> >> This appears to be a homework problem. Read up on Fourier Series. > > > It appears to be two separate homework problems. > > Jerry
I was going for IF CANNOT READ THEN ATTEND LECTURE ELSE FAIL ENDIF
crippler wrote:
> Hi. > > I require help with the following > > Given > > t=(0:0.001:1)'; > > y=sin(2*pi*50*t) + 2*sin(2*pi*120*t); > > plot(t,y) > > How can you generate a square pulse wave using many sine functions? > - Vary number of terms and comment on the convergence
For fun show how to make a sine using just cosines. Fourier did! Clay
Clay wrote:

> For fun show how to make a sine using just cosines.
What operations are allowed?
Andor wrote:
> Clay wrote: > > > For fun show how to make a sine using just cosines. > > What operations are allowed?
Sums of cosines of different frequencies. Clay
Clay wrote:
> Andor wrote: > > Clay wrote: > > > > > For fun show how to make a sine using just cosines. > > > > What operations are allowed? > > > Sums of cosines of different frequencies. > > > Clay
Plus I'll throw in that it only has to match sin(x) on the interval 0 to pi. Clay
Clay schrieb:

> Clay wrote: > > Andor wrote: > > > Clay wrote: > > > > > > > For fun show how to make a sine using just cosines. > > > > > > What operations are allowed? > > > > > > Sums of cosines of different frequencies. > > > > > > Clay > > Plus I'll throw in that it only has to match sin(x) on the interval 0 > to pi.
I can do it with a series, but not a sum ...

Clay wrote:


>>>>For fun show how to make a sine using just cosines. >>> >>>What operations are allowed? >> >>Sums of cosines of different frequencies. >> > Plus I'll throw in that it only has to match sin(x) on the interval 0 > to pi.
This is does not seem possible. You probably ment from 0 to PI/2. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com