2018-01-01 09:26 PM
Hello,
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
Regards,
Mohit Rai
2018-01-02 12:10 AM
Take an excel spreadsheet, create the table of n samples, format it so it can be easily copy paste in a C source code and see if the result is the same. It could also be a problem of formatting, if the DAC is in 8 bit, 10 bit or 12 bit mode etc... a ramp as input table should give more debugging clues. Is the output buffer enabled, and the test is done without output load?
2018-01-03 02:24 AM
hello,
Harmonics was present due to step size in sin wave sample.
When I have changed in the sin wave generation formula. harmonics are reduced.
sin wave[numberOfSample]=100*sin(2*3.14*n/numberOfSample)+2047.
Regards,
Mohit Rai