0
votes

I am using Teensy3.1 to record audio with 50KHz sample rate. I use the function AnalogRead to sample the analog pin. The reading value should fall into the range between 0 to 1024.

However, after recording the data, I found there is a small reading(E.g. 0.019) every 100 samples . What might be the possible reason for that? Am I sampling it too fast?

Any feedback is very much appreciated.

1
Does it actually sound distorted when you play it back?Ignacio Vazquez-Abrams
@IgnacioVazquez-Abrams Thanks for your reply. It was distorted. But if without the weird ZERO readings, I can tell the shape of the data at other parts look right. Do not understand why the data series were constantly inserted with the same super small values(e.g. 0.019).Foreverniu

1 Answers

0
votes

I figured out that problem, which rasing another problem to be solved.

Earlier problem was caused by usage of Buffer while reading serial port in Java via RXTX. I set the buffer size to be 1024. Therefore, each time the data stream was broken at the end of each buffer and the start of the next buffer. E.g. 449.00 was broken into three lines with 4 ,49 , .00 .

One easy solution is to increase the buffer size and throw the data at the end and start of each buffer. Is there any better way to solve that?

Thanks.