Sponsored Content
Top Forums Shell Programming and Scripting floating point number problem Post 302421257 by fpmurphy on Friday 14th of May 2010 01:51:57 AM
Old 05-14-2010
This simple example should help you figure out what you need to do
Code:
$ cat log
10
233
33
333
232
$ awk '{ SUM += $1 } END { print SUM }' log
841
$

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem with floating point numbers in awk

hi all, i have the following problem using awk in a script i want to read the values from a column with real numbers and calculate the mean.the problem is that when i use a statement such as this num = $4 i cant find a way to convert the variable from string to floating point to perform... (7 Replies)
Discussion started by: kanagias
7 Replies

2. Shell Programming and Scripting

floating point addition

hi, :) I have a file like this 10.456 123.567 456.876 234.987 ........ ....... What i want to do is ia have to add all those numbers and put the result in some other file. Any help pls. cheers RRK (8 Replies)
Discussion started by: ravi raj kumar
8 Replies

3. Programming

floating point problem

Hi all! Hi all! I am working with a problem to find the smallest floating point number that can be represented. I am going in a loop ,stating with an initial value of 1.0 and then diving it by 10 each time thru the loop. So the first time I am getting o.1 which I wanted.But from the next... (4 Replies)
Discussion started by: vijlak
4 Replies

4. Linux

Floating Point Exception

Hi, I am compiling "HelloWorld" C progam on 32-bit CentOS and i want to execute it on 64-bit CentOS architecture. For that i copied the a.out file from 32-bit to 64-bit machine, but while executing a.out file on 64bit machine I am getting "Floating point exception error". But we can run... (3 Replies)
Discussion started by: Mandar123
3 Replies

5. Shell Programming and Scripting

using bc with floating point number in files

Hi, I' using bash and I would like to use "bc" to compute the ratio of of two numbers and assign the ratio to a variable. The numbers are in a file, e.g. 196.304492 615.348986 Any idea how to do it? N.B. I cannot change the file to have 196.304492 / 615.348986 as the file is produced by... (14 Replies)
Discussion started by: f_o_555
14 Replies

6. Shell Programming and Scripting

problem with floating point number loops

Hey, I guess I am just to stupid and am not seeing the "wood for the trees", but I am always getting strange errors. I want to create a mesh with coordinates like: x y z 3.1 3.0 0.75 0 0 1 3.1 2.9 0.75 0 0 1 3.1 2.8 0.75 0 0 1 3.1 2.7 0.75 0 0 1 3.0 ... (10 Replies)
Discussion started by: ergy1983
10 Replies

7. Programming

Floating Point

Anyone help me i cant found the error of floating point if needed, i added the code complete #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> typedef struct { int hh; int mm; int ss; char nom; int punt; }cancion; typedef struct... (9 Replies)
Discussion started by: Slasho
9 Replies

8. Shell Programming and Scripting

[BASH] Regex for floating point number

Hey again, I have a basic regex that tests if a number is a float. Thank you. (5 Replies)
Discussion started by: whyte_rhyno
5 Replies

9. Shell Programming and Scripting

Convert floating point to a number

Hello Guys, I have a floating point number 1.14475E+15 I want to convert this number in to full number (Integer or Big integer). I tried couple of functions it did not work. When I use INT=${FLOAT/.*} I am getting value as 1. I don't want a truncated value #!/bin/bash #... (9 Replies)
Discussion started by: skatpally
9 Replies

10. Shell Programming and Scripting

Bash script to print the smallest floating point number in a row that is not 0

Hello, I have often found bash to be difficult when it comes to floating point numbers. I have data with rows of tab delimited floating point numbers. I need to find the smallest number in each row that is not 0.0. Numbers can be negative and they do not come in any particular order for a given... (9 Replies)
Discussion started by: LMHmedchem
9 Replies
mlib_SignalCepstral_F32(3MLIB)				    mediaLib Library Functions				    mlib_SignalCepstral_F32(3MLIB)

NAME
mlib_SignalCepstral_F32 - perform cepstral analysis SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_SignalCepstral_F32(mlib_f32 *cepst, const mlib_f32 *signal, void *state); DESCRIPTION
The mlib_SignalCepstral_F32() function performs cepstral analysis. The basic operations to compute the cepstrum is shown below. +-----------+ +--------+ +-----------+ | Fourier | | | | Inverse | ----->| |----->| log|*| |------>| Fourier |-----> x(n) | Transform | X(k) | | X'(k) | Transform | c(n) +-----------+ +--------+ +-----------+ where x(n) is the input signal and c(n) is its cepstrum. In mathematics, they are N-1 2*PI*k*n X(k) = SUM x(n) * exp(-j*----------) n=0 N X'(k) = log|X(k)| 1 N-1 2*PI*k*n c(n) = --- SUM X'(k) * exp(j*----------) N n=0 N Since X'(k) is real and even (symmetric), i.e. X'(k) = X'(N - k) the c(n) is real and the equation becomes Cosine transform. 1 N-1 2*PI*k*n c(n) = --- SUM X'(k) * cos(----------) N n=0 N The cepstral coefficients in LPC is a special case of the above. See Digital Signal Processing by Alan V. Oppenheim and Ronald W. Schafer, Prentice Hall, 1974. See Fundamentals of Speech Recognition by Lawrence Rabinerand Biing-Hwang Juang, Prentice Hall, 1993. PARAMETERS
The function takes the following arguments: cepst The cepstral coefficients. signal The input signal vector. state Pointer to the internal state structure. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_SignalCepstralInit_F32(3MLIB), mlib_SignalCepstralFree_F32(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_SignalCepstral_F32(3MLIB)
All times are GMT -4. The time now is 11:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy