VLSI homework 10, ECOMMS homework 3

This commit is contained in:
2024-11-11 09:22:09 -05:00
parent faa05b88f9
commit 660744cf30
11 changed files with 171 additions and 12 deletions

View File

@@ -4,6 +4,7 @@ import matplotlib.pyplot as plt
# Modulation index
beta = 2.0
A_c = 1
# Number of impulses is 2*(beta+1) + 1.
# For beta=2, the number of impulses is 3 either side of the center frequency
@@ -15,12 +16,20 @@ f_m = 15E+3
# Transmission bandwidth
B_T = 2*(beta+1)*f_m
n = np.arange(0,10,1)
bessel_values = sp.special.jv(n,beta)
bessel_power = np.cumsum(bessel_values)
print(B_T)
n = np.arange(-3,4,1)
bessel_values = np.abs(sp.special.jv(n,beta))
N = np.arange(-100,100)
bessel_power = np.sum(np.abs(sp.special.jv(N,beta)))
plt.stem(n, bessel_values)
plt.plot(n, bessel_power)
plt.hlines(0.98*bessel_power[-1], xmin=n[0], xmax=n[-1])
plt.plot(n, np.cumsum(bessel_values**2), label="Cumulative power in Carson rule bandwidth", color="red")
#plt.plot(n, bessel_power)
plt.hlines(0.98, xmin=n[0], xmax=n[-1], label="98% of total power", color="orange")
plt.legend()
plt.show()
#
P_C = 0.5 * A_c**2 * np.sum(bessel_values**2)
P = 0.5 * A_c**2
print("Percent of total power:", P_C / P)