hi , i want to create a user interface in which the user will enter the sampling rate and the frequency, the interface will plot the sine wave when pressed on a button accordingly using chart series.
simply what im trying to do is this code when written on matlab,
1 fs= 96000;
2 f= 1000;
if you try to write this code on matlab a sine graph will appear,the thing i couldnt write as an equation in line 4, i want my user interface to give me the same sine graph after the user enters the sampling rate and frequency values.
double phasecent = 0;
double samplerate = 96000;
double freq = 1000;
for (int i = 0; i < samplerate; i++)
double t = Math.Sin(freq * (2 * Math.PI) * (phasecent) / samplerate);
double x = Math.Sin(2 *Math.PI*freq*t);
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)