Fil:Steepest descent.png
Från testwiki
Hoppa till navigering
Hoppa till sök
Storlek på förhandsvisningen: 750 × 600 pixlar. Andra upplösningar: 300 × 240 pixlar | 600 × 480 pixlar | 960 × 768 pixlar | 1 280 × 1 024 pixlar | 1 500 × 1 200 pixlar.
Originalfil (1 500 × 1 200 pixlar, filstorlek: 200 kbyte, MIME-typ: image/png)
Den här filen är från Wikimedia Commons och kan användas av andra projekt. Beskrivningen på dess filbeskrivningssida där visas nedan.
Sammanfattning
| BeskrivningSteepest descent.png |
English: Developed according to [1]. |
| Datum | |
| Källa | Eget arbete |
| Skapare | Kirlf |
| PNG utveckling InfoField | |
| Källkod 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')
|
Licensiering
Jag, upphovsrättsinnehavaren av detta verk, publicerar härmed det under följande licens:
Denna fil har gjorts tillgänglig under licensen Creative Commons Erkännande-DelaLika 4.0 Internationell.
- Du är fri:
- att dela – att kopiera, distribuera och sända verket
- att remixa – att skapa bearbetningar
- På följande villkor:
- erkännande – Du måste ge lämpligt erkännande, ange en länk till licensen och indikera om ändringar har gjorts. Du får göra det på ett lämpligt sätt, men inte på ett sätt som antyder att licensgivaren stödjer dig eller din användning.
- dela lika – Om du remixar, transformerar eller bygger vidare på materialet måste du distribuera dina bidrag under samma eller en kompatibel licens som originalet.
- ↑ Haykin, Simon S. Adaptive filter theory. Pearson Education India, 2008. - p. 108-142, 217-242
Bildtexter
Ingen bildtext har definierats
The example of the step size influence.
Objekt som porträtteras i den här filen
motiv
Denna egenskap har ett värde, men det är okänt
25 februari 2019
image/png
Filhistorik
Klicka på ett datum/klockslag för att se filen som den såg ut då.
| Datum/Tid | Miniatyrbild | Dimensioner | Användare | Kommentar | |
|---|---|---|---|---|---|
| nuvarande | 12 juli 2019 kl. 08.59 | 1 500 × 1 200 (200 kbyte) | wikimediacommons>Kirlf | Additional step size. Grid. |
Filanvändning
Följande sida använder den här filen: