Skip to content

Commit 1399fdd

Browse files
committed
q06,08,10修正
1 parent 2b844ec commit 1399fdd

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

kkoiso/chapter05/q06.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
x2 = np.roll(s, 10) + epsilon
2424
x3 = np.roll(s, 20) + epsilon
2525

26-
x = (x1 + x2 + x3) / 3
26+
x = x1 + x2 + x3
2727
plt.figure(figsize=(10, 6))
2828
plt.plot(t[: int(0.01 * fs)], x[: int(0.01 * fs)])
2929
plt.xlabel("Time [s]")

kkoiso/chapter05/q08.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ def plot_beam_pattern(w_f, p, fs):
2727
theta = 45
2828
F = 1000
2929
linear_coords = [((m - 1) * d, 0) for m in range(M)]
30-
31-
3230
fs = 16000
3331

3432

kkoiso/chapter05/q10.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import matplotlib.pyplot as plt
33
from scipy.signal import stft
44
from q04 import spatial_correlation_matrix
5+
from q01 import array_manifold_vector_linear
56

67

78
def compute_spatial_spectrum(z, p, fs):
@@ -12,7 +13,7 @@ def compute_spatial_spectrum(z, p, fs):
1213
tau = np.array([0, 10 / fs, 20 / fs])
1314

1415
for i, theta in enumerate(angles):
15-
w = 1 / 3 * np.exp(-1j * 2 * np.pi * np.cos(np.deg2rad(theta)) * tau[:, None])
16+
w = 1 / 3 * np.exp(-1j * 2 * np.pi * theta * tau)
1617
for f_bin in range(20, 31):
1718
P[f_bin, i] = np.abs(np.conj(w.T).dot(R_z[f_bin]).dot(w))
1819

0 commit comments

Comments
 (0)