Question
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
Expert Answer
John Williams
PhD Expert
Answered Aug 25, 2026
It is usually harder to get good fit for higher frequencies because the input signal is significantly attenuated at high frequencies. So when you are system IDing using frequency data it is a good practice to amplify the sine wave for higher frequency range.
If the data is fixed and you cannot perform another sine sweep, what you can do is cut out high frequency data and fit using the better part of the data.
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related matlab Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →