2018-01-19 05:48 AM
Dear All,
I would like to generate a 2 kHz �10 V Sine-wave with Hann window, as shown in the figure below. Do you have any ideal how to implement this function in STM32F4, and are there any additional circuits required for this? I am new to this field. Please let me know if you have any idea.
Best regards,
Hai
#sine-waveform #stm32 #hanning-window2018-01-19 06:35 AM
I am new to this (sic) field
Which field, exactly:
Here's a free online DSP textbook:
(also available in dead-tree form - for money).Here's some learning & reference materials for 'C' programming:
http://blog.antronics.co.uk/2011/08/08/so-youre-thinking-of-starting-with-c/
2018-01-19 09:11 AM
Do any of the parameters change?
Pattern buffer to DAC (DMA+TIM) to OPAMP?
2018-01-19 10:17 AM
I really wish people would fill out their profiles. If people have degrees in Art History, or 18th Century English Poetry it would be helpful to know
2018-01-19 10:20 AM
Thanks Clive. The frequency can be different in the application. It will be ideal if the frequency can be adjusted, e.g. from 50 kHz to 500 kHz. This generated signal will be used for actuation purposes. The amplitude is fixed.
2018-01-19 10:32 AM
Ok, so perhaps a pattern buffer of 50000-60000 samples you can push at up to 1msps. The math to generate the pattern buffer not that complicated.
500 KHz might be a challenge. Could you build a simple modulation circuit? Looks like AM
2018-01-19 12:57 PM
Thanks, Clive. I found AN3216 and AN4566 for generating particular DAC outputs, but haven't got a chance to read them in detail. Are those parameters (sample number and DAC clock frequency) calculated using theories introduced in these notes?
Is the modulation circuit used for amplifying the DAC output amplitude from 3.3 V to 10 V? I do not have such experience, but if you can give me some references, I am pretty sure I can implement the circuit. Thanks.
2018-01-19 01:06 PM
you would generate a series of normalised floats in a table, from the function W(n), and 'play' the Audio with a DMA
mechanically we process along Pi and along n
W(n) is an artist impression of what we want.
You need to see detail along Pi within each (n)
We like binary numbers, so lets pick a clean number like 1024. // thats 2MHz output for 2KHz sinewave.
do you want a super clean output with low distortion ?
double step = Pi/1024; // 2MHz output maybe too high.
double W[1024 * n ];
int k=0;
for (j = 0; j < n; j++)
for (i = 0; i< 1024; i++)
W(k++) =YourSuperFunction( i,n);
YourSuperFunction(i,n){
double thisStep = Pi /1024*i;
// calculate W with current step position and n
}
Once the table is filled,
you would setup a DMA to 'play' the Audio through the DAC to get to 3Vpp // 2MHz should be achievable.
to get to 10V you would normally capacitively couple an audio amplifier, where the output can easily be 80Vpp
2018-01-23 07:10 AM
Thanks T J for the detialed instruction. I will work on this, and let you know the result.
Best,
Hai