Forums

dspGuru Multirate Code Question

Started by JeffS87 May 30, 2004
Hi,

In interp.c - interp(), the while loop decrements the input sample counter
first.

while (--num_inp > 0) {

So won't it miss the last input sample?  Not that you would ever call interp()
one sample at a time, but if you did, it would do nothing.  --num_inp would
make the 1 a 0  and the while test would be

while (0 > 0) {

which would do nothing.  So shouldn't be a post decrement?

while (num_inp-- > 0) {

Jeff
Yeah it's wrong.  The output file "interp_filter_sine.txt" from mr_test.c is
1023 samples, its supposed to be 1024 samples.  When you change it to a post
decrement its 1024 samples.

Jeff