plots periodics functions and fourier transform

how can I plot a periodic function like e^-abs(z) while -T1<z<T1 and 0 else? if my cycle is L = T0

3 Comments

That is not a periodic function: that is a symmetric function.
Rotem
Rotem on 7 Oct 2012
Edited: Rotem on 7 Oct 2012
I tried this if true for i = 1:Cycle_Num t0 = linspace((i-1)*L - i*L,(i-1)*L - i*T1,1000); t1 = linspace((i-1)*L- i*T1,(i-1)*L + i*T1,1000); t2 = linspace((i-1)*L + i*T1,(i-1)*L + i*L,1000); plot(subs(func0,t0)); plot(subs(func1,t1)); plot(subs(func0,t2)); end end
Please format your code (using the '{} Code' toolbar icon), so that we can read it more easily.

Sign in to comment.

 Accepted Answer

This might be what you're looking for:
T1=10;
T0=6;
h=T0/2;
f=@(z) exp(-abs(z));
p=@(t) mod(t-h,2*h)-h;
t=linspace(-T1,T1,1000);
plot(t,f(p(t)));

6 Comments

that works just that I have a split function that eq to 0 when -T1<z<T1 for every cycle meaning that the f function is define only in those sectors and not the all time how can I define the split function?
D=10; %total duration
T0=6; %period
T1=1; %truncation window
f=@(z) exp(-abs(z)) .* (abs(z)<=T1);
p=@(t) mod(t-T0/2,T0)-T0/2;
t=linspace(-D,D,1000);
plot(t,f(p(t)))
thanks a lot I am not familiar with the truncation wimdow => (abs(z)<=T1); is that eq to write a split function that zero all but -+T1
Yes. Try running without p(t) and see what happens.
its zero every thing except the limit of abs(z)<= T1 and I can now add another function to that one which define the rest of the t axe

Sign in to comment.

More Answers (0)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Asked:

on 7 Oct 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!