Can i use matlab to generate audio signals.

 Réponse acceptée

Star Strider
Star Strider le 25 Nov 2015
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 commentaires

BIRKAN OZSEVEN
BIRKAN OZSEVEN le 3 Mai 2020
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 le 12 Nov 2020
Modifié(e) : Prajwal Khairnar le 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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Audio Processing Algorithm Design dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by