Hi guys,
I'd like to check the behaviour of my system using fractional order filters. Basically, I'd like to have a way to implement filters with -2db/decade to -20db/decade with step of -2. The filters are in the figure.
So this is my code in Matlab but I'm not sure how to implement it in Simulink.
p = 0.1:0.1:1;
w = logspace(-4,10,500000);
for i = 1:10
Fr = @(w) 80./((Tcc1*j*w)+1).^p(i);
figure(5)
semilogx(w,20*log10(abs(Fr(w))))
hold on
end
title('Fractional order filters');
xlabel('Frequency [rad/s]');
ylabel('Magnitude [dB]');
So my best guess so far was to use MATLAB function block and compute the magnitude in linear scale like in the figure below.
And the code for this one would be:
function y = fcn(u)
Tcc1 = 5.3052e-05;
y = 20*log(abs(1./((Tcc1*j*u)+1)^0.5));
y = u;
Any ideas? Thanks in advance!