Akzeptierte Antwort

Star Strider
Star Strider am 25 Nov. 2015

1 Stimme

This is the easiest way:
Fs = 14400; % Sampling Frequency
t = linspace(0, 1, Fs); % One Second Time Vector
w = 2*pi*1000; % Radian Value To Create 1kHz Tone
s = sin(w*t); % Create Tone
sound(s, Fs) % Produce Tone As Sound
For a detailed description of the functions in the most recent MATLAB releases, see the documentation for Audio Recording and Playback.

4 Kommentare

Sir , in order to hear it longer I am trying to increase 1 sec to 10 sec or more but it does not affect. What should I do for that?
Fs = 14400; % Sampling Frequency
secs = 10;
t = linspace(0, secs, Fs*secs+1); % Time Vector + 1 sample
t(end) = []; % remove extra sample
w = 2*pi*1000; % Radian Value To Create 1kHz Tone
s = sin(w*t); % Create Tone
sound(s, Fs) % Produce Tone As Sound
Prajwal Khairnar
Prajwal Khairnar am 12 Nov. 2020
Bearbeitet: Prajwal Khairnar am 12 Nov. 2020
how to listen to 2 synthetic signals one after one
Fs = 14400; % Sampling Frequency
secs = 10;
t = linspace(0, secs, Fs*secs+1); % Time Vector + 1 sample
t(end) = []; % remove extra sample
w = 2*pi*1000; % Radian Value To Create 1kHz Tone
w2 = 2*pi*1440; % Radian Value To Create 1440 Hz Tone
s = sin(w*t); % Create Tone
s2 = sin(w2*t); % Create second Tone
sound([s, s2], Fs) % Produce Tone then second Tone As Sound

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Audio I/O and Waveform Generation finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by