?? lfm.m
字號:
function [s] = lfm(fmin, fmax, T, sampling_rate, type);
% generates an LFM pulse (chirp)
% fmin = min frequency
% fmax = max frequency
% T = duration of time-series
% sampling_rate = samples per second
% type ='lfm'/'lfm_doppler'
% by Aijun Song
if nargin~=4 & nargin~=5,
disp('[lfm]The number of inputs is not supported');
return;
end
if nargin==4,
type='lfm';
end
%Number of samples and time unit
N = T * sampling_rate;
deltaT = 1 / sampling_rate;
%time axis
time = linspace( 0.0, T - deltaT, N );
if size(time, 2)>1
time=time.';
end
%instant frequence
instant_freq = fmin + ((fmax-fmin)/(2*T)).* time ;
s = sin( 2.0 * pi * ( instant_freq .* time ));
if strcmp(type, 'lfm_doppler'),
s=s+sin(2.0*pi*fmin*time)+sin(2.0*pi*fmax*time);
s=s/max(abs(s));
elseif strcmp(type, 'lfm'),
s=s;
else
disp('[lfm]Wrong type!');
return;
end
% figure; specgram( s, 256, sampling_rate, [], []);
% 'lfm' type can also be implemented by:
%x = linspace( -1, 1, T * sampling_rate );
%s = vco( x, [fmin, fmax], sampling_rate );
% or matlab chirp command
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -