Borrar filtros
Borrar filtros

How can I generate audio chirp signal ?

29 visualizaciones (últimos 30 días)
Alex Dashevsky
Alex Dashevsky el 25 de Mzo. de 2018
Respondida: Sulaymon Eshkabilov el 10 de Jul. de 2021
Hi, I need to find a frequency response of the system. I want to generate chirp audio sound from 200Hz to 10Khz. I can't understand how do it. Could you help ?

Respuestas (2)

Star Strider
Star Strider el 25 de Mzo. de 2018
Try this:
t = linspace(0, 4.8, 4.8E+4);
f0 = 200;
f1 = 10000;
Fs = 1/mean(diff(t));
x = chirp(t,f0,t(end),f1);
sound(x, Fs)
figure(1)
plot(t, x)
  9 comentarios
Star Strider
Star Strider el 29 de Mzo. de 2019
The last element in the ‘t’ vector.
Javier
Javier el 17 de Nov. de 2020
How would you export it to be a .wav file?

Iniciar sesión para comentar.


Sulaymon Eshkabilov
Sulaymon Eshkabilov el 10 de Jul. de 2021
Just using audiowrite(), e.g.:
t = linspace(0, 4.8, 4.8E+4);
f0 = 200;
f1 = 10000;
Fs = round(1/mean(diff(t))); % Has to be integer and thus, it has to be rounded up!
y = chirp(t,f0,t(end),f1);
sound(y, Fs)
filename = 'Chirp_Sound.wav';
audiowrite(filename,y,Fs); % Chirp_Sound.wav file is created
clear y Fs
%% Test the recoded *.wav file
[y,Fs] = audioread(filename);
sound(y, Fs)

Categorías

Más información sobre Code Generation and Deployment en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by