Total noob here. Can someone give me an example on how i can generate a 2kHz sine wave array with white noise of variance 0.01 in C? This is what I have so far:
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define PI 3.141592653589793
int main() {
int i;
double buffer[10000];
for(i = 0; i < 10000; i++)
{
buffer[i] = sin(2000 * (2 * PI) * i / 6000) + sqrt(0.01)rand;
}
return 0;
}