Lab week1: Complex numbers ========================== We will plot several times using matplotlib in Python. Read section 1.2 of DSP notes on `plotting signals `_ carefully! You need to use many of these plotfunctions several times. Results can be uploaded in Blackboard. Please (PLEASE!!) do NOT use zip files or tarballs. Assignment 1. ------------- Finish these exercises and submit the files as 1_1.py in Blackboard. Assignment 2. ------------- Plot the following complex numbers as vector using the Python library matplotlib: - 4 + 3j - -3 - 5j - 6 - 2j - -2 + 4j Upload the source as 1_2.py in Blackboard. Assignment 3. ------------- Plot the sum of the previous complex numbers. Upload the Python program as 1_3.py Assignment 4. ------------- Determine the polair representation of the 4 complex numbers of assignment 1 using Python. Sumbit as 1_4.py Assignment 5. ------------- The derative of .. math:: \frac{d{cos(\phi) + j sin(\phi)}}{d\phi} = -sin(\phi) + j cos(\phi) Rewritten with :math:`\frac{df(\phi)}{d\phi} = i f(\phi)` .. math:: \frac{d(e^{\phi})}{d\phi} = j e^{j\phi} (Check this!) For small :math:`\phi` : .. math:: e^x \approx 1 + x + \frac{x^2}{2} and .. math:: cos(x) \approx 1 - \frac{x^2}{2}, sin(x) \approx x Plot cos(x) and sin(x) for the values 0 - 0.5. Use about 40 points and plot these on a red line with blue points. Do the same for :math:`e^x`. Upload a jpg or png picture file. Assignment 6. ------------- Write an expression for :math:`e^{j\phi}` using only the cos(x) and sin(x) rules of above. Do the same for :math:`e^{-j\phi}`. Derive an expression for :math:`cos(\phi)` and :math:`sin(\phi)` as function of :math:`e^{\phi}`. Upload a file 1_6.txt or pdf containing the expressions. Assignment 7. ------------- .. math:: z = 5e^{3.665j} Determine with Python x and y. Plot this function and it it's conjugated. Create with matplotlib a label for both vectors. Upload a png or jpg picture as 1_7.png. Assignment 8. ------------- :math:`z_1 = 3 + 5j` en :math:`z_2 = 7 - 4j` Determine :math:`\|z_1|^2` and :math:`|z_2|^2`. What strikes when you take the conjugated of z1 and z2 and multiplies with z1, respectively z2? - Determine :math:`z = z_1 + z_2` and :math:`z = z_1 - z_2` - Determine :math:`z = z_1z_2` - Determine :math:`z = z_1/z_2` and :math:`z = z_2/z_1` What strikes when you compare the sum and difference with results of the multiplication and division? Upload the results in blackboard as 1_8.pdf (or txt).