Consultant lab 4

This commit is contained in:
Aidan Sharpe 2025-05-05 11:41:09 -04:00
parent 3833f0329a
commit ae4ff9682b
7 changed files with 57 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -0,0 +1,13 @@
% Set up x[n] for N=8
N = 8;
n = 0 : N-1
x = (-1.0).^n;
% 8-point DFT for N=8
dft8 = fft(x, 8);
stem(abs(dft8));
% 9-point DTF for N=8
figure(2);
dft9 = fft(x, 9);
stem(abs(dft9));

View File

@ -0,0 +1,29 @@
import numpy as np
import matplotlib.pyplot as plt
# Set up N=8
N = 8
n = np.arange(N)
x = (-1.0)**n
# 8-point DFT, N=8
DFT_8_point = np.fft.fft(x, 8)
plt.stem(abs(DFT_8_point))
plt.savefig("N8_point_dft.png")
plt.show()
# 9-point DFT, N=8
DFT_9_point = np.fft.fft(x, 9)
plt.stem(abs(DFT_9_point))
plt.savefig("Q9_point_dft.png")
plt.show()
# 9-point DFT, N=9
N = 9
n = np.arange(N)
x = (-1.0)**n
DFT_9_point = np.fft.fft(x, 9)
plt.stem(abs(DFT_9_point))
plt.savefig("N9_point_dft.png")
plt.show()

View File

@ -0,0 +1,10 @@
syms n a b
f1 = a^n;
ztrans(f1);
f2 = (n+1) * a^n * heaviside(n);
ztrans(f2);
f3 = a^n * cos(b*n) heaviside(n);
ztrans(f3);

View File

@ -0,0 +1,5 @@
syms z
f1 = iztrans(z / (z+0.5))
f2 = iztrans(z^2 / (z-0.8)^2 )
f3 = simplify(iztrans(z / ( (z+0.3)*(z+0.6)^2 ))