Sending two tones (Right and Left)

1 回表示 (過去 30 日間)
Mustafa Jameel
Mustafa Jameel 2019 年 1 月 30 日
コメント済み: Rena Berman 2019 年 3 月 5 日
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 件のコメント
madhan ravi
madhan ravi 2019 年 1 月 31 日
編集済み: madhan ravi 2019 年 1 月 31 日
This behaviour is not tolerated in this forum!
Rena Berman
Rena Berman 2019 年 3 月 5 日
(Answers Dev) Restored edit

サインインしてコメントする。

回答 (1 件)

Rik
Rik 2019 年 1 月 30 日
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 件のコメント
Rik
Rik 2019 年 1 月 30 日
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)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by