Skip to content

Commit 9cdd99e

Browse files
committed
Rename interpolators
1 parent 8cb7d74 commit 9cdd99e

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/AudioTools/CoreAudio/ResamplerStreamT.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace audio_tools {
2121
* The buffer is initilaized with 0 values and it is re-initialized when
2222
* setStepSize() is called with a different size.
2323
*/
24-
struct ResampleBase {
24+
struct BaseInterpolator {
2525
/**
2626
* @brief Constructor. Initializes the buffer with four zeros.
2727
*/
@@ -111,7 +111,7 @@ struct ResampleBase {
111111
*
112112
* Valid for xf in [0,1].
113113
*/
114-
struct ResampleLinearInterpolation : public ResampleBase {
114+
struct LinearInterpolator : public BaseInterpolator {
115115
int vectorSize() {
116116
return 2;
117117
} ///< Minimum number of values required for interpolation
@@ -136,7 +136,7 @@ struct ResampleLinearInterpolation : public ResampleBase {
136136
*
137137
* Valid for xf in [0,3].
138138
*/
139-
struct ResampleBSpline : public ResampleBase {
139+
struct BSplineInterpolator : public BaseInterpolator {
140140
int vectorSize() {
141141
return 4;
142142
} ///< Minimum number of values required for interpolation
@@ -165,7 +165,7 @@ struct ResampleBSpline : public ResampleBase {
165165
*
166166
* Valid for xf in [0,3].
167167
*/
168-
struct ResampleLagrange : public ResampleBase {
168+
struct LagrangeInterpolator : public BaseInterpolator {
169169
int vectorSize() {
170170
return 4;
171171
} ///< Minimum number of values required for interpolation
@@ -194,7 +194,7 @@ struct ResampleLagrange : public ResampleBase {
194194
*
195195
* Valid for xf in [0,3].
196196
*/
197-
struct ResmpleHermite : public ResampleBase {
197+
struct HermiteInterpolator : public BaseInterpolator {
198198
int vectorSize() {
199199
return 4;
200200
} ///< Minimum number of values required for interpolation
@@ -223,7 +223,7 @@ struct ResmpleHermite : public ResampleBase {
223223
*
224224
* Valid for xf in [0,3].
225225
*/
226-
struct ResampleParabolic : public ResampleBase {
226+
struct ParabolicInterpolator : public BaseInterpolator {
227227
int vectorSize() {
228228
return 4;
229229
} ///< Minimum number of values required for interpolation
@@ -246,10 +246,10 @@ struct ResampleParabolic : public ResampleBase {
246246
};
247247

248248
/**
249-
* @brief Multi-channel resampler that applies a ResampleBase-derived algorithm
249+
* @brief Multi-channel resampler that applies a BaseInterpolator-derived algorithm
250250
* to each channel.
251251
*
252-
* @tparam TResampler The resampler type (must derive from ResampleBase).
252+
* @tparam TResampler The resampler type (must derive from BaseInterpolator).
253253
*/
254254
template <class TResampler>
255255
class MultiChannelResampler {
@@ -324,7 +324,7 @@ class MultiChannelResampler {
324324
/**
325325
* @brief A Stream implementation for resamping using a specified interpolation
326326
* algorithm.
327-
* @tparam TResampler The resampler type (must derive from ResampleBase).
327+
* @tparam TResampler The resampler type (must derive from BaseInterpolator).
328328
*/
329329
template <class TResampler>
330330
class ResamplerStreamT : public ReformatBaseStream {

tests-cmake/resample_ext/resample_ext.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#include "AudioTools.h"
2-
#include "AudioTools/Sandbox/ResamplerStreamT.h"
32

43
AudioInfo info(44100, 1, 16);
54
// subclass of SoundGenerator with max amplitude of 32000
65
SineWaveGenerator<int16_t> sineWave(32000);
76
// Stream generated from sine wave
87
GeneratedSoundStream<int16_t> sound(sineWave);
98
CsvOutput<int16_t> out(Serial);
10-
//ResamplerStreamT<ResampleLinearInterpolation> resample(out);
11-
ResamplerStreamT<ResampleBSpline> resample(sound);
9+
//ResamplerStreamT<LinearInterpolaror> resample(out);
10+
ResamplerStreamT<BSplineInterpolator> resample(sound);
1211
StreamCopy copier(out, resample); // copies sound to out
1312

1413
// Arduino Setup

0 commit comments

Comments
 (0)