1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-07-24 22:24:23 +00:00

I'm not yet completely convinced by my approach to time basing, but it'll probably do? If so then this more or less gets me ready for a point-sampled filtering.

This commit is contained in:
Thomas Harte
2016-01-13 22:02:39 -05:00
parent d9a7ef9e46
commit 49e89a4bcb
4 changed files with 34 additions and 9 deletions

View File

@@ -16,11 +16,11 @@ namespace SignalProcessing {
class Stepper
{
public:
Stepper(uint64_t input_rate, uint64_t output_rate)
Stepper(uint64_t output_rate, uint64_t update_rate)
{
whole_step_ = output_rate / input_rate;
adjustment_up_ = (int64_t)(output_rate % input_rate) << 1;
adjustment_down_ = (int64_t)input_rate << 1;
whole_step_ = output_rate / update_rate;
adjustment_up_ = (int64_t)(output_rate % update_rate) << 1;
adjustment_down_ = (int64_t)update_rate << 1;
}
inline uint64_t update()