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 chapter04 #64

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

Conversation

todayka
Copy link
Contributor

@todayka todayka commented Jul 18, 2023

No description provided.

@todayka
Copy link
Contributor Author

todayka commented Jul 18, 2023

再構成誤差
q07: 8.711289500392589e-30
q08: 2.4696392903797305e-05

物理量
「時間インデックス0に対して0秒」
「周波数インデックス0に対して0Hz」


X = stft(x, L, S, w)

# プロット
Copy link
Collaborator

Choose a reason for hiding this comment

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

コメント:

x, y軸をインデックスではなく、周波数、時間といった物理量にできると良いと思いました!

ざっくりしたやり方はytakeuchiくんのやつを参考にしてもらえると!(url)

return w_synth


# 確認
Copy link
Collaborator

Choose a reason for hiding this comment

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

コメント:

確認コードがあって良いと思います!
網羅的に確認するときは、ytakeuchiくんの確認コード(url)が参考になるかもです!



# 合成窓
def window_synth(w, L, S):
Copy link
Collaborator

Choose a reason for hiding this comment

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

コメント:

細かいですが、演習問題としては、関数の入力は「シフト幅S」と「L点の窓関数」の2つを意図していました!その場合ですが、Lは関数内でlen(w)とかを用いて取得する感じになるかと!


x_pad = zero_pad(x, L, S)

# 再構成誤差
Copy link
Collaborator

Choose a reason for hiding this comment

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

コメント:

再構成誤差の計算についてですが、np.sum(x_pad - x_istft) ** 2ではなく、np.sum((x_pad - x_istft) ** 2)にする必要があるかと!x_pad - x_istftだと、誤差が大きかった場合でも正負の関係で打ち消しが起こってしまって誤差が小さく出てしまうことがあります

例えば、信号の誤差が[-10, 10, -10, 10]の場合、

  • np.sum(x_pad - x_istft) ** 2=0
  • np.sum((x_pad - x_istft) ** 2)=400

となります

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