필터 지우기
필터 지우기

How can I generate audio chirp signal ?

조회 수: 34 (최근 30일)
Alex Dashevsky
Alex Dashevsky 2018년 3월 25일
답변: Sulaymon Eshkabilov 2021년 7월 10일
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 ?

답변 (2개)

Star Strider
Star Strider 2018년 3월 25일
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
Star Strider
Star Strider 2019년 3월 29일
The last element in the ‘t’ vector.
Javier
Javier 2020년 11월 17일
How would you export it to be a .wav file?

댓글을 달려면 로그인하십시오.


Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 7월 10일
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)

카테고리

Help CenterFile Exchange에서 Code Generation and Deployment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by