HW 3: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
* I made a vector "x" from -5 to 5 with points spaced every .02 in between. I originally made the vector from -10 to 10 with an even smaller spacing ([http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem the Nyquist theorem] requires that samples must be taken at at least twice the frequency), but the integral took too long.
* I made a vector "x" from -5 to 5 with points spaced every .02 in between. I originally made the vector from -10 to 10 with an even smaller spacing ([http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem the Nyquist theorem] requires that samples must be taken at at least twice the frequency), but the integral took too long.
* I made a vector "y" equal to "x".
* I made a vector "y" equal to "x".
* I used the meshgrid function in Octave to make my vectors square matrices ([http://www.network-theory.co.uk/docs/octave3/octave_159.html more info here])
* I used the meshgrid function in Octave to make my vectors square matrices xx and yy ([http://www.network-theory.co.uk/docs/octave3/octave_159.html more info here])
* I then integrated <math>\ e^{(j2\pi xx yy)}\</math> and plotted the result.
As you can see by the graph below, it is indeed very similar to an impulse function. To confirm, I integrated under the plot and found the area to be 0.99621, which is very close to the expected value of 1.
[[File:HW3.png]]
[[File:HW3.png]]


===Author===
[[Christopher Garrison Lau I]]

Revision as of 21:18, 13 October 2010

Doing this assignment taught many new lessons, in both sampling and Octave. An infinite integral in Octave would be impractical. As a result, I did the following:

  • I made a vector "x" from -5 to 5 with points spaced every .02 in between. I originally made the vector from -10 to 10 with an even smaller spacing (the Nyquist theorem requires that samples must be taken at at least twice the frequency), but the integral took too long.
  • I made a vector "y" equal to "x".
  • I used the meshgrid function in Octave to make my vectors square matrices xx and yy (more info here)
  • I then integrated Failed to parse (syntax error): {\displaystyle \ e^{(j2\pi xx yy)}\} and plotted the result.

As you can see by the graph below, it is indeed very similar to an impulse function. To confirm, I integrated under the plot and found the area to be 0.99621, which is very close to the expected value of 1. HW3.png


Author

Christopher Garrison Lau I