mirror of
https://github.com/aicodix/dsp.git
synced 2026-04-27 22:35:45 +00:00
need coeffs computed for the input, not output array ..
This commit is contained in:
parent
c77a4a2c54
commit
e2eefcb98b
1 changed files with 3 additions and 3 deletions
|
|
@ -35,13 +35,13 @@ public:
|
|||
void operator ()(IO *output, const IO *input, TYPE diff, int samples, int stride = 1)
|
||||
{
|
||||
TYPE ratio = rate / (rate + diff);
|
||||
TYPE recip = TYPE(1) / ratio;
|
||||
for (int i = 0; i < samples - TAPS; ++i) {
|
||||
IO sum = 0;
|
||||
int s0 = nearbyint(i * ratio);
|
||||
TYPE x = i * ratio;
|
||||
int s0 = nearbyint(x);
|
||||
int s1 = s0 + TAPS;
|
||||
for (int s = s0; s < s1; ++s) {
|
||||
TYPE k = s * recip - i;
|
||||
TYPE k = s - x;
|
||||
sum += lpf(k) * input[s * stride];
|
||||
}
|
||||
output[(i + (TAPS - 1) / 2) * stride] = sum;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue