Consultant evaluation and lab 3

This commit is contained in:
Aidan Sharpe 2025-03-10 15:24:54 -04:00
parent 0ee36aae38
commit 75ff89644d
24 changed files with 8610 additions and 1 deletions

View File

@ -0,0 +1,49 @@
% value of a
a=0.9;
% signal x(n)
for n=0:200
x(n+1) = a^n;
end
figure(1)
n=0:1:200;
stem(n,x)
xlabel('n');
ylabel('x(n)');
% question part (e)
n=1;
d=[1 -a];
[h1,w]=freqz(n,d,256);
h1mag=abs(h1);
figure(2)
plot(w,h1mag,'b','linewidth',2)
xlabel('Frequency');
ylabel('Magnitude Response');
% partial dtft for k =3
[h2,w]=freqz(x(1:4),1,256);
h2mag=abs(h2);
hold
plot(w,h2mag,'r','linewidth',2)
% partial dtft for k =10
[h3,w]=freqz(x(1:11),1,256);
h3mag=abs(h3);
plot(w,h3mag,'m','linewidth',2)
% partial dtft for k =20
[h4,w]=freqz(x(1:21),1,256);
h4mag=abs(h4);
plot(w,h4mag,'k','linewidth',2)
% supremum coefficients of the error
for k=1:200
[hk,w]=freqz(x(1:k+1),1,256);
ek=abs(h1-hk);
coeff(k)=max(ek);
end
figure(3)
k=1:1:200;
stem(k,coeff)

View File

@ -0,0 +1,56 @@
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
DATA_POINTS = 200
def u(n):
return np.heaviside(n, 1)
def main():
a = 0.9
n = np.arange(DATA_POINTS)
x = a**n * u(n)
# Plot samples of x[n]
plt.figure()
plt.stem(n, x)
plt.xlabel("n")
plt.ylabel(r"$x[n]$")
# Plot the analytical DTFT
numerator = 1
denominator = [1, -a]
omega, h_0 = sp.signal.freqz(numerator, denominator, 256)
plt.figure()
plt.plot(omega, np.abs(h_0), label="Analytical DTFT")
plt.xlabel("Frequency")
plt.ylabel("Magnitude Response")
# Plot the truncated DTFT for K = 3, 10, 20
for K in (3, 10, 20):
omega, h = sp.signal.freqz(x[:K], 1, 256)
plt.plot(omega, np.abs(h), label=f"Truncated DTFT ($K = {K}$)")
plt.legend()
# Calculate the maximum error between the truncated DTFT
# and the analytical DTFT for values of K from 1 to 200
k = np.arange(DATA_POINTS)
coeffs = np.zeros_like(k, dtype=np.float32)
for i_k in k:
omega, h_k = sp.signal.freqz(x[:i_k], 1, 256)
err_k = np.abs(h_0 - h_k)
coeffs[i_k] = np.max(err_k)
# Plot the maximum error previously calculated
plt.figure()
plt.stem(k, coeffs)
plt.xlabel("k")
plt.ylabel("Supremum coefficients of the error")
plt.show()
if __name__ == "__main__":
main()

View File

@ -0,0 +1,54 @@
% value of a
a=0.9;
% signal x(n)
for n=0:200
x(n+1) = n*(a^n);
end
figure(1)
n=0:1:200;
stem(n,x)
xlabel('n');
ylabel('x(n)');
% question part (e)
n=[0 a];
d=[1 -2*a a*a];
[h1,w]=freqz(n,d,256);
h1mag=abs(h1);
figure(2)
plot(w,h1mag,'b','linewidth',2)
xlabel('Frequency');
ylabel('Magnitude Response');
% partial dtft for k =3
[h2,w]=freqz(x(1:4),1,256);
h2mag=abs(h2);
hold
plot(w,h2mag,'r','linewidth',2)
% partial dtft for k =10
[h3,w]=freqz(x(1:11),1,256);
h3mag=abs(h3);
plot(w,h3mag,'m','linewidth',2)
% partial dtft for k =20
[h4,w]=freqz(x(1:21),1,256);
h4mag=abs(h4);
plot(w,h4mag,'g','linewidth',2)
% partial dtft for k =40
[h5,w]=freqz(x(1:41),1,256);
h5mag=abs(h5);
plot(w,h5mag,'k','linewidth',2)
% supremum coefficients of the error
for k=1:200
[hk,w]=freqz(x(1:k+1),1,256);
ek=abs(h1-hk);
coeff(k)=max(ek);
end
figure(3)
k=1:1:200;
stem(k,coeff)

View File

