There was a need for quick and dirty approximation of the magnitude of the 3-dimensional vector (x,y,z). This is what worked best: Let x = max(x,y,z) Then magnitude ~ x + 0.25*(y+z) Accuracy ~ 13% Interestingly, this provides for better accuracy then the sequential use of the two 2d approximations (see Lyons's "Root of all evils"). Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Magnitude of a 3d vector
Started by ●March 27, 2011
Reply by ●March 27, 20112011-03-27
Perhaps there are better choices than .25. Better, of course, would depend on the criterion of goodness. Grant Griffin computed several "optima" for the two-dimensional case. See http://dspguru.com/dsp/tricks/magnitude-estimator Jerry -- Engineering is the art of making what you want from things you can get.
Reply by ●March 28, 20112011-03-28
On Mar 27, 11:08�am, Jerry Avins <j...@ieee.org> wrote:> Perhaps there are better choices than .25. Better, of course, would depend on the criterion of goodness. Grant Griffin computed several "optima" for the two-dimensional case. Seehttp://dspguru.com/dsp/tricks/magnitude-estimator > > Jerry > -- > Engineering is the art of making what you want from things you can get.Hello Jerry, and Vlad, The details of where the optimal 2-D coefs came from is here: http://www.claysturner.com/dsp/FastMagnitude.pdf Clay
Reply by ●March 28, 20112011-03-28
On 03/28/2011 10:25 AM, Clay wrote:> On Mar 27, 11:08 am, Jerry Avins<j...@ieee.org> wrote: >> Perhaps there are better choices than .25. Better, of course, would depend on the criterion of goodness. Grant Griffin computed several "optima" for the two-dimensional case. Seehttp://dspguru.com/dsp/tricks/magnitude-estimator >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can get. > > Hello Jerry, and Vlad, > > The details of where the optimal 2-D coefs came from is here: > > http://www.claysturner.com/dsp/FastMagnitude.pdf > > Clay >That's a NICE piece of analysis, Clay! -- Randy Yates Digital Signal Labs 919-577-9882 http://www.digitalsignallabs.com yates@digitalsignallabs.com
Reply by ●March 29, 20112011-03-29
On 27-03-2011 at 15:52:23 Vladimir Vassilevsky <nospam@nowhere.com> wrote:> > There was a need for quick and dirty approximation of the magnitude of > the 3-dimensional vector (x,y,z). This is what worked best: > > Let x = max(x,y,z) > Then magnitude ~ x + 0.25*(y+z) > Accuracy ~ 13% > > Interestingly, this provides for better accuracy then the sequential use > of the two 2d approximations (see Lyons's "Root of all evils").On what conditions? -- Mikolaj
Reply by ●March 29, 20112011-03-29
Mikolaj wrote:> On 27-03-2011 at 15:52:23 Vladimir Vassilevsky <nospam@nowhere.com> wrote: > >> >> There was a need for quick and dirty approximation of the magnitude >> of the 3-dimensional vector (x,y,z). This is what worked best: >> >> Let x = max(x,y,z) >> Then magnitude ~ x + 0.25*(y+z) >> Accuracy ~ 13% >> >> Interestingly, this provides for better accuracy then the sequential >> use of the two 2d approximations (see Lyons's "Root of all evils"). > > > On what conditions?If two 2d approximations are used to make a 3d approximation, the max. error is close to the sum of the worst case errors of 2d approximations. This makes the simplistic 2d approximations inappropriate for the 3d job. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●March 29, 20112011-03-29
On 29-03-2011 at 15:55:32 Vladimir Vassilevsky <nospam@nowhere.com> wrote:> > > Mikolaj wrote: >> On 27-03-2011 at 15:52:23 Vladimir Vassilevsky <nospam@nowhere.com> >> wrote: >> >>> >>> There was a need for quick and dirty approximation of the magnitude >>> of the 3-dimensional vector (x,y,z). This is what worked best: >>> >>> Let x = max(x,y,z) >>> Then magnitude ~ x + 0.25*(y+z) >>> Accuracy ~ 13% >>> >>> Interestingly, this provides for better accuracy then the sequential >>> use of the two 2d approximations (see Lyons's "Root of all evils"). >> On what conditions? > > If two 2d approximations are used to make a 3d approximation, the max. > error is close to the sum of the worst case errors of 2d approximations. > This makes the simplistic 2d approximations inappropriate for the 3d job. > > Vladimir Vassilevsky > DSP and Mixed Signal Design Consultant > http://www.abvolt.comBut there are constraints from divergention of this approximation. Any assumptions on this vectors? Vectors must be of some kind I suppose. It can be calculated (maybe unique solution maybe not). x=1, y=1, z=100 - doesn't work. -- Mikolaj
Reply by ●March 29, 20112011-03-29
Mikolaj wrote:> On 29-03-2011 at 15:55:32 Vladimir Vassilevsky <nospam@nowhere.com> wrote: > >> >> >> Mikolaj wrote: >> >>> On 27-03-2011 at 15:52:23 Vladimir Vassilevsky <nospam@nowhere.com> >>> wrote: >>> >>>> >>>> There was a need for quick and dirty approximation of the magnitude >>>> of the 3-dimensional vector (x,y,z). This is what worked best: >>>> >>>> Let x = max(x,y,z)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here>>>> Then magnitude ~ x + 0.25*(y+z) >>>> Accuracy ~ 13% >>>> >>>> Interestingly, this provides for better accuracy then the >>>> sequential use of the two 2d approximations (see Lyons's "Root of >>>> all evils"). >>> >>> On what conditions? >> >> >> If two 2d approximations are used to make a 3d approximation, the >> max. error is close to the sum of the worst case errors of 2d >> approximations. This makes the simplistic 2d approximations >> inappropriate for the 3d job. >> >> Vladimir Vassilevsky >> DSP and Mixed Signal Design Consultant >> http://www.abvolt.com > > > But there are constraints from divergention of this approximation. > Any assumptions on this vectors? > Vectors must be of some kind I suppose. It can be calculated (maybe > unique solution maybe not). > x=1, y=1, z=100 - doesn't work.Read from the beginning.
Reply by ●March 29, 20112011-03-29
On Mar 29, 3:25�pm, Vladimir Vassilevsky <nos...@nowhere.com> wrote:> Mikolaj wrote: > > On 29-03-2011 at 15:55:32 Vladimir Vassilevsky <nos...@nowhere.com> wrote: > > >> Mikolaj wrote: > > >>> On 27-03-2011 at 15:52:23 Vladimir Vassilevsky <nos...@nowhere.com> � > >>> wrote: > > >>>> There was a need for quick and dirty approximation of the magnitude � > >>>> of �the 3-dimensional vector (x,y,z). This is what worked best: > > >>>> Let x = max(x,y,z) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Here > > > > > > >>>> Then magnitude ~ x + 0.25*(y+z) > >>>> Accuracy ~ 13% > > >>>> Interestingly, this provides for better accuracy then the > >>>> sequential �use �of the two 2d approximations (see Lyons's "Root of > >>>> all evils"). > > >>> � On what conditions? > > >> If two 2d approximations are used to make a 3d approximation, the > >> max. �error is close to the sum of the worst case errors of 2d > >> approximations. �This makes the simplistic 2d approximations > >> inappropriate for the 3d job. > > >> Vladimir Vassilevsky > >> DSP and Mixed Signal Design Consultant > >>http://www.abvolt.com > > > But there are constraints from divergention of this approximation. > > Any assumptions on this vectors? > > Vectors must be of some kind I suppose. It can be calculated (maybe > > unique �solution maybe not). > > x=1, y=1, z=100 - doesn't work. > > Read from the beginning.I think the questioner was referring to your error estimate. Let the original vector be (1, b, -b), where b \in [0, 1] . The error is then 1 - (1 / sqrt(1 + 2b^{2}) . As b -> 1, error -> 42%. I presume your error is some kind of expectation over possible vectors, probably the uniform measure on the unit sphere. If there is more information about the probability of input vectors, the expected error might be larger or smaller than your value. Or have I missed something? illywhacker;
Reply by ●March 29, 20112011-03-29






