File:Steepest descent.png
原本檔案 (1,500 × 1,200 像素,檔案大細:200 KB ,MIME類型:image/png)
摘要
描述Steepest descent.png |
English: Developed according to [1]. |
日期 | |
來源 | 自己作品 |
作者 | Kirlf |
PNG genesis InfoField | This plot was created with Matplotlib. |
原始碼 InfoField | Python codeimport numpy as np
import matplotlib.pyplot as plt
from scipy.linalg import toeplitz
def convmtx(h,n):
return toeplitz(np.hstack([h, np.zeros(n-1)]), np.hstack([h[0], np.zeros(n-1)]))
def MSE_calc(sigmaS, R, p, w):
w = w.reshape(w.shape[0], 1)
wH = np.conj(w).reshape(1, w.shape[0])
p = p.reshape(p.shape[0], 1)
pH = np.conj(p).reshape(1, p.shape[0])
MSE = sigmaS - np.dot(wH, p) - np.dot(pH, w) + np.dot(np.dot(wH, R), w)
return MSE[0, 0]
def mu_opt_calc(gamma, R):
gamma = gamma.reshape(gamma.shape[0], 1)
gammaH = np.conj(gamma).reshape(1, gamma.shape[0])
mu_opt = np.dot(gammaH, gamma) / np.dot(np.dot(gammaH, R), gamma)
return mu_opt[0, 0]
M = 5 # number of sensors
h = np.array([0.722-1j*0.779, -0.257-1j*0.722, -0.789-1j*1.862])
L = len(h)-1 # number of signal sources
H = convmtx(h,M-L)
sigmaS = 1 # the desired signal's (s(n)) power
sigmaN = 0.01 # the noise's (n(n)) power
# The correlation matrix of the received signal:
# Rxx = E\{x(n)x(n)^{H}\}, where ^\{H\} means Hermitian
Rxx = (sigmaS)*(np.dot(H,np.matrix(H).H))+(sigmaN)*np.identity(M)
# The cross-correlation vector between the tap-input vector x(n) and the desired response s(n):
p = (sigmaS)*H[:,0]
p = p.reshape((len(p), 1))
# Solution of the Wiener-Hopf equation:
wopt = np.dot(np.linalg.inv(Rxx), p)
MSEopt = MSE_calc(sigmaS, Rxx, p, wopt)
# Steepest descent algorithm testing:
coeff = np.array([1, 0.9, 0.5, 0.2, 0.1])
lamda_max = max(np.linalg.eigvals(Rxx))
mus = 2/lamda_max*coeff # different step sizes
N_steps = 100
MSE = np.empty((len(mus), N_steps), dtype=complex)
for mu_idx, mu in enumerate(mus):
w = np.zeros((M,1), dtype=complex)
for N_i in range(N_steps):
w = w - mu*(np.dot(Rxx, w) - p)
MSE[mu_idx, N_i] = MSE_calc(sigmaS, Rxx, p, w)
MSEoptmu = np.empty((1, N_steps), dtype=complex)
w = np.zeros((M,1), dtype=complex)
for N_i in range(N_steps):
gamma = p - np.dot(Rxx,w)
mu_opt = mu_opt_calc(gamma, Rxx)
w = w - mu_opt*(np.dot(Rxx,w) - p)
MSEoptmu[:, N_i] = MSE_calc(sigmaS, Rxx, p, w)
x = [i for i in range(1, N_steps+1)]
plt.figure(figsize=(5, 4), dpi=300)
for idx, item in enumerate(coeff):
if item == 1:
item = ''
plt.loglog(x, np.abs(MSE[idx, :]), label='$\mu = '+str(item)+'\mu_{max}$')
plt.loglog(x, np.abs(MSEoptmu[0, :]), label='$\mu = \mu_{opt}$')
plt.loglog(x, np.abs(MSEopt*np.ones((len(x), 1), dtype=complex)), label = 'Wiener solution')
plt.grid(True)
plt.xlabel('Number of steps')
plt.ylabel('Mean-Square Error')
plt.title('Steepest descent')
plt.legend(loc='best')
plt.minorticks_on()
plt.grid(which='major')
plt.grid(which='minor', linestyle=':')
plt.savefig('SD.png')
|
協議
我,呢份作品嘅作者,決定用以下許可發佈呢件作品:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- 你可以:
- 去分享 – 複製、發佈同傳播呢個作品
- 再改 – 創作演繹作品
- 要遵照下面嘅條件:
- 署名 – 你一定要畀合適嘅表彰、畀返指向呢個授權條款嘅連結,同埋寫明有無改過嚟。你可以用任何合理方式去做,但唔可以用任何方式暗示授權人認可咗你或者你嘅使用方式。
- 相同方式分享 – 如果你用任何方式改過呢個作品,你必須要用返原本或者相似嘅條款發佈。
- ↑ Haykin, Simon S. Adaptive filter theory. Pearson Education India, 2008. - p. 108-142, 217-242
Items portrayed in this file
圖中顯示嘅係
creator 英文
some value
25 2 2019
image/png
檔案歷史
撳個日期/時間去睇響嗰個時間出現過嘅檔案。
日期/時間 | 縮圖 | 尺寸 | 用戶 | 註解 | |
---|---|---|---|---|---|
現時 | 2019年7月12號 (五) 07:59 | 1,500 × 1,200(200 KB) | Kirlf | Additional step size. Grid. | |
2019年2月25號 (一) 11:43 | 1,500 × 1,200(142 KB) | Kirlf | User created page with UploadWizard |
檔案用途
以下嘅1版用到呢個檔:
全域檔案使用情況
下面嘅維基都用緊呢個檔案:
- en.wikipedia.org嘅使用情況
Metadata
呢個檔案有額外嘅資料。佢應該係數碼相機或者掃描器整出來嘅。如果佢整咗之後畀人改過,裏面嘅資料未必同改過之後相符。
橫解像度 | 118.11 dpc |
---|---|
直解像度 | 118.11 dpc |
用過嘅軟件 |
|