Sending two tones (Right and Left)
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
le 31 Jan 2019
Modifié(e) : madhan ravi
le 31 Jan 2019
This behaviour is not tolerated in this forum!
Réponses (1)
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
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)
Voir également
Catégories
En savoir plus sur Spectral Measurements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!