How to increment a for loop with a decimal value in C
I have this code
for (k=0; k<BUFFER_LEN; k++){
buffer[k] = sin(2*pi*f/fs*k); //sine generation
my loop increments by 1 each time - so k will be 1, 2, 3, 4, 5.... etc for
each calculation
I would like the loop to increment by 0.1 each time for example, so my
sine calculation is more accurate? What would be the simplest way to
achieve this? I tried incrementing by 0.1 in that for loop but dont think
this is allowed as the program times out
No comments:
Post a Comment