AnsweredAssumed Answered

Sinwave harmonics on STM32F4 discovery board

Question asked by mohit rai on Jan 2, 2018
Latest reply on Jan 3, 2018 by mohit rai


I am generating digital sin wave sample using the below formula.

sin wave[numberOfSample]=2047*(sin(2*3.14*n/numberOfSample)+1)


I am generating sample for 200 hertz wave.

numberOfSample=40 when sampling frequency=8000 hertz.

In my case,numberOfSample is 40 for 200 hertz sin wave generation.


Problem is that, when I am playing sin wave using DAC, harmonics are also present in my output. 

How can I resolve this problem?


harmonics are present due to above formula that I am using for generating sin wave sample.

I need digital sin wave in  my application. This harmonics creating lot of noise. I have tried low pass  filter (1000 hertz both software and hardware)  but it is not working effectively.


Thanks in advance


Mohit Rai