m (User:Cnphilli moved to HW2-A Collin Phillips) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
[[Image:Periodiccnphilli_ECE301Fall2008mboutin.JPG]] | [[Image:Periodiccnphilli_ECE301Fall2008mboutin.JPG]] | ||
<br> | <br> | ||
+ | |||
+ | == Part A-2 == | ||
+ | <br> | ||
+ | I chose the signal y=log(x) | ||
+ | <br> | ||
+ | This code is not periodic, but taking a piece of it and<br> | ||
+ | Repeating it will make it periodic<br> | ||
+ | [[Image:LogA-2_ECE301Fall2008mboutin.JPG]] | ||
+ | <pre> | ||
+ | Here is the code I used: | ||
+ | |||
+ | dt = .00001; | ||
+ | periodlength = 5; | ||
+ | periods = 10; | ||
+ | |||
+ | t = [dt:dt:periodlength]; | ||
+ | y = log(t); | ||
+ | x = []; | ||
+ | for i=1:periods | ||
+ | x = [x,y]; | ||
+ | end | ||
+ | t = [dt:dt:periodlength*periods]; | ||
+ | plot(t,x) | ||
+ | </pre> |
Latest revision as of 13:54, 11 September 2008
Homework 2 Part A-1
I chose the signal:
$ y = cos(n)\, $
When I took a sample at 1 hz, the signal was ugly and random.
Therefore it is not periodic.
File:Non-periodic.jpg ECE301Fall2008mboutin
Changing the function to:$ y = cos(n*pi/2)\, $
made the signal look periodic.
Part A-2
I chose the signal y=log(x)
This code is not periodic, but taking a piece of it and
Repeating it will make it periodic
Here is the code I used: dt = .00001; periodlength = 5; periods = 10; t = [dt:dt:periodlength]; y = log(t); x = []; for i=1:periods x = [x,y]; end t = [dt:dt:periodlength*periods]; plot(t,x)