Skip to main content
Alexis Gloux
Associate
May 17, 2018
Question

How to generate sound thanks to a sampled curve?

  • May 17, 2018
  • 1 reply
  • 1512 views
Posted on May 18, 2018 at 00:14

Hello, I am currently studying computer science, I must perform a project during my year.

I work on a STM32F7G46.

I have sampled a given curve and thanks to it generate sound. I am at the point where I have tables of coordinates of a sampled curve but I am blocked, or do I have to send these tables? in 0xC0000000?

Any help is welcome, thank you.
    This topic has been closed for replies.

    1 reply

    AvaTar
    Senior III
    May 18, 2018
    Posted on May 18, 2018 at 07:53

    I work on a STM32F7G46.

    I guess you mean the F746G.

    Hello, I am currently studying computer science,...

    So you can expected to read and understand the datasheet + reference manual of said controller.

    I have sampled a given curve and thanks to it generate sound.

    What external device ?

    For plain analogue output, you could use the DAC.

    Keep in mind that the output sample rate is supposed to match the input rate.

    I would use a timer to trigger the output.

    Any help is welcome, thank you.

    You should get at least some idea how to do it (and tackle similar problems), else it would be futile ...

    How about your experience with microcontrollers at all ?

    T J
    Senior III
    May 18, 2018
    Posted on May 18, 2018 at 09:59

    Yes ,

    meyer.frank

    ‌ is right ,

    Timer ouput-compare with interrupt enabled, that will give you a serving time-base for your data stream.

    on each interrupt, you place the pointed data into the DAC, then increment the pointer to the next data point.

    at what rate ( Hz) was the data recorded ?

    Alexis Gloux
    Associate
    May 18, 2018
    Posted on May 18, 2018 at 10:25

    Thanks for your answers,

    To be honest i have no experience with

     microcontrollers, that's why it's so hard for me.

    I will explain more precisely what i would like to do :

    I'm sampling a curve at 48Khz.

    So I got two arrays of coordinates (x,y) of a curve.

    Thanks to these arrays i would like to 

    generate sound on the STM32F7.

    what informations are needed to generate sound ?

    Where i am supposed to write these informations and how ?