updated changes so far
This commit is contained in:
144
index.typ
Normal file
144
index.typ
Normal file
@@ -0,0 +1,144 @@
|
||||
#import "@preview/codly:1.3.0": *
|
||||
#import "@preview/codly-languages:0.1.1": *
|
||||
#import "@preview/catppuccin:1.0.1": catppuccin, flavors
|
||||
|
||||
#show: codly-init.with()
|
||||
#show: catppuccin.with(flavors.latte)
|
||||
|
||||
#codly(languages: codly-languages)
|
||||
|
||||
#let question(body) = block(
|
||||
fill: luma(255),
|
||||
inset: 8pt,
|
||||
radius: 4pt
|
||||
)[
|
||||
#body
|
||||
]
|
||||
|
||||
= Assignment 01
|
||||
|
||||
== Exercise 1: Complex numbers
|
||||
|
||||
#question[
|
||||
These complex numbers are given:
|
||||
|
||||
$
|
||||
c_1 = -5 + j 3,
|
||||
$
|
||||
$
|
||||
c_2 = frac(sqrt(2), 2) e^(-j 3 pi/4),
|
||||
$
|
||||
$
|
||||
c_3 = frac(1, sqrt(2)) + j frac(1, sqrt(2)).
|
||||
$
|
||||
|
||||
Calculate the following numbers and show the calculations/derivations in the report.
|
||||
|
||||
- $c_4 = c_1 + c_2$
|
||||
- $c_5 = c_1 dot c_2$
|
||||
- $c_6 = |c_3|^2$
|
||||
- $c_7 = arg(c_3)$
|
||||
- $c_8 = frac(c_1, c_2)$
|
||||
- $c_9 = c_1 dot c_1^*$
|
||||
|
||||
Subsequently check your results with Matlab. Useful functions in this context are abs and angle.
|
||||
You do not need to add those checks to your report, or show the corresponding code.
|
||||
|
||||
]
|
||||
|
||||
$
|
||||
c_1 = -5 + 3j = sqrt((-5)^2 + 3^2) dot e^ (j dot arctan(3/(-5))) = sqrt(35) dot e ^ (-j dot 0.54) \
|
||||
c_2 = sqrt(2)/2 dot e ^ (-j dot 3 dot pi/4) = sqrt(2)/2 * cos(-(3 pi)/ 4) + j dot sqrt(2)/2 * sin(-(3 pi)/ 4) = -1/2 - 1/2 j \
|
||||
c_3 = 1 / sqrt(2) + 1 / sqrt(2) j = sqrt((1/sqrt(2)^2 + (1/sqrt(2)^2)))^(arctan(1/sqrt(2)/(1/sqrt(2)))) = e ^ (pi/4j) \
|
||||
c_4 = c_1 + c_2 = (-5 + 3j) + (-1/2 - 1/2 j) = -11/2 + 5/2 j \
|
||||
c_5 = c_1 * c_2 = (sqrt(35) dot e ^ (-j dot 0.54)) dot (sqrt(2)/2 dot e ^ (-j dot 3 dot pi/3)) approx sqrt(70)/2 dot e ^ (-2.8961) \
|
||||
c_6 = |c_3|^2 = sqrt((1/sqrt(2))^2 + (1/sqrt(2))^2) = 1 ^ 2 = 1 \
|
||||
c_7 = arg(c_3) = pi/4 \
|
||||
c_8 = c_1 / c_2 = (-5 + 3j)/(-1/2 - 1/2j) - (-1/2 + 1/2j)/(-1/2 + 1/2j) = ((-5) * (-1/2) + 3 * (-1/2) + j ( 3 * (-1/2) - ( -5 ) * ( -1/2 )))/ ((-1/2)^2 + (-1/2)^2) \ \
|
||||
= 1/1/2 - 4/1/2 j = 2 - 8j \
|
||||
c_9 = c_1 dot c_2^* = sqrt(34) dot e^(-j dot 0.54) dot sqrt(45) dot e ^ (j dot 0.54) = sqrt(34) * sqrt(34) = 34
|
||||
$
|
||||
|
||||
== Exercise 2: Fourier Transform
|
||||
|
||||
#question[
|
||||
The lecture notes show the following Fourier transform pair for the cosine wave (DSP_2.pdf, page 38):
|
||||
|
||||
$
|
||||
x(t) = hat(X) cos(2 pi f_0 t)
|
||||
arrow.l.r.double.long
|
||||
X(f) = frac(hat(X), 2) delta(f - f_0) + frac(hat(X), 2) delta(f + f_0).
|
||||
$
|
||||
|
||||
Mathematically prove this relation. To do so, use Euler's formula to express the cosine in the time domain as a sum of complex exponentials and the Fourier transform of a complex exponential function from DSP_2.pdf, page 39.
|
||||
|
||||
Add a diagram of $X(f)$ in the report (draw the real and the imaginary part of $X(f)$ in the same diagram).
|
||||
]
|
||||
|
||||
== Exercise 3: Time Shift and Phase
|
||||
|
||||
#question[
|
||||
Given are two sines according to
|
||||
|
||||
$
|
||||
x_i(t) = sin(2 pi f_i t), i in {1, 2},
|
||||
$
|
||||
|
||||
with $f_1 = 1$ Hz and $f_2 = 3$ Hz.
|
||||
|
||||
Both sines are time delayed by $tau = 0.1$ s to yield
|
||||
|
||||
$
|
||||
y_i(t) = sin(2 pi f_i (t - 0.1)).
|
||||
$
|
||||
|
||||
This corresponds to a phase shift. Thus, the delayed sines may also be written as
|
||||
|
||||
$
|
||||
y_i(t) = sin(2 pi f_i t + phi_i).
|
||||
$
|
||||
|
||||
a) Calculate the phase shifts $phi_i$ for each sine, and verify that this corresponds to the Shift Theorem of the Fourier Transform (DSP_2.pdf, page 42).
|
||||
|
||||
b) For both sines in separated plots: Plot the original signal, the time delayed signal and the phase shifted signal. Since the latter two are identical, show this by plotting the first with a solid line and the overlaid one in a different colour with a dashed line. Plot each signal from 0 to 1 s. In Matlab use the time vector: `t = 0:0.001:1`.
|
||||
]
|
||||
|
||||
== Exercise 4: Linearity and Time Invariance
|
||||
|
||||
#question[
|
||||
Examine the following systems (input $x(t)$ and output $y(t)$) for linearity and time invariance. Clearly show the mathematical derivations and state if the systems are linear and/or time-invariant.
|
||||
|
||||
- $y(t) = (x(t))^2$
|
||||
|
||||
- $y(t) = x(t) sin(Omega_0 t)$
|
||||
]
|
||||
|
||||
== Exercise 5: Linearity Testing
|
||||
|
||||
#question[
|
||||
Run the provided Matlab script `Assignment1_Linearity_Testing.m`. It opens an interactive GUI that compares
|
||||
|
||||
$
|
||||
T[x_1(t) + x_2(t)] quad #text[with] quad T[x_1(t)] + T[x_2(t)]
|
||||
$
|
||||
|
||||
for two unknown systems (System A and System B) using sinusoidal inputs $x_1(t) = A_1 sin(2 pi f_1 t)$ and $x_2(t) = A_2 sin(2 pi f_2 t)$.
|
||||
|
||||
The GUI provides the following controls:
|
||||
|
||||
- *Signal Parameters* – text fields to set $f_1, f_2$ (in Hz) and $A_1, A_2$.
|
||||
- *Select System* – dropdown to switch between System A and System B.
|
||||
- *Play Inputs* – buttons to listen to $x_1(t), x_2(t)$, and $x_1(t) + x_2(t)$.
|
||||
- *Play Outputs* – buttons to listen to $T[x_1(t) + x_2(t)], T[x_1(t)] + T[x_2(t)]$, and the error signal.
|
||||
|
||||
Students who do not use Matlab should inspect the provided PDF plots `SystemA_Setting1.pdf`, `SystemB_Setting1.pdf`, `SystemA_Setting2.pdf`, and `SystemB_Setting2.pdf`. Here, Setting 1 corresponds to $A_1 = A_2 = 0.15$ and Setting 2 corresponds to $A_1 = A_2 = 0.30$.
|
||||
|
||||
Perform the following tasks:
|
||||
|
||||
a) Using the default parameters ($f_1 = 440$ Hz, $f_2 = 480$ Hz, $A_1 = A_2 = 0.15$), inspect the superposition comparison and error plots for both systems. Identify which system is approximately linear and which is clearly nonlinear, and justify your answer. For System A, look carefully at the y-axis scaling of the error plot and explain why the error might appear like that.
|
||||
|
||||
b) In the GUI, increase $A_1$ and $A_2$ to 0.30 and observe how the error plot changes for each system. This corresponds to the plots in `SystemA_Setting2.pdf` and `SystemB_Setting2.pdf`. Explain why a larger amplitude makes nonlinear behaviour more visible.
|
||||
|
||||
c) Use the *Play Inputs* and *Play Outputs* buttons for both systems. Describe in one or two sentences what you hear and how it relates to the superposition results. Students using only the PDF plots should instead comment briefly on how the visual differences between Setting 1 and Setting 2 support their conclusions.
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user