필터 지우기
필터 지우기

How can I use the chirp function to create a linear sine sweep from a given starting and ending frequency within a given time frame?

조회 수: 31 (최근 30일)
How could I, for example, make a 3 second sine sweep starting at 40 Hz and ending at 10 kHz?
The examples given in the help section for chirp have not been useful.

답변 (1개)

David Barry
David Barry 2016년 12월 13일
% create time signal
freqSamp = 1e6;
tStart = 0;
tEnd = 3;
t = tStart:1/freqSamp:tEnd;
% create swept sine
freqStart = 40;
freqEnd = 1e4;
phaseInit = -90;
method = 'linear';
y = chirp(t, freqStart, tEnd, freqEnd, method, phaseInit);
  댓글 수: 4
Atilla Golan
Atilla Golan 2018년 1월 29일
It does work perfectly, I have two questions: 1- What is the role of phaseinit? I changed it to different values and nothing changed. 2- It is up-going linear, how we can make down-going one?
Greg Dionne
Greg Dionne 2018년 1월 29일
Try something like this:
t=0:0.001:2; % 2 secs @ 1kHz sample rate
y=chirp(t,200,1,100,'linear'); % Start @ 200Hz, cross 100Hz at t=1sec
spectrogram(y,kaiser(128,18),120,128,1E3,'reassigned','yaxis');
title('Linear Chirp: start at 200Hz and cross 100Hz at t=1sec');

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

카테고리

Help CenterFile Exchange에서 Linear Prediction에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by