add chapter05後半#74
Open
imamura-eigetsu wants to merge 1 commit into
Open
Conversation
i14kwmr
reviewed
Aug 8, 2023
| plt.plot(a[L - S :]) | ||
| plt.xlim([0, 0.01 * fs]) | ||
| plt.legend(["obs,(x1)", "enh"]) | ||
| plt.show() |
Collaborator
There was a problem hiding this comment.
コメント:
ちなみにですが、以下のコードを記述すると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
i14kwmr
reviewed
Aug 8, 2023
| psi[_f, theta] = np.conjugate(w[_f]) @ a | ||
|
|
||
| plt.pcolormesh(deg, f, 20 * np.log10(abs(psi))) | ||
| plt.colorbar() |
Collaborator
There was a problem hiding this comment.
コメント:
出力されるビームパターンを見ると、暗い色が緑 (-40くらい?)で最小値の-120のような青の部分はほとんどない印象を受けました!現状、色は黄色 ([0, -20]のあたり)に集中しているので、もう少しカラーバーの範囲 (plt.clim)を狭めると細かい調査ができて良いかと感じました!
i14kwmr
reviewed
Aug 8, 2023
| S = 512 | ||
| d = 0.05 | ||
| fs = 16000 | ||
| p = np.array([[-d, 0, 0], [0, 0, 0], [d, 0, 0]]) |
Collaborator
There was a problem hiding this comment.
コメント:
ここはq01.pyでやっているように
pm = np.array([(m - (M - 1) // 2) * d, 0, 0])のように書くとスマートだと思います!
i14kwmr
reviewed
Aug 8, 2023
|
|
||
| x = np.zeros((3, len(y))) | ||
| for i in range(len(x)): | ||
| x[i] = np.roll(y, i * 10) + white_noise |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.