Sending two tones (Right and Left)
1 view (last 30 days)
Show older comments
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 Comments
madhan ravi
on 31 Jan 2019
Edited: madhan ravi
on 31 Jan 2019
This behaviour is not tolerated in this forum!
Answers (1)
Rik
on 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 Comment
Rik
on 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)
See Also
Categories
Find more on Spectral Measurements 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!