Play audio --> wait a while --> record audio

I'm trying to use a soundcard to oscillate a cantilever at different frequencies, and then record the signal. Since the cantilever needs some time (100 ms) to stabilize its oscillation, I won't sweep the frequency but use distinct sine waves.
How can I make matlab wait a short time after I start playing the signal using the play function? I don't want to use playblocking, since I want to start the recorder after 100 ms, I can't use pause since that will pause the player... I'm really at loss here, there's probably a really easy answer...

 채택된 답변

Walter Roberson
Walter Roberson 2011년 6월 9일

0 개 추천

pause(0.1)
should not pause the player

댓글 수: 1

Jan
Jan 2011년 6월 9일
I don't know why my previous attempts at this failed. I was certain that pause(0.1) would pause the player, but it does not. Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Daniel Shub
Daniel Shub 2011년 6월 9일

0 개 추천

You could also start the recording at about the same time as the playback and then disregard the first 100 ms of the recording.

댓글 수: 1

Jan
Jan 2011년 6월 9일
Thank you, this would also have been a good workaround!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by