@ -0,0 +1,58 @@
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
DATA_POINTS = 200
def u(n):
return np.heaviside(n, 1)
def main():
a = 0.9
n = np.arange(DATA_POINTS)
x = n*(a**n)*u(n)
# Plot samples of x[n]
plt.figure()
plt.stem(n, x)
plt.xlabel("n")
plt.ylabel(r"$x[n]$")
# Plot the analytical DTFT
numerator = [0, a]
denominator = [1, -2*a, a**2]
omega, h_0 = sp.signal.freqz(numerator, denominator, 256)
plt.figure()
plt.plot(omega, np.abs(h_0), label="Analytical DTFT")
plt.xlabel("Frequency")
plt.ylabel("Magnitude Response")
# Plot the truncated DTFT for K = 3, 10, 20
for K in (3, 10, 20):
omega, h = sp.signal.freqz(x[:K], 1, 256)
plt.plot(omega, np.abs(h), label=f"Truncated DTFT ($K = {K}$)")
plt.legend()
# Calculate the maximum error between the truncated DTFT
# and the analytical DTFT for values of K from 1 to 200
k = np.arange(DATA_POINTS)
coeffs = np.zeros_like(k, dtype=np.float32)
for i_k in k:
omega, h_k = sp.signal.freqz(x[:i_k], 1, 256)
err_k = np.abs(h_0 - h_k)
coeffs[i_k] = np.max(err_k)
# Plot the maximum error previously calculated
plt.figure()
plt.stem(k, coeffs)
plt.xlabel("k")
plt.ylabel("Supremum coefficients of the error")
plt.show()
if __name__ == "__main__":
main()

View File

@ -0,0 +1,52 @@
% value of a
wc=0.4*pi;
% signal x(n)
for n=-50:50
if (n == 0)
x(n+51) = wc/pi;
else
x(n+51) = sin(wc*n)/(pi*n);
end
end
figure(1)
n=-50:1:50;
stem(n,x)
xlabel('n')
ylabel('x(n)')
% Ideal lpf
n=0;
for w=0:0.05*pi:pi;
n=n+1;
wfreq(n)=w;
if (w <= wc)
hlpf(n)=1;
else
hlpf(n)=0;
end
end
figure(2)
plot(wfreq,hlpf,'b','linewidth',2)
xlabel('Frequency')
ylabel('DTFT of Ideal Lowpass Filter')
% partial dtft for k =10
k=10;
[h2]=freqz(x(51-k:51+k),1,wfreq);
h2mag=abs(h2);
hold
plot(wfreq,h2mag,'r','linewidth',2)
% partial dtft for k =20
k=20;
[h3]=freqz(x(51-k:51+k),1,wfreq);
h3mag=abs(h3);
plot(wfreq,h3mag,'m','linewidth',2)
% partial dtft for k =30
k=30;
[h4]=freqz(x(51-k:51+k),1,wfreq);
h4mag=abs(h4);
plot(wfreq,h4mag,'k','linewidth',2)

View File

@ -0,0 +1,15 @@
for n=0:99
y1(n+1) = (1 - (0.95)^(n+1))/0.05;
y2(n+1) = n + 1;
end
figure(1)
n=0:1:99;
stem(n,y1)
xlabel('n')
ylabel('y(n)')
figure(2)
n=0:1:99;
stem(n,y2)
xlabel('n')
ylabel('y(n)')

View File

@ -0,0 +1,37 @@
---
title: ECE09488 Assignment #4
author: Aidan Sharpe
date: March 6th, 2025
geometry: margin=1in
---
### 1. What type of cloud network traffic incurs fees?
c. Egress traffic from a database
### 2. Which of the following is a legitimate CIDR block for a subnet? Choose TWO.
a. 172.300.7.0/25
b. 192.168.4.0/24
### 3. Which of the following concepts is ensured by redundant routers and switches?
b. HA
### 4. Which IP address belongs within the CIDR block 172.25.1.0/23?
a. 172.25.2.10
### 5. Which tier is most protected?
c. Data tier
### 6. Which cloud stack layer corresponds to IaaS services?
b. Network layer
### 7. Which technology is used to improve vNIC performance?
d. SR-IOV (single root input/output virtualization)
### 8. How do you change applicable routes in an Azure VNet?
d. Override system routes with custom routes
### 9. What factor is improved by SR-IOV?
b. Performance
### 10. Which cloud platform's VPC or VNet can extend beyond a single region?
c. GCP

View File

