Make audio recording simulation run in real time?

2 views (last 30 days)
Hello,
As part of some university work, I am trying to modulate audio to be recorded from my mic using the Audio Device Reader block with an Audio Oscillator block acting as the carrier signal. However, whenever I try to run the simulation, in which i want it to be ten seconds long so I have time to speak what i need to get modulated, the simulation runs instantly instead of in real time. Is there any way to get the simulation to run in real time so when looking at the time scope I can watch the amplitude change with my speaking?

Accepted Answer

Zinea
Zinea on 31 Mar 2025
In order to be able to watch the amplitude change while speaking in real time, the following need to be ensured:
1) The sample time for the "Audio Device Reader" and "Audio Device Writer" blocks is set correctly. It should be small enough to capture and play audio in real time, typically around 1/44100 for a 44.1 kHz sample rate.
2) The "Simulation Pacing" option can be used to slow down the simulation to real time. It can be set to 1x for real time pacing.
You can refer to the model attached where the amplitude change is reflected in the time scope in real time while speaking.
Hope this helps, best!
  1 Comment
Oliver
Oliver on 31 Mar 2025
Thank you, that example seems to be one way of having a system that is working in real-time on my laptop rn!

Sign in to comment.

More Answers (0)

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!