I made whole of the program but the first value Im getting, i.e. a * Sin(0), is always displayed as 10 rather than 0.
This is the loop code I tried :
Expand|Select|Wrap|Line Numbers
- //All the values a,f,fs.... are of float type.
- for(n = 0;n <= N-1; n++)
- {
- double *s = malloc(sizeof(double));
- double *x = malloc(sizeof(double));
- *x = (2 * PI * (f / fs)* n);
- *s = a * sin(*x);
- printf("%f\n",*s);
- }
Thanks :):):)