Sending two tones (Right and Left)

1 vue (au cours des 30 derniers jours)
Mustafa Jameel
Mustafa Jameel le 30 Jan 2019
Commenté : Rena Berman le 5 Mar 2019
How can create a tone that works on the left or right only?. As you can see below, I have already created two sine waves with different frequences, so I'm trying to send one to the right and the other one to the left. Thanks in advance
fs= 8000; %frequency sample rate
i=1/fs;
t=0:i:10; %time axis
a=10; % amplitude
%Left Signal with F=440hz
f1 = 440;
x = a*sin(2*pi*f1*t);
%Right signal with F=660hz
f2 = 660;
y = a*sin(2*pi*f2*t);
plot(t,x,t,y);
  3 commentaires
madhan ravi
madhan ravi le 31 Jan 2019
Modifié(e) : madhan ravi le 31 Jan 2019
This behaviour is not tolerated in this forum!
Rena Berman
Rena Berman le 5 Mar 2019
(Answers Dev) Restored edit

Connectez-vous pour commenter.

Réponses (1)

Rik
Rik le 30 Jan 2019
fs= 8000; %frequency sample rate
i=1/fs;
t=0:i:10; %time axis
a=10; % amplitude
%Left Signal with F=440hz
f1 = 440;
x = a*sin(2*pi*f1*t);
%Right signal with F=660hz
f2 = 660;
y = a*sin(2*pi*f2*t);
%merge into left and right
sound([x' y'],fs)
  1 commentaire
Rik
Rik le 30 Jan 2019
You can just add a 0 sound to the side you want to be silent:
fs= 8000; %frequency sample rate
i=1/fs;
t=0:i:10; %time axis
a=10; % amplitude
%Left Signal with F=440hz
f1 = 440;
x = a*sin(2*pi*f1*t);
%Right signal with F=660hz
f2 = 660;
y = a*sin(2*pi*f2*t);
% %merge into left and right
% sound([x' y'],fs)
sumsound=[x' zeros(size(x'));zeros(size(y')) y'];
sound(sumsound,fs)

Connectez-vous pour commenter.

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by