Playing sine wave via MQS on RT1050

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Playing sine wave via MQS on RT1050

2,587 Views
alfredatai
Contributor II

Hello,

Is there an official example project for playing arbitrary sine wave via MQS?

My configuration:

  • IMXRT1050-EVKB
  • MQS left connected to an analog amplifier (customize-made breadboard similar to PAM8302A on SLN-LOCAL2-IOT), with a low-pass filter as on that demo board.

I found it surprising to see so little MQS code example even in the forum.

Thanks!

 

Labels (1)
Tags (3)
7 Replies

2,555 Views
alfredatai
Contributor II

Thanks Jeremy.

Google translate says that the code attached in that post plays some "music". Is there an example for playing sin wave?

Also is there a way to host the two zip files in this official forum? I think there is no easy way to register a "nxpic" account for non-China residents.

0 Kudos
Reply

2,547 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @alfredatai ,
Thanks for your reply.
Please check the attachment, further, it needs to convert the sine wave audio signal into the C array, then the MQS can 'play' it.
BR,

Jeremy
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

2,526 Views
alfredatai
Contributor II

@jeremyzhouthanks for uploading the zip files. I wished they were for RT1050 and with GCC toolchain though.

> it needs to convert the sine wave audio signal into the C array

I tried to make use of the sine wave function as-is in the 1050 demo app (`PlaybackSine()`) but I found the sine wave "shifted" up/down. This is measure on MQS-right after the low-pass filter:

204388746-ac4822c6-0f04-49ee-b4e5-0fc8a6cf41c8.jpg

Can you think of what could I misconfigured (there are just very little registers for MQS)? Is there an example for playing a sine wave via MQS?

0 Kudos
Reply

2,521 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @alfredatai 
Please follow the post to convert the WAV file to a C array via the WAVToCode.
Jeremy
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

2,515 Views
alfredatai
Contributor II

First time hearing about the WAVToCode conversion. I will give that Windows program a try, thanks!

I still have a few questions regarding MQS:

  1. About that PlaybackSine() function: Isn't MQS a simple HW module to convert SAI output to the MQS's PWM pin(s)? If so, why would we need additional audio format conversion when RT1050's SAI+codec demo doesn't need that conversion?
  2. Is WAVToCode pre-processing a must-have? The situation is we need real-time tone generation with arbitrary frequency. It's just impractical to pre-record all possible frequencies of sine wave and find storage for the converted C arrays.
  3. Are there known limitations of what MQS can or cannot do v.s. SAI+codec?

Thanks again.

0 Kudos
Reply

2,491 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @alfredatai 
Thanks for your reply.
Regarding to your purpose, I'd like to suggest you ask for some advice via the below email address, as I'm not very clear about the limitations of MQS.

Voice@nxp.com
Jeremy
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos
Reply

2,561 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @alfredatai ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
To provide the fastest possible support, I'd highly recommend you refer to the post.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply