How to program a click stimulus?

조회 수: 8 (최근 30일)
Paul Hinze
Paul Hinze 2021년 12월 16일
댓글: Star Strider 2021년 12월 17일
Hello,
I am ok with matlab but I am not an expert into signal processing:
I would like to know, if someone could give me an example for an acoustic click stimulus?
Since a click contain every Frequency, I dont know how to program such a stimulus.
Thank you in Advance,
Paul

채택된 답변

Star Strider
Star Strider 2021년 12월 16일
The Fourier transform of a square wave pulse is , so use that to synthesise the click —
Fs = 44100; % Sampling Frequency (Hz)
t = linspace(0, 10*Fs, 10*Fs)/Fs; % Time Vector (s)
s = sin(2*pi*(t-5)*5000)./(2*pi*(t-5)*5000); % Click
% sound(10*s(:)*[1 1], Fs) % Listen!
figure
plot(t, s)
grid
xlim([4.995 5.005])
Since x is unbounded (the supoprt is ) it contains essentially all the frequencies (at least up to the Nyquist frequency of the sound card, generally 22050 Hz).
Experiment with the code to get different desired results.
.
  댓글 수: 2
Paul Hinze
Paul Hinze 2021년 12월 17일
Wow! I am very happy with your answer!
Thank you :)
Star Strider
Star Strider 2021년 12월 17일
Thank you!
As always, my pleasure!
.

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

추가 답변 (0개)

카테고리

Help CenterFile 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