(→Part 2) |
(→Part 2) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
==Part 2== | ==Part 2== | ||
This is <math>x(t)=e^{-t}cos(20t)</math> as the nonperiodic signal. | This is <math>x(t)=e^{-t}cos(20t)</math> as the nonperiodic signal. | ||
− | [[image: | + | [[image:ctsignal3.jpg|300px|frame|center]] |
+ | |||
+ | |||
+ | I haven't played around with matlab enough to know how to create the signal needed with my own code, so I used the same code that Ben Laskowski used: | ||
+ | |||
+ | ---- | ||
+ | "y=zeros(size(x)); | ||
+ | |||
+ | for count=1:period/delta:(nperiod+8)*period/delta | ||
+ | |||
+ | y(1,count:size(y,2))=y(1,count:size(y,2))+f(1,1:size(y,2)-count+1); | ||
+ | |||
+ | end | ||
+ | |||
+ | plot(x,y)" | ||
+ | |||
+ | ---- | ||
+ | |||
+ | [[image:ctsignal4.jpg|300px|frame|center]] |
Latest revision as of 15:14, 12 September 2008
Part 1
Choose the signal $ x(t)=cos(t) $ which is periodic.
File:Ctsignal.jpg
300px
Sampling ever interger yields
File:Dtsignal.jpg
300px
This is $ x[n]=cos(n) $
but sampling at a frequency of $ \pi/4 $ yields
File:Dtsignal1.jpg
300px
This is $ x[n]=cos(\pi/4n) $
Part 2
This is $ x(t)=e^{-t}cos(20t) $ as the nonperiodic signal.
File:Ctsignal3.jpg
300px
I haven't played around with matlab enough to know how to create the signal needed with my own code, so I used the same code that Ben Laskowski used:
"y=zeros(size(x));
for count=1:period/delta:(nperiod+8)*period/delta
y(1,count:size(y,2))=y(1,count:size(y,2))+f(1,1:size(y,2)-count+1);
end
plot(x,y)"
File:Ctsignal4.jpg
300px