Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
X = A\B doesn't solve AX = B ?

Subject: X = A\B doesn't solve AX = B ?

From: Matthias Stock

Date: 1 Mar, 2004 22:37:10

Message: 1 of 4

Hello,
is someone able to find the problem in following lines?
My problem is that the h1 = h, but h2 not
I want to have h2 = h although adding noise (stoep = ytoep + noise).
But the h2 is a singular value, why? How can I change the code to get
h2 = h (about solving equation).

Thanks for any hint!
Matthias.

By copying following lines in your CommandWindow,
you will see that h2 ~=h

******COPY IN COMMAND WINDOW*****BEGIN*****
% here are the values to run the simulation
x1=[1;1;-1;1;-1;1;1;-1;1;-1;1;1;-1;1;1;-1;1;-1;1;1;-1;1;-1;1;1;-1]
h=[0.1337;-0.3781;-0.4602;0.8787;-0.6365]


% building a toeplitz-matrix to solve system of equation

r=x1(q:-1:1) % q values of h, which have to be
computed c=x1(q:1:p+q-1) % q unknown values, that's why i
                                          % need at least q rows,
                                          % p values because of cyclic
convolution xtoep=toeplitz(c,r) % Toeplitz-Matrix
ytoep=xtoep*h % "cyclic-convolution" xtoep and h

stoep=(0.1*randn(p,1))+ytoep % add noise

h1=xtoep\ytoep % computing the q values of h
h2=stoep\ytoep % computing the q values of h
                                     % with the added noise,
                                     % here's the problem, the noise
                                     % is probably reason for
                                     % computing a wrong h2

h % h, to compare it with h1 and h2
******COPY IN COMMAND WINDOW*****END*****


begin 666 frown.gif
M1TE&.#EA#P`/`)$``````+V]O8RM_[V]O2'Y! $```,`+ `````/``\```(O
MG V9QY,"X6) QBK P?A*E$5BI76/9*:7*K:K"Y^H,CK6^-GPM>U9(T,U-@H-
$HP``.P``
`
end

Subject: X = A\B doesn't solve AX = B ?

From: Matthias Stock

Date: 2 Mar, 2004 11:59:44

Message: 2 of 4

Matthias Stock <Matthias.Stock@REMunibw-muenchen.de> wrote:
> Hello,
> is someone able to find the problem in following lines?
> My problem is that the h1 = h, but h2 not
> I want to have h2 = h although adding noise (stoep = ytoep + noise).

... I found my fault!
h2=xtoep\stoep

:-)

> stoep=(0.1*randn(p,1))+ytoep % add noise
>
> h1=xtoep\ytoep % computing the q values of h
> h2=stoep\ytoep % computing the q values of h

Subject: X = A\B doesn't solve AX = B ?

From: nospamspellucci@fb04373.mathematik.tu-darmstadt.de (Peter Spellucci)

Date: 2 Mar, 2004 12:06:45

Message: 3 of 4


In article <4043ad13$1@news.unibw-muenchen.de>,
 "Matthias Stock" <Matthias.Stock@REMunibw-muenchen.de> writes:
 >Hello,
 >is someone able to find the problem in following lines?
 >My problem is that the h1 = h, but h2 not
 >I want to have h2 = h although adding noise (stoep = ytoep + noise).
 >But the h2 is a singular value, why? How can I change the code to get
 >h2 = h (about solving equation).
 >
 >Thanks for any hint!
 >Matthias.
 >
 >By copying following lines in your CommandWindow,
 >you will see that h2 ~=h
 >
 >******COPY IN COMMAND WINDOW*****BEGIN*****
 >% here are the values to run the simulation
 >x1=[1;1;-1;1;-1;1;1;-1;1;-1;1;1;-1;1;1;-1;1;-1;1;1;-1;1;-1;1;1;-1]
 >h=[0.1337;-0.3781;-0.4602;0.8787;-0.6365]
 >
 >
 >% building a toeplitz-matrix to solve system of equation

q and p undefined


 >
 >r=x1(q:-1:1) % q values of h, which have to be
 >computed c=x1(q:1:p+q-1) % q unknown values, that's why i
 > % need at least q rows,
 > % p values because of cyclic
 > convolution xtoep=toeplitz(c,r) % Toeplitz-Matrix
 >ytoep=xtoep*h % "cyclic-convolution" xtoep and h
 >
 >stoep=(0.1*randn(p,1))+ytoep % add noise
 >
 >h1=xtoep\ytoep % computing the q values of h
 >h2=stoep\ytoep % computing the q values of h


maybe you meant here xtoep\stoep?
and why at all should be h1=h2 ???
do you believe that random noise could be completely filtered out?

 > % with the added noise,
 > % here's the problem, the noise
 > % is probably reason for
 > % computing a wrong h2
 >
 >h % h, to compare it with h1 and h2
 

Subject: X = A\B doesn't solve AX = B ?

From: Matthias Stock

Date: 2 Mar, 2004 17:02:52

Message: 4 of 4

Peter Spellucci <nospamspellucci@fb04373.mathematik.tu-darmstadt.de>
wrote:
> >% building a toeplitz-matrix to solve system of equation
>
> q and p undefined

yes, p>q, in the example it was p=10, q=5
it works fine with p=2q


> maybe you meant here xtoep\stoep?

yes, that was my big mistake...
i realized it today in the morning

> and why at all should be h1=h2 ???
> do you believe that random noise could be completely filtered out?

yes, i want to filter it out as good as possible,
therefore i need an algorithmus.

at the moment my onliest idea is to loop i times and
divide with i... :-(

h1~=h2, but approximately it should be equal...


Thanks for your answer,
Matthias.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us