Re: [Numpy-discussion] help with translating some matlab

2011-02-18 Thread Sturla Molden
I think x.conj().transpose() is too verbose, use x.H instead :-) Sturla Den 18.02.2011 19:11, skrev Neal Becker: > My translation is: > > x1 = rcv[n:n-N:-1] > > z = np.dot (P, x1.conj().transpose()) > > g = z / (_lambda + np.dot (x1, z)) > > y = np.dot (h, x1.conj().transpo

Re: [Numpy-discussion] help with translating some matlab

2011-02-18 Thread Warren Weckesser
On Fri, Feb 18, 2011 at 12:50 PM, Neal Becker wrote: > Neal Becker wrote: > > > My translation is: > > > > x1 = rcv[n:n-N:-1] > > > > z = np.dot (P, x1.conj().transpose()) > > > > g = z / (_lambda + np.dot (x1, z)) > > > > y = np.dot (h, x1.conj().transpose()) > > > > e = x[n-

Re: [Numpy-discussion] help with translating some matlab

2011-02-18 Thread Neal Becker
Neal Becker wrote: > My translation is: > > x1 = rcv[n:n-N:-1] > > z = np.dot (P, x1.conj().transpose()) > > g = z / (_lambda + np.dot (x1, z)) > > y = np.dot (h, x1.conj().transpose()) > > e = x[n-N/2] - y > > h += np.dot (e, g.conj().transpose()) > > P = (P

Re: [Numpy-discussion] help with translating some matlab

2011-02-18 Thread Neal Becker
My translation is: x1 = rcv[n:n-N:-1] z = np.dot (P, x1.conj().transpose()) g = z / (_lambda + np.dot (x1, z)) y = np.dot (h, x1.conj().transpose()) e = x[n-N/2] - y h += np.dot (e, g.conj().transpose()) P = (P - np.dot (g, z.conj().transpose()))/_lambda But

Re: [Numpy-discussion] help with translating some matlab

2011-02-18 Thread Warren Weckesser
On Fri, Feb 18, 2011 at 10:04 AM, Neal Becker wrote: > I got the following matlab code from a colleage: > > initialization: > > h =zeros(1, N); %% initial filter coefficients > lambda =1; > delta =0.001; > > P =eye(N)/delta; > > loop: > > z =P*(x1'); > > g =z/(lambda+ x1*z); > > y = h*x1'; %%

[Numpy-discussion] help with translating some matlab

2011-02-18 Thread Neal Becker
I got the following matlab code from a colleage: initialization: h =zeros(1, N); %% initial filter coefficients lambda =1; delta =0.001; P =eye(N)/delta; loop: z =P*(x1'); g =z/(lambda+ x1*z); y = h*x1'; %% filter output e = ph_cpm_out(n) - y; %% error h = h + e*g'; %% adaptation Pne