Keil Logo

Output from STM32F4 board to speaker

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Author
ramakrishna rachumallu
Posted
11-Feb-2019 08:59 GMT
Toolset
None
New! Output from STM32F4 board to speaker

Hi, I am new to an embedded platform. I am using STM32F407 board with cortex-m4 and Wolfson pi audio extension card. I am using Keil micro vision 5. I Want to generate white Gaussian noise signal using the code(which I have to write) and I want to pass that output to the speaker. I went through some examples like audio passthrough and some others which were given in DSP Lab modules. I observed that we can give DMIC IN and LINE IN as inputs to the system so that we can hear out using headphones. But in my case, I want to generate that input signal within the code. Is this possible? I tried passing rand function as input which generates random numbers within the range 0 to 32767 in the stm32_loop_intr function, but I couldn't hear anything on headphones. So, is there a way to generate a white Gaussian noise signal? If this is possible, can I hear that sound through headphones?

Author
Andrew Neil
Posted
11-Feb-2019 11:54 GMT
Toolset
None
New! RE: I am new to an embedded platform

Do you have any other programming experience? Or (basic) electronics?

This might be rather ambitious for a first project?

Maybe start here: http://www2.keil.com/mdk5/learn

Author
ramakrishna rachumallu
Posted
11-Feb-2019 14:34 GMT
Toolset
None
New! RE: I am new to an embedded platform

Yes. I do have a bit of programming experience and have knowledge about basic electronics. Can you help me out on how to solve the above stated problem?

Author
Andrew Neil
Posted
11-Feb-2019 16:07 GMT
Toolset
None
New! RE: Can you help me out on how to solve the above stated problem?

It's not clear which part you're actually stuck on.

It sounds like a school assignment - so you should really be going to your teacher for assistance.

Author
Westonsupermare Pier
Posted
11-Feb-2019 19:40 GMT
Toolset
None
New! RE: I am new to an embedded platform

Generate a pattern buffer containing a sine wave of know frequency, and feed that in a loop through you device. Scope the signal to confirm you can see the frequency/amplitude expected, and then listen to the sound via your head phones. Change the frequency and amplitude of the signal until you are sure the hardware and output paths work as expected.

Generate other wave forms and patterns, repeat.

Author
Andrew Neil
Posted
12-Feb-2019 10:17 GMT
Toolset
None
New! RE: Generate a pattern buffer containing a sine wave of know frequency

You can export and import raw audio sample data from/to Audacity:

http://manual.audacityteam.org/man/sample_data_export.html

It can also generate audio for you:

http://manual.audacityteam.org/man/generate_menu.html


(other audio editing/processing tools are available)

Author
ramakrishna rachumallu
Posted
13-Feb-2019 08:29 GMT
Toolset
None
New! RE: Generate a pattern buffer containing a sine wave of know frequency

Thank you. I will try to use this option.

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.