fnorm - function to normalize a signal (by L2 norm or a user provided value).
int fnorm( int npts, float *fscal, float s1[], float s2[] )
Basic Seismic
Utilities (BSU) function normalizes a signal by its L2 norm,
or by a user provided value. Setting the scale factor to
zero results in L2 norm scaling. That is, the data are
divided by the L2 norm of the original signal.
C-language version.
Arguments
npts (int)
Number of samples in the signal.
*fscal (float)
Scale factor to apply.
0=Determine the L2 norm s2=s1/L2Norm(s1)
Non-zero=
s2=s1/(*fscal)
s1[] (float)
Input signal
s2[] (float)
Output signal
NOTE: |
For an example, see this function used in bagc.c |
bagc(1)
No known bugs
Copyright © 2024 by Paul Michaels
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
P. Michaels, PE. <[email protected]>