@ -0,0 +1,9 @@
## Macromolecule storage techniques
- Several KBs have been stored successfully in DNA chains
- Synthetic molecules also work
- Technology is mostly limited by slow reading and writing speeds
- Sequencing methods include tandem mass spectrometry (MS/MS), enzyme-based approaches, and nanopore threading.
- Using synthetic polymers allows the molecular structure to be tuned to facilitate sequencing using "routine analytical instruments".
## Synthesis of coded macromolecules
- Solid-phase iterative chemistry

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,94 @@
---
title: ECE09426 Lecture 6 Homework
author: Aidan Sharpe
date: March 3rd, 2025
geometry: margin=1in
---
# Required PDMS for a HAW System
```python
import numpy as np
import matplotlib.pyplot as plt
P_TX = 7E3
LOSS_TX = 10**(5/10)
GAIN_TX = 10**(35/10)
MAX_RANGE = 60E3
TARGET_AREA = 1
def PDMS(tx_power, tx_gain, radar_cross_section, tx_loss, dist_source_target, dist_target_missile):
tx_p_gain = (tx_power*tx_gain) / (4*np.pi*tx_loss)
p_ref = radar_cross_section / (dist_source_target**2)
p_rx = 1 / (4*np.pi*dist_target_missile**2)
return tx_p_gain * p_ref * p_rx
def main():
pd_min = PDMS(P_TX, GAIN_TX, TARGET_AREA, LOSS_TX, MAX_RANGE, MAX_RANGE)
pd_min_db = 10*np.log10(pd_min)
print(pd_min_db)
```
PDMS required = -144.6592668956451
# PDMS for a non-HAW System
```python
import numpy as np
import matplotlib.pyplot as plt
MAX_RANGE = 60E3
def main():
illumination_percent = np.arange(0.1, 1.1, 0.1)
max_range = MAX_RANGE/illumination_percent
plt.plot(100*illumination_percent, max_range)
plt.xlabel("Illumination Percent")
plt.ylabel("Max Range [km]")
plt.show()
```
![](./illumination-percent-range.png)
# Rocket Motor Math
```python
import numpy as np
import matplotlib.pyplot as plt
g = 9.81
I_SP = 250
BURN_TIME = 14
INITIAL_MASS = 1200
FINAL_MASS = 700
def v_burnout(I_sp, t_burn, w_launch, w_burnout):
return I_sp * g*np.log(w_launch/w_burnout)
def main():
t = np.linspace(0, BURN_TIME, 500)
m_propellant = INITIAL_MASS - FINAL_MASS
w_propellant_0 = g*m_propellant
w_rocket = g*FINAL_MASS
weight_flow_rate = w_propellant_0/BURN_TIME
v_exit = I_sp*g
w_propellant = w_propellant_0 - weight_flow_rate*t
thrust = weight_flow_rate*v_exit*g
w_total = w_rocket + w_propellant
acceleration_g = thrust/w_total
plt.plot(t, acceleration_g)
plt.show()
if __name__ == "__main__":
main()
```
![](./timed_burn.png)

View File

@ -0,0 +1,35 @@
import numpy as np
import matplotlib.pyplot as plt
P_TX = 7E3
LOSS_TX = 10**(5/10)
GAIN_TX = 10**(35/10)
MAX_RANGE = 60E3
TARGET_AREA = 1
def PDMS(tx_power, tx_gain, radar_cross_section, tx_loss, dist_source_target, dist_target_missile):
tx_p_gain = (tx_power*tx_gain) / (4*np.pi*tx_loss)
p_ref = radar_cross_section / (dist_source_target**2)
p_rx = 1 / (4*np.pi*dist_target_missile**2)
return tx_p_gain * p_ref * p_rx
def main():
pd_min = PDMS(P_TX, GAIN_TX, TARGET_AREA, LOSS_TX, MAX_RANGE, MAX_RANGE)
pd_min_db = 10*np.log10(pd_min)
print(pd_min_db)
illumination_percent = np.arange(0.1, 1.1, 0.1)
max_range = MAX_RANGE/illumination_percent
plt.plot(100*illumination_percent, max_range)
plt.xlabel("Illumination Percent")
plt.ylabel("Max Range [km]")
plt.savefig("illumination-percent-range.png")
plt.show()
if __name__ == "__main__":
main()

View File

@ -10,8 +10,11 @@ g = 9.81
def specific_impulse(v_burnout, w_launch, w_burnout):
return v_burnout / (g*np.log(w_launch/w_burnout))
def v_burnout(I_sp, t_burn, w_launch, w_burnout):
return I_sp * g*np.log(w_launch/w_burnout)
def main():
def exit_velocity():
plt.figure(figsize=(16,9))
v_burnout = 1000
w_rocket = 300
@ -61,6 +64,32 @@ def main():
plt.savefig("rocket_motor.png")
plt.show()
def main():
I_sp = 250
t_burn = 14
t = np.linspace(0, t_burn, 500)
m_0 = 1200
m_final = 700
m_propellant = m_0 - m_final
w_propellant_0 = g*m_propellant
w_rocket = g*m_final
weight_flow_rate = w_propellant_0/t_burn
v_exit = I_sp*g
w_propellant = w_propellant_0 - weight_flow_rate*t
thrust = weight_flow_rate*v_exit*g
w_total = w_rocket + w_propellant
acceleration_g = thrust/w_total
plt.plot(t, acceleration_g)
plt.savefig("timed_burn.png")
plt.show()
if __name__ == "__main__":
main()

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB