I am trying to use Octave to generate a pure sine wave. The code for the same is as follows:
x = 10.*sin(2*pi*(300/16000)*(0:1:400));
The sampling rate is 16000Hz, the sine wave is at 300 Hz. I write the above wave to a file using
wavwrite like so:
wavwrite(x, 16000, 16, "temp.wav")
When I try to read it back into a variable, like so:
y = wavread('temp.wav');, I get square waves upon plotting
I have checked the sine wave and the period indicates a frequency of 300Hz.
How can a pure sine wave become a square wave on simply writing and reading? Or am I going wrong somewhere?