Normalization

Dear all
I need some help to normalize to unit the waves a table.There are 40 waves in total.
Is there any idea?
Thank you in advance
Giannis
Giannis wrote:
Dear all
I need some help to normalize to unit the waves a table.There are 40 waves in total.
Is there any idea?


Would either of these functions be of use?

Function NormalizeByHeight(wname)
      wave wname

      WaveStats/Q wname
      wname/=V_max
      return 0
end

Function NormalizeByArea(wname)
     wave wname

     duplicate/O wname twave
     integrate twave
     WaveStats/Q twave
     wname/=V_max
     killwaves/Z twave
     return 0
end


You can call them from within a larger function that loops through the waves you want to process.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
How about:

MatrixOP/O outWave=Normalize(inWave)

or
MatrixOP/O outWave=NormalizeCols(inWave)

or if you want to normalize to the maximum value:

MatrixOP/O outWave=inWave/maxVal(inWave)

A.G.
WaveMetrics, Inc.
Igor wrote:
How about:
MatrixOP/O outWave=Normalize(inWave)
or
MatrixOP/O outWave=NormalizeCols(inWave)


Sorry for digging old threads out ..... I just got puzzled, because I expected the outcome of outwave1 and outwave2 in the following example to be the same:

function NormalizeTest()

    Make/O/FREE w = {1, 2, 3}  
    Duplicate/O/FREE w outwave1, outwave2
   
    Wavestats/Q w
    outwave1 /= V_Sum
    Print outwave1
   
    MatrixOP/O outwave2 = Normalize(w)
    Print outwave2 
end


It not quite clear to me to what value "Normalize(w)" actually normalizes.

Cheers
Christian

ChrLie wrote:
Sorry for digging old threads out ..... I just got puzzled, because I expected the outcome of outwave1 and outwave2 in the following example to be the same:

function NormalizeTest()

    Make/O/FREE w = {1, 2, 3}  
    Duplicate/O/FREE w outwave1, outwave2
   
    Wavestats/Q w
    outwave1 /= V_Sum
    Print outwave1
   
    MatrixOP/O outwave2 = Normalize(w)
    Print outwave2 
end


It not quite clear to me to what value "Normalize(w)" actually normalizes.


Experiment confirms that MatrixOp Normalize normalizes a wave by its magnitude (that is, the square root of the sum of squares). I confirmed this by doing this:
Make junk=enoise(1)+3
duplicate junk, junk1
junk1 = junk^2
Variable ss = sqrt(sum(junk1))
junk1 = junk/ss

The result is the same as the output of MatrixOp Normalize.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Hello Christian,

The documentation for MatrixOP Normalize() explicitly states:

"Normalization is such that the returned wave should have a unity magnitude..."

A.G.
WaveMetrics, Inc.
Hi John and AG,

thanks for pointing this out. I did look into the manual, but I missunderstood the term "unity magnitude".

C