從MATLAB幫助文檔上學(xué)習(xí) chirp
當(dāng)我直接去看chirp的matlab幫助文檔時(shí),始終不得要領(lǐng),查看了很多博文上的說(shuō)法,也還是不懂,直到我去查看了維基百科,并總結(jié)了下面這篇博文后,反過(guò)來(lái)看chirp的matlab幫助文檔,才覺(jué)得明朗了一些。

【 MATLAB 】適合初學(xué)者的 chirp 理解與推導(dǎo)
因此,推薦看看上篇這篇博文,先從基礎(chǔ)上了解下chirp信號(hào)。
MATLAB 中稱(chēng) chirp 為 Swept-frequency cosine,也即掃頻余弦波。
MATLAB 中給出了 chirp 如下的語(yǔ)法結(jié)構(gòu):
下面一一簡(jiǎn)單介紹:
y?=?chirp(t,f0,t1,f1) 在陣列t中定義的時(shí)間實(shí)例中產(chǎn)生線性掃頻余弦信號(hào)的樣本,f0為時(shí)間為0時(shí)刻的瞬時(shí)頻率,f1為時(shí)刻t1時(shí)的瞬時(shí)頻率,二者單位都是赫茲。如果未指定,則對(duì)于logarithmic chirp,f0為10^-6;對(duì)于其他的chirp,f0都為0,t1為1,f1為100.
y?=?chirp(t,f0,t1,f1,'method')?指定可選擇的掃頻方法,掃頻方法介紹如下:
如果看了上篇博文,這點(diǎn)介紹應(yīng)該是能看懂的(盡管有些差異,差異在于叫法以及少了下面的第二種情況),我就不翻譯了,翻譯也許就沒(méi)那么精妙了。
總結(jié)起來(lái),掃頻方法分為三種,分別為linear、quadratic、logarithmic。
y?=?chirp(t,f0,t1,f1,'method',phi)?allows an initial phase?phi?to be specified in degrees. If unspecified,?phi?is?0. Default values are substituted for empty or omitted trailing input arguments.
這種形式指定了初始相位,如果未指定初始相位為0。
y?=?chirp(t,f0,t1,f1,'quadratic',phi,'shape')?specifies the?shape?of the quadratic swept-frequency signal's spectrogram.?shape?is either?concave?or?convex, which describes the shape of the parabola in the positive frequency axis. If?shape?is omitted, the default is convex for downsweep (f0?>?f1) and is concave for upsweep (f0?
y = chirp(t,f0,t1,f1,'quadratic',phi,'shape')指定二次掃頻信號(hào)的頻譜圖的形狀。 形狀是凹形或凸形,它描述了正頻率軸上拋物線的形狀。 如果省略形狀,則默認(rèn)為下掃頻(f0> f1)為凸,而上掃頻(f0 下面舉一個(gè)例子: Linear chirp Generate a chirp with linear instantaneous frequency deviation. The chirp is sampled at 1 kHz for 2 seconds. The instantaneous frequency is 0 at t = 0 and crosses 250 Hz at t = 1 second. 產(chǎn)生具有線性瞬時(shí)頻率偏差的chirp。采樣率為1KHz,時(shí)間為2s,初始頻率為0,時(shí)間為1時(shí)刻的頻率為250Hz。 % Generate a chirp with linear instantaneous frequency deviation. % The chirp is sampled at 1 kHz for 2 seconds. % The instantaneous frequency is 0 at t = 0 and crosses 250 Hz at t = 1 second. clc clear close all t = 0:1/1e3:2; y = chirp(t,0,1,250); subplot(2,1,1) plot(t,y) subplot(2,1,2) spectrogram(y,256,250,256,1e3,'yaxis') Quadratic chirp Generate a chirp with quadratic instantaneous frequency deviation. The chirp is sampled at 1 kHz for 2 seconds. The instantaneous frequency is 100 Hz at t = 0 and crosses 200 Hz at t = 1 second. % Generate a chirp with quadratic instantaneous frequency deviation. % The chirp is sampled at 1 kHz for 2 seconds. % The instantaneous frequency is 100 Hz at t = 0 and crosses 200 Hz at t = 1 second. clc clear close all t = 0:1/1e3:2; y = chirp(t,100,1,200,'quadratic '); subplot(2,1,1) plot(t,y) % Compute and plot the spectrogram of the chirp. % Specify 128 DFT points, a Hamming window of the same length, and 120 samples of overlap. subplot(2,1,2) spectrogram(y,256,250,256,1e3,'yaxis') 中間流了兩種情況,等我弄明白了再填。 那個(gè)spectrogram我會(huì)單獨(dú)寫(xiě)一篇博客,弄懂它。暫時(shí)還不是太明白原理。 Logarithmic Chirp % Generate a logarithmic chirp sampled at 1 kHz for 10 seconds. % The instantaneous frequency is 10 Hz initially and 400 Hz at the end. clc clear close all t = 0:1/1e3:10; fo = 10; f1 = 400; y = chirp(t,fo,10,f1,'logarithmic'); subplot(2,1,1) plot(t,y) % Compute and plot the spectrogram of the chirp. % Specify 256 DFT points, a Hamming window of the same length, and 200 samples of overlap. subplot(2,1,2) spectrogram(y,256,200,256,1e3,'yaxis') MATLAB
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶(hù)投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實(shí)的內(nèi)容,請(qǐng)聯(lián)系我們jiasou666@gmail.com 處理,核實(shí)后本網(wǎng)站將在24小時(shí)內(nèi)刪除侵權(quán)內(nèi)容。
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶(hù)投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實(shí)的內(nèi)容,請(qǐng)聯(lián)系我們jiasou666@gmail.com 處理,核實(shí)后本網(wǎng)站將在24小時(shí)內(nèi)刪除侵權(quán)內(nèi)容。