[PD] Normaliizing sinus mix

IOhannes m zmoelnig zmoelnig at iem.at
Mon Apr 30 11:13:58 CEST 2018


On 2018-04-30 10:25, João Pais wrote:
> Hi William,
> 
> 
>> Hi Joao, you need to find the peak amplitude, max(abs(x)), and divide
>> all samples by that.
> 
> I'm not sure: if I use the amplitudes 1 0.5 0.25, the peak amplitude is
> 1, and the wave is clearly outside of the 1/-1 boundaries.

then you are doing something wrong.
why do you think the maximum of abs(sin(t)+½sin(2t)+¼sin(4t)) is "1"?

to analytically get the maxima of this function, you probably have to
recall your high-school maths (get the derivative of the function
(without the abs()), set it to "0" and solve it for every t to find the
positions of the extrema; use these t's to get the values of the extrema)

> Basically what I'm trying to do is to find out what is the formula that
> does the "normalize" function.

however, the "formula" of "normalize is very simple:
- take a table
- iterate over all the elements of the table and get the maximum value
(absolute) you find in there
- iterate over all the elements of the table and divide each element by
the just found maximum.

gfmasdr
IOhannes


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180430/236dd790/attachment.sig>


More information about the Pd-list mailing list