I am trying to test some signal processing functions that I have written and I want to simulate real time streaming data of signed 16-bit values representing a Sine wave sampled at 960 Hz. So I imagine somewhere along the way there will be something along the lines of
short output = (short)32000*Math.Sin(2 * Math.PI * time);
where time
would be some single or double precision floating point number in seconds.
Is there someway to do this with C#, a Windows PowerShell script or otherwise? And how would I capture that data? I've seen this but I don't know Perl and I'm not sure I understand.
Or am I understanding how real time data streams work wrong?