How to deliver a sound tone to only one ear?

7 views (last 30 days)
Hi everyone;
I am trying to set an experiment on MATLAB where I am going to be producing a tone and sending it to the user via ear plugs. However, the tone coming to the right ear has to be 180degrees out of phase to the tone coming to the left ear.
So for instance, if the frequency is 1000Hz, I will send the 1000Hz signal to the right ear now then wait 0.5ms to send the same tone to the left ear. Hence the two sounds are going to be out of phase with each other.
So my question is: how to tell MatLab to send a tone to only the right ear then send another tone to the other ear. Or how to disable either the left or right earplug.
Thank you for your help. Ali

Accepted Answer

Jan
Jan on 8 Jul 2013
Edited: Jan on 8 Jul 2013
You can simply add zeros in the silent channel:
t = linspace(0, 5, 22500*5);
y = sin(t * 1000 * 2 * pi);
silence = zeros(1, floor(0.5e-3 * 22500)); % 0.5 ms
signal = [y, silence; silence, y(:)].';
wavplay(signal, 22050);
% Draw the signal to check the phase shift:
plot(signal(1:100, :))
  1 Comment
mohadeseh zamani
mohadeseh zamani on 12 Aug 2021
Hello Jan, I am trying to generate a toneburst in either left and right ear for example if f=250 Hz and duration of time that sound is produced in the ear is 1 seconds and the distance between the two sounds is 4 second ( first sound in the left ear and the right sound in the right ear) my problem is that generating sound in left and right ear if you know it please help me I really neeed this part.

Sign in to comment.

More Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!