-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: main
Are you sure you want to change the base?
add chapter05後半 #74
Conversation
plt.plot(a[L - S :]) | ||
plt.xlim([0, 0.01 * fs]) | ||
plt.legend(["obs,(x1)", "enh"]) | ||
plt.show() |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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]]) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.