第5章前半を追加#72
Open
dksuga11 wants to merge 4 commits into
Open
Conversation
Contributor
|
q02だけ確認が必要かもです |
i14kwmr
reviewed
Aug 8, 2023
| plt.plot(np.arange(0, sec * y.shape[0]) / fs, y) | ||
| plt.plot(np.arange(0, sec * y.shape[0]) / fs, x1_pad) | ||
| plt.xlim(0.02, 0.04) | ||
| plt.savefig("q07.pdf") |
Collaborator
There was a problem hiding this comment.
以下のコードを記述するとSNRの比較ができます!参考までに
S1 = my_stft(L, S, s, win)
_x1 = my_istft(S, X1, win)
_s1 = my_istft(S, S1, win)
print("input SNR:", 10 * np.log10(np.sum(_s1 ** 2) / np.sum((_x1 - _s1) ** 2))) # input SNR: 9.95
print("output SNR:", 10 * np.log10(np.sum(_s1 ** 2) / np.sum((y - _s1) ** 2))) # output SNR: 14.51
i14kwmr
reviewed
Aug 8, 2023
| F = L // 2 + 1 | ||
| fs = 16000 | ||
|
|
||
| d_list = [2, 5, 10] # マイク間隔 |
Collaborator
There was a problem hiding this comment.
コメント:
単位はmとなっているので、意図する2 [cm], 5 [cm], 10 [cm]とはなっていないことに注意です
i14kwmr
reviewed
Aug 8, 2023
| w = np.empty([F, 360, M], dtype="complex") | ||
| for f in range(0, F): | ||
| for theta in range(0, 360): | ||
| w[f, theta, :] = q01.linear_array_vector(0.05, M, theta, f) |
Collaborator
There was a problem hiding this comment.
コメント:
q01.linear_array_vector(0.05, M, theta, f)の引数fは周波数を想定しているのに対し、32行目では周波数インデックスを渡しています
def linear_array_vector(d, M, theta, f):
"""直線状アレイのアレイマニフォールドベクトルを求める
Args:
d (double): アレイ間隔
M (int): マイク数
theta (int): 音源方向(y軸から反時計回りが正の向き)
f (int): 周波数
Return:
amv: アレイマニフォールドベクトル
"""
Collaborator
There was a problem hiding this comment.
コメント:
ビームフォーマの式は正しくは
w[f, theta, :] = w[f, theta, :] / (w[f, theta, :].conjugate() @ w[f, theta, :])
Contributor
|
第5章前半 q02について 変更確認しました okです! |
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.
実行結果
q01.py
[0.7868537-0.61713958j 1. +0.j 0.7868537+0.61713958j]
q02.py
[0.7868537 -0.61713958j 0.6148926 +0.78861086j 0.97051349-0.2410468j ]
q04.py
[[[1. +0.j 1.25+0.j]
[1.25+0.j 5.25+0.j]]
[[4. +0.j 1.5 +0.j]
[1.5 +0.j 1.25+0.j]]
[[9. +0.j 0.75+0.j]
[0.75+0.j 0.75+0.j]]]