Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add chapter05後半 #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

imamura-eigetsu
Copy link
Contributor

No description provided.

plt.plot(a[L - S :])
plt.xlim([0, 0.01 * fs])
plt.legend(["obs,(x1)", "enh"])
plt.show()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメント:

ちなみにですが、以下のコードを記述するとSNRの比較ができます!参考までに
ポイントは信号をSTFT->iSTFTして信号長を揃えているところです(ビームフォーミング処理以外は同じ)

  • s1: [STFT] -> [iSTFT]
  • x1: [STFT] -> [iSTFT]
  • a: [STFT] -> [ビームフォーミング] -> [iSTFT]
S1 = stft(s1, L, S, wnd)
_x1 = istft(S, X1)
_s1 = istft(S, S1)
print("input SNR:", 10 * np.log10(np.sum(_s1 ** 2) / np.sum((_x1 - _s1) ** 2)))  # input SNR: 10.00
print("output SNR:", 10 * np.log10(np.sum(_s1 ** 2) / np.sum((a - _s1) ** 2)))  # output SNR: 14.68

psi[_f, theta] = np.conjugate(w[_f]) @ a

plt.pcolormesh(deg, f, 20 * np.log10(abs(psi)))
plt.colorbar()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメント:

出力されるビームパターンを見ると、暗い色が緑 (-40くらい?)で最小値の-120のような青の部分はほとんどない印象を受けました!現状、色は黄色 ([0, -20]のあたり)に集中しているので、もう少しカラーバーの範囲 (plt.clim)を狭めると細かい調査ができて良いかと感じました!

S = 512
d = 0.05
fs = 16000
p = np.array([[-d, 0, 0], [0, 0, 0], [d, 0, 0]])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメント:

ここはq01.pyでやっているように
pm = np.array([(m - (M - 1) // 2) * d, 0, 0])のように書くとスマートだと思います!


x = np.zeros((3, len(y)))
for i in range(len(x)):
x[i] = np.roll(y, i * 10) + white_noise
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメント:

ここの信号の作成については注意が必要です!
プルリクエスト #67 より該当部分

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants