feat: pd_signal: resample, linspace

This commit is contained in:
2026-03-04 16:27:00 +01:00
parent 0fb4c4d6c1
commit fe300dabd3
3 changed files with 51 additions and 3 deletions

View File

@@ -8,11 +8,20 @@
#include <vector>
namespace pd_signal {
/** `num` evenly spaced numbers over interval [start,stop] */
void linspace(std::vector<double>& data, double start, double stop, int num);
/** `num` evenly spaced numbers over interval [start,stop] with endpoint=true or [start,stop) with endpoint=false */
void linspace(std::vector<double>& data, double start, double stop, int num, bool endpoint);
/**
* Evaluate at points x the function given by the samples fp[xp[n]].
* Returned in y.
*/
void interp(std::vector<double>& x, std::vector<double>& xp, std::vector<double>& fp, std::vector<double>& y);
void interp(std::vector<double>& y, std::vector<double>& x, std::vector<double>& xp, std::vector<double>& fp);
/** resample to BEAT_LEN */
void resample(std::vector<double> &out, std::vector<double> x, int beat_len);
}
#endif //PASADASUPERPROJECT_SIGNAL_H