$30
ECE 466 Homework 1
You can collaborate on homeworks and turn in a homework for 2 people.
You start with 12 bonus points. Think of it as me giving you points for researching markdown, jupyter notebooks, etc.
Include your codes and answers within the cells that are requested. Do not create additional cells.
Double click on any cell to see the raw text that generates it. shift+enter runs a cell and shows you an output. Feel free to play with it but please return the question and description cells in the original format.
You can find markdown tutorials and guides by simple google search. Cheatsheets should be more useful if you are short on time.
Ask your questions in the discussion forums in D2L. You can post in homework or coding related. If it's not specific to this homework $\rightarrow$ Coding Related.
Office hours T-Th 4-5 pm.
Upload the .ipynb document and a generated .html in a zip where all of these have the name in the following format: emre_sofuoglu.ipynb
For html generation, you can google search. VSCode users: CTRL+SHIFT+P $\rightarrow$ type 'html' $\rightarrow$ Jupyter: Export to HTML
I will import the necessary modules for you. Please only use these modules for now.
Your Name: [Name Surname]
(Double Click Here to edit. Delete this expression after edit.)
import numpy as np
import matplotlib.pyplot as plt
1:
[18 points] For each $x[n]$ given below:
Plot the signal using np.stem() for $-20\leq n\leq20$.
Is the signal an energy signal or a power signal?
Is it periodic or aperiodic? What's the period if it is periodic?
Is it even or odd?
a. $x[n]= (1.2)^{-n} \sin{(\frac{\pi n}{4})} u[n]$.
## Your code for plotting the signal in 1.a. should be in this cell.
Your answers for signal 1.a. should be written in this cell. (Double click on this text)
b. $x[n]= \frac{\sin{(\pi n)}}{\sin{(\frac{\pi n}{10})}}$.
## Your code for plotting the signal in 1.b. should be in this cell.
Your answers for signal 1.b. should be written in this cell.
c. $x[n] = \cos{(\frac{\pi n}{4})}\sin{(\frac{\pi n}{3})}$.
## Your code for plotting the signal in 1.c. should be in this cell.
Your answers for signal 1.c. should be written below in this cell.
2:
[15] Determine whether the following systems are linear, shift-invariant, memoryless, causal, and BIBO stable:
a. $y[n] = x[-n]$.
b. $y[n] = e^{x[n]}$.
c. $y[n] = g[n]x[n]$ with any given $g[n]$.
Your answers for question 2. should be written and executed below in this cell.
3:
[15] The continuous time signal $x(t) = \frac{\sin{(10\pi t)}}{10 \pi t}$ is is the input to an ideal A/D converter with sampling period ܶ$T$, to obtain the discrete-time signal $x[n] = \frac{\sin{\frac{(\pi n)}{2}}}{\frac{\pi n}{2}}$.
a. What is the ideal $T$ for such a conversion?
b. Is your choice of $T$ unique? If not, what other $T$s can be used?
Your answers for question 3. should be written and executed in this cell.
4:
[20] Consider the following continuous-time sinusoidal signal: $x_a(t) = \sin{(2\pi F_0 t)}$.
The sampled version of this signal can be described by it's values every $T_s$ seconds. Namely, $x[n] = x_a(n T_s)$ = \sin(2\pi\frac{F}{F_s} n)$.
a. Plot the signals $x[n]$ with given $F_0$ for $0\leq n\leq 99$. $F_s = 5000 = 5$ kHz. Explain the similarities and differences between these plots.
$F_0 = 500 = 0.5$ kHz.
$F_0 = 2000 = 2$ kHz.
$F_0 = 3000 = 3$ kHz.
$F_0 = 4500 = 4.5$ kHz.
# Give the code of your answer for signal with F_0=0.5kHz.
# Give the code of your answer for signal with F_0=2kHz.
# Give the code of your answer for signal with F_0=3kHz.
# Give the code of your answer for signal with F_0=4.5kHz.
What similarities do you observe? What differences?:
b. Suppose that $F_0=2$kHz and $F_s = 50$kHz.
i. Plot $x[n]$. What is the frequency $f_0$ of $x[n]$?
ii. Plot the signal $y[n] = x[2n]$ . Is this a sinusoidal? What is the frequency?
# Code for 4.b.i.
Type the frequency of $x[n]$ here.
# Code for 4.b.ii.
Type the frequency of $y[n]$ here.
5:
[20] An analog signal $x_a(t) = \sin(480\pi t) + 3 \sin (720\pi t)$ is sampled 600 times per second.
(a) Determine the Nyquist sampling rate for $x_a(t)$.
Answer
(b) Determine the folding frequency.
Answer
(c) What are the frequencies, in radians, in the resulting discrete time signal $x[n]$?
Answer
(d) If $x[n]$ is passed through an ideal D/A converter, what is the reconstructed signal $Y_a(t)$?
Answer