📄 estlocalfreq.m
字号:
function freqEst = estlocalfreq(sigVec,fSamp)%ESTLOCALFREQ Estimates the local (instantaneous) frequency of an complex signal vector.%%--------%Synopsis:% freqEst = estlocalfreq(sigVec,fSamp)%%Description:% Estimates the local (instantaneous) frequency of an complex signal vector.%%Output and Input:% freqEst (RealVectorT): Local frequency estimate [Hz].% sigVec (RealVectorT): Input complex signal vector.% fSamp (RealScalarT): Sampling frequency for "sigVec".%%--------%Notations:% Data type names are shown in parentheses and they start with a capital% letter and end with a capital T. Data type definitions can be found in [1]% or by "help dbtdata".% [D] = This parameter can be omitted and then a default value is used.% When the [D]-input parameter is not the last used in the call, it must be% given the value [], i.e. an empty matrix.% ... = There can be more parameters. They are explained under respective% metod or choice.%%Examples:% len = 1024; % Number of samples.% maxFDev = 500; % Maximum frequency deviation [Hz].% fSamp = 2000; % Sampling frequency [Hz].% Ts = 1/fSamp; % Sampling time [s].% t = linspace(0, Ts*len, len);% codeCalc = getmod('chirp',[maxFDev,fSamp,len]);% freqEst = estlocalfreq(codeCalc, fSamp);% figure, plot(t,[0;freqEst])% title('Frequency estimation')% xlabel('Time [s]')% ylabel('Frequency [Hz]')%%Software Quality:% (About what is done to ascertain software quality. What tests are done.)%%Known Bugs:%%References:% [1]: Bj鰎klund S.: "DBT, A MATLAB Toolbox for Radar Signal Processing.% Reference Guide", FOA-D--9x-00xxx-408--SE, To be published.%%See Also:% getmod tdbt(101)% * DBT, A Matlab Toolbox for Radar Signal Processing *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.%% Start : 980710 Svante Bj鰎klund (svabj).% Latest change: $Date: 2000/10/16 15:20:53 $ $Author: svabj $.% $Revision: 1.3 $% *****************************************************************************% ----------------------------------------------------------------------- %% Handle input parameters% ----------------------------------------------------------------------- %if (nargin < 2) error('DBT-Error: To few input parameters.')end% ****************** Add missing input parameters ******************%arginNo=2;%if (nargin < arginNo)% mainPointDoa = [];%end%arginNo = arginNo +1;% *************** Pick out some fields from input parameters. ***************% ****************** Default values ******************%if isempty(lambda)% lambda = 1;%end%if% ****************** Error check input parameters ******************% ----------------------------------------------------------------------- %% Calculate the antenna pattern.% ----------------------------------------------------------------------- %freqEst = 1/(2*pi) * diff(unwrap(angle(sigVec))) * fSamp; % [Hz]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -