I have a SISO system, input and an output time data and would like to get a model of the tf. The input signal is a sine sweep with frequencies ranging from at about 1 Hz to about 400 Hz. I tried tfest. I compared the system response with the output I get from spafdr. They fit good for low frequencies (i.e. <=100 Hz) but not so good for the larger frequencies. I believe it should be possible to get a better approximation at larger frequencies without having a loss in accuracy for lower frequencies. But I do not know how to get there. Increasing the number of poles did not help but it increased the computational time drastically. I use a passband weightingfilter. Changing the bounds did also not help. According to the output it seems that the optimization did not improve the system and basically the output of the initialization is returned. % code %iddata requires first output then input data=iddata(u{2},u{1},ts); %angular velocities w=2*pi*logspace(log10(10),log10(300),100); %number of poles np=10; %number of zeros nz=[];%let Matlab choose %%options for tfest %passband or sys weightingfilter=2*pi*[10 500];% opt=tfestOptions('display','on','InitMethod','all','WeightingFilter',weightingfilter);%,'SearchMethod','fmincon' tic sysspa=spafdr(data,[],w) y=toc; disp(['Time for spafdr: ' num2str(y) ' sec']); tic sys=tfest(data,np,nz,'iodelay',nan,opt)%init_sys,,opt, y=toc; disp(['Time for tfest: ' num2str(y) ' sec']); %%plotting figure; bodeplot(sysspa,w) hold on; bodeplot(sys,w) figure; bodeplot(sysspa) hold on; bodeplot(sys) legend('spafdr',['tfest ' num2str(np) ' poles, ' num2str(nz) ' zeros'],'Location','Southoutside'); end
John Williams answered .
2025-11-20