How Can I estimate the numerator and denominator from the transfer function?

4 views (last 30 days)
hi all,...
first I want to estimate the transfer function from the Output and Input of my system
my code
Fs=1/(4*10^-8);
NFFT=2^9;
len=512;
w=logspace(0,6,512); %setup for x-axis
Y1=fft(CH1,NFFT)/len; %input
Y2=fft(CH2,NFFT)/len; %output
ratio=Y1.*Y2./Y1.^2;
MagH=abs(ratio);
%transfer function
MagHdb=20*log10(MagH); %transfer function converted to dB
PhaseHRad=angle(ratio); %phase done in radians
PhaseHDeg=PhaseHRad*180/pi; %phase done in degrees
subplot(2,1,1)
semilogx(w,MagHdb,':b') %semilog plot
xlabel('frequency [rad/s]'),ylabel('20 log10(TF) [db]'),grid %xaxis label
subplot(2,1,2)
semilogx(w,PhaseHDeg,':b')
.............................................................
the output plot will be attached >
now i saw that this out is wrong or i follow bad rules .
Also how can i find the numerator and denominator from the transfer function? . . .
many thanks!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!