function [cx,crx,crxmax,cry,crymax]=msinclip(varargin)
%MSINCLIP - Multisine design with mimimum crest factor.
%
% Algorithm: time domain <--> frequency domain swapping, clipping in time
% domain. The output is an object (structure) containing the complex Fourier
% amplitudes; use MSINPREP to generate a tiime domain signal from these.
%
% Output arguments:
% cx = fiddata object of the designed multisine. In the property 'input'
% it contains the coefficients of the complex Fourier series:
% the absolute values are equal to halves of the real amplitudes).
% For the ZOH case (see below for crestmode), precompensation
% with the inverse of the ZOH transfer function is applied, and the
% calculated coefficients are those of the ZOH-generated excitation
% signal.
% crinfo = information about the crest factors. Fields of this structure:
% crx = crest factor of the generated multisine, calculated with the
% given oversampling factor.
% crxmax = worst case crest factor of the multisine
% cry = crest factor of the multisine at the output of the linear
% system, calculated with the given oversampling factor.
% crymax = worst case output crest factor of the multisine
%
% Input arguments:
% Fdat = fiddata object (see 'help fiddata' and 'help(fiddata)',
% with the basic quantities (in stand-alone applications
% Fdat may be a structure with these fields):
% freqpoints = vector of frequencies where the nonzero amplitudes are
% given: the elements must be integer multiples of a df value, minimum
% number of sines: 2. The frequency vector must be strictly
% monotonously increasing.
% input = absolute values of the desired nonzero complex amplitudes
% (coefficients of the complex Fourier series at the corresponding
% frequencies: halves of the real coefficients).
% If any element is complex, the phases of the input vector will be
% used as starting values, otherwise the Schroeder multisine is used.
% For elements given with value NaN, auxiliary sine amplitudes are
% returned ("snowing"): these are not included into the
% calculation of the effective value of the useful excitation
% signal, only help to decrease the peak value.
% Default for these amplitudes: ones(length(fv),1)
% Initial values for the snowing case can be given by a special
% field of runmod: 'snowinginput' is the NaN-containing vector, the
% real values are neglected.
% output = (optional) outputs: input amplitudes multiplied by the complex
% transfer function values at the given frequencies.
% If the output is given, input-output optimization will be performed.
% runmod = structure of run modifiers. Usually not necessary.
% For the details, execute 'msinclip runmod'.
%
% Usage: [cx,crinfo]=msinclip(Fdat,runmod);
% Examples:
% [cx,crestx]=msinclip(fiddata([],[],[1:15]'/256));
% %Schroeder starting phases:
% cx=msinclip(fiddata([],ones(12,1),4:15),struct('initset','Schroeder'));
% %Prepare time series, 2048 points, fs = 1024 Hz:
% timeobject=msinprep(cx,2048,1024);
% %ZOH design:
% cx=msinclip(fiddata([],ones(21,1)/sqrt(42),[0.2:0.01:0.4]*1e3),...
% struct('crestmode','ZOH','N',100,'itno',350));
% Copyright (c) I. Kollar and VUBrussel, ELEC, 1991-2004
%
% See also: DIBS, MSINPREP, CRESTMIN.
if nargin==0, error('No input argument'), end
if (nargin==1)&isstr(varargin{1})
if strncmpi(varargin{1},'preload',4)
return %preload only
elseif strcmp(varargin{1},'oldhelp')
oldhelp msinclip
return
elseif strcmp(varargin{1},'runmod')|strcmp(varargin{1},'runpar')
msincrmt
return
elseif strcmp(varargin{1},'secret')
fprintf([' ''Secret'' way of setting the number of iterations:\n',...
' global msinclip_max_iteration_number\n msinclip_max_iteration_number=<iterations>;\n'])
return
end
error(['First argument ''',varargin{1},''' is not allowed'])
end
%
global msinclip_max_iteration_number
c=computer; MatlV=version; isPC=strcmp(c(1:2),'PC'); isPlot=0; plotdone=0;
if isPC %Matlab5 under Win95 still greys out
calldrawnow=1; calliterctrl=1;
else %regular case, e.g. Matlab5 on any platform, still may grey out
calldrawnow=1; calliterctrl=1;
end
%calldrawnow=0; calliterctrl=0; %Force to eliminate drawnows
%calldrawnow=1; calliterctrl=1; %Force to call drawnows
%
itctrllastchecked='Continue'; termcond=0;
if calldrawnow, drawnow, end
%
crdef=1; %crdef=1: cr=max(abs(multisine))/effval, crdef=2:multisinepp/2/effval
%mbint(crdef) %assertion (neglected by Matlab 5.3, but not by 5.2)
yes=1; no=0;
global halffiginmsinclip
if ~exist('halffiginmsinclip'), halffiginmsinclip=''; end
if ~isempty(halffiginmsinclip)
halffig=halffiginmsinclip; halffiginmsinclip='';
else halffig='n';
end
%for halffig='y', the plot of input minimization is subplot(1,2,1)
cldef='JS'; %clipping level; JS: Johan Schoukens, PG: Patrick Guillaume,
% VDO: Edwin van der Ouderaa
%
Fdat=varargin{1};
OK=1;
if isstruct(Fdat)
if ~isfield(Fdat,'freqpoints'), OK=0; fprintf(['Fdat field ''freqpoints'' is missing'])
elseif ~isfield(Fdat,'input'), OK=0; fprintf(['Fdat field ''input'' is missing'])
elseif ~isfield(Fdat,'output'), Fdat.output='';
end
end
if OK==0, error('First input argument is an improper structure'), end
initset='';
showmsgs=0;
Nmax=inf;
if exist('fdguidev.mat'), showmsgs=1; end %messages for development
if isa(Fdat,'fiddata')|isstruct(Fdat)
if nargout>2, error('Too many output arguments'), end
error(nargchk(1,2,nargin))
initset='random'; %default for the new call
fv=Fdat.freqpoints;
ampv=Fdat.input;
tf=Fdat.output;
if ~isempty(tf)
ind=find(~isnan(Fdat.input));
tf(ind)=tf(ind)./Fdat.input(ind);
end
gmod=''; itno=[]; ovs=[]; N=[]; cl0=[]; sr=[]; pld=[]; crestmode='BL';
if (nargin>=2)&~isempty(varargin{2})&isstruct(varargin{2})
runmod=varargin{2};
fn=fieldnames(runmod);
for ii=1:length(fn)
if strncmp(fn{ii},'initset',4)
initset=getfield(runmod,fn{ii});
if strncmpi(initset,'Schroeder',3)
elseif strncmpi(initset,'random',4)
elseif strncmpi(initset,'input',2)
elseif isempty(initset)
else error(['initset ''',initset,''' is invalid'])
end
elseif strncmp(fn{ii},'graphs',5), gmod=getfield(runmod,fn{ii});
elseif strncmp(fn{ii},'showmsgs',5)
showmsgs=getfield(runmod,fn{ii});
showmsgs=~strncmp(showmsgs,'n',1);
elseif strncmp(fn{ii},'crestmode',6)
crestmode=getfield(runmod,fn{ii});
if strcmpi(crestmode,'discrete'), gmod=[gmod,'ZOHd'];
elseif strcmpi(crestmode,'ZOH')|strcmpi(crestmode,'DAC'), gmod=[gmod,'ZOHc'];
elseif strncmpi(crestmode,'filtered-DAC',8)|strcmpi(crestmode,'fDAC')
gmod=[gmod,'fDAC'];
elseif strcmpi(crestmode,'BL') %default
else error(['crestmode is not allowed: ''',crestmode,''''])
end
elseif strncmp(fn{ii},'itno',2), itno=getfield(runmod,fn{ii});
elseif strncmp(fn{ii},'pmin',4) %for crestmin only
warning('pmin has no meaning in msinclip')
elseif strncmp(fn{ii},'relvarmax',4) %for crestmin only
warning('relvarmax has no meaning in msinclip')
elseif strncmp(fn{ii},'pmax',4) %for crestmin only
warning('pmax has no meaning in msinclip')
elseif strncmp(fn{ii},'oversampling',5), ovs=getfield(runmod,fn{ii});
elseif strcmpi(fn{ii},'N'), N=getfield(runmod,fn{ii});
elseif strcmpi(fn{ii},'Nmax'), Nmax=getfield(runmod,fn{ii});
elseif strncmp(fn{ii},'cliplevel',5), cl0=getfield(runmod,fn{ii});
elseif strncmp(fn{ii},'slewrate
没有合适的资源?快使用搜索试试~ 我知道了~
毕业设计&课设-频域系统辨识Matlab工具箱.zip
共377个文件
m:238个
asv:80个
mat:56个
需积分: 0 2 下载量 150 浏览量
2024-01-08
23:07:17
上传
评论
收藏 30.52MB ZIP 举报
温馨提示
matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计&课设-频域系统辨识Matlab工具箱.zip (377个子文件)
MIMO_CR_bound.asv 38KB
MIMO_ML_CRbound.asv 25KB
RobustLocalPolyAnal.asv 23KB
SISO_Feedback_arb.asv 22KB
FastLocalPolyAnal.asv 19KB
ML_EIV_robust.asv 18KB
MIMO_BoxJenkins.asv 17KB
BoxJenkins.asv 17KB
CRboundPhysicalParam.asv 16KB
MIMO_ML_CRtheta.asv 16KB
MIMO_BJ.asv 16KB
ArbLocalPolyAnal.asv 15KB
LocalPolyAnal.asv 14KB
ML_OE_arb.asv 13KB
MIMO_ML.asv 13KB
CovResidues.asv 13KB
MIMO_IQML.asv 13KB
MIMO_ML_Jacob.asv 13KB
ReadMeFirst.asv 11KB
SpectralAnal.asv 11KB
StartNoiseModel.asv 11KB
MIMO_ML_NewtonGaussStep.asv 10KB
MIMO_LS_Jacob.asv 10KB
MIMO_WGTLS_Step.asv 10KB
NL_robust.asv 9KB
StartPlantModel.asv 9KB
ML_Feedback_arb.asv 9KB
MIMO_WGTLS.asv 9KB
SISO_Feedback.asv 9KB
ReadMeFirst.asv 9KB
MIMO_ML_CRboundPhysicalParam.asv 9KB
MIMO_ML_CRtf.asv 9KB
CovRoots.asv 8KB
ImposeModelCompatibility.asv 8KB
MIMO_WTLS.asv 8KB
PeriodLocalPolyAnal.asv 8KB
DefaultValues.asv 8KB
CalcCovSingularVectors.asv 8KB
MIMO_LS_NewtonGaussStep.asv 8KB
MIMO_ARMA.asv 7KB
SISO_WH_robust.asv 7KB
BJNewtonGaussStep.asv 6KB
SISO_WH_fast.asv 6KB
MIMO_ML_CalcDeriv.asv 6KB
MIMO_OE.asv 6KB
MIMO_ML_Cost.asv 6KB
MIMO_ML_DefaultValues.asv 6KB
MIMO_LS_CovJacob.asv 6KB
SensResidues.asv 5KB
MIMO_WGTLS_AddSelectColumns.asv 5KB
WhitenessTestResiduals.asv 5KB
MIMONormalise.asv 5KB
SISO_Concat_arb.asv 5KB
MIMO_ML_InvCovOutputError.asv 5KB
CR_PlantModel.asv 4KB
MIMO_ML_Constrain.asv 4KB
MIMO_OE_arb.asv 4KB
SISO_EIV_arb.asv 4KB
MIMO_ML_ModelCompatibility.asv 4KB
ReadMeFirst.asv 4KB
MIMO_ML_Normalise.asv 4KB
MIMO_ML_PredError.asv 4KB
SISO_OE_arb.asv 3KB
SensRootsCoeff.asv 3KB
CalcResidues.asv 3KB
MIMO_Calc_IQML_Weight.asv 3KB
MIMO_Excitation.asv 3KB
MIMO_ML_ExtractParam.asv 3KB
MIMO_Calc_LS_Weight.asv 2KB
TheWindow.asv 2KB
FRF_EIV.asv 2KB
MIMO_ML_SelectEstimParam.asv 2KB
lintone.asv 2KB
logtone.asv 2KB
Cov_FRM.asv 2KB
EstimStochNLdist.asv 2KB
FRM.asv 1KB
InvMeanInput.asv 1KB
Sqrt_Inv.asv 676B
Mat_Trace.asv 636B
FINDER.DAT 6KB
.gitignore 649B
msinclip.m 51KB
MIMO_CR_bound.m 38KB
Fast_NL_Anal.m 26KB
MIMO_ML_CRbound.m 25KB
RobustLocalPolyAnal.m 24KB
Plot_Fast_NL_Anal.m 24KB
FastLocalPolyAnal.m 20KB
ML_EIV_robust.m 19KB
MIMO_BoxJenkins.m 18KB
ML_EIV_fast.m 17KB
CRboundPhysicalParam.m 17KB
BoxJenkins.m 17KB
MIMOJacob.m 16KB
MIMO_ML_CRtheta.m 16KB
MIMO_BJ.m 15KB
ArbLocalPolyAnal.m 15KB
MIMO_ML.m 14KB
CRmodelparameters.m 14KB
共 377 条
- 1
- 2
- 3
- 4
资源评论
白话机器学习
- 粉丝: 8910
- 资源: 7681
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功