~ubuntu-branches/ubuntu/jaunty/speech-tools/jaunty

« back to all changes in this revision

Viewing changes to speech_class/EST_wave_temp.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2004-07-16 09:25:39 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040716092539-5p1tzif55b8j924e
Tags: 1:1.2.3-8
Added alaw processing code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
    mean /= n;
84
84
    
85
85
    for (i = 0, mean = 0.0; i < tr.num_samples(); ++i)
86
 
        var += pow(tr.a(i, channel) - mean, 2.0);
 
86
        var += pow(tr.a(i, channel) - mean, (float)2.0);
87
87
    
88
88
    var /= n;
89
89
    sd = sqrt(var);
96
96
    float sum = 0;
97
97
    
98
98
    for (i = 0; i < size; ++i)
99
 
      sum += pow((a.a(i, channel) - b.a(i, channel)), 2.0);
 
99
      sum += pow((a.a(i, channel) - b.a(i, channel)), (float)2.0);
100
100
    
101
101
    sum = sqrt(sum / size);
102
102
    return sum;
110
110
    for (i = 0; i < size; ++i)
111
111
    {
112
112
      // cout << i << " " << a.a(i, channel) << " " << b.a(i, channel) << endl;
113
 
        sum += fabs(a.a(i, channel) - b.a(i, channel));
 
113
        sum += abs(a.a(i, channel) - b.a(i, channel));
114
114
    }
115
115
    return sum / size;
116
116
}