help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: triangular wave


From: Jaroslav Hajek
Subject: Re: triangular wave
Date: Tue, 20 May 2008 09:51:22 +0200

On Tue, May 20, 2008 at 9:09 AM, javier <address@hidden> wrote:
> Sorry for my English
> Someone knows how to create a vector with a triangular wave?
> And a square wave?
>
> Something like this but with a signal triangular:
>
> seno=10*sin(2*pi*10);
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>

try
2/pi*asin(sin(2*pi*x))
or (equivalent but more accurate)
2*abs(2*((x-0.25) - floor(x-0.25))-1)-1

btw. this has little to do with octave in particular, unless you ask
for a function to be implemented.



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]