chipaudette
Well-known member
I love how the Audio library lets you see what fraction of the processor is being consumed by different blocks in your audio processing chain. But, in looking at the formula, I don't understand how the calculation is done...
From AudioStream.h, I see this formula:
#define CYCLE_COUNTER_APPROX_PERCENT (( + (F_CPU / 32 / AUDIO_SAMPLE_RATE * AUDIO_BLOCK_SAMPLES / 100)) / (F_CPU / 16 / AUDIO_SAMPLE_RATE * AUDIO_BLOCK_SAMPLES / 100))
I understand the scaling by the sample rate and block size. The part that I don't understand is the bit in red. Why is there this additive term?
Chip
From AudioStream.h, I see this formula:
#define CYCLE_COUNTER_APPROX_PERCENT (( + (F_CPU / 32 / AUDIO_SAMPLE_RATE * AUDIO_BLOCK_SAMPLES / 100)) / (F_CPU / 16 / AUDIO_SAMPLE_RATE * AUDIO_BLOCK_SAMPLES / 100))
I understand the scaling by the sample rate and block size. The part that I don't understand is the bit in red. Why is there this additive term?
Chip