1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
5 An audio time-stretching and pitch-shifting library.
6 Copyright 2007-2008 Chris Cannam.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version. See the file
12 COPYING included with this distribution for more information.
15 #include "HighFrequencyAudioCurve.h"
20 HighFrequencyAudioCurve::HighFrequencyAudioCurve(size_t sampleRate, size_t windowSize) :
21 AudioCurve(sampleRate, windowSize)
25 HighFrequencyAudioCurve::~HighFrequencyAudioCurve()
30 HighFrequencyAudioCurve::reset()
35 HighFrequencyAudioCurve::setWindowSize(size_t newSize)
37 m_windowSize = newSize;
41 HighFrequencyAudioCurve::process(const float *R__ mag, size_t increment)
45 const int sz = m_windowSize / 2;
47 for (int n = 0; n <= sz; ++n) {
48 result = result + mag[n] * n;
55 HighFrequencyAudioCurve::processDouble(const double *R__ mag, size_t increment)
59 const int sz = m_windowSize / 2;
61 for (int n = 0; n <= sz; ++n) {
62 result = result + (float)mag[n] * n;