Fractional order filters in Simulink

4 Ansichten (letzte 30 Tage)
Marko
Marko am 13 Apr. 2016
Kommentiert: Marko am 13 Apr. 2016
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!
  1 Kommentar
Marko
Marko am 13 Apr. 2016
I managed to do it in the meanwhile but I will answer my own question if anyone ever comes across a similar request. So the idea is semi-correct. The function should be:
function y = fcn(u)
Tcc1 = 5.3052e-05;
y = 20*log10(abs(80./((Tcc1*j*u)+1)^1));
And the simulink model is:
And you should also make sure that f is the same as your signal frequency if it's a sinusoidal signal.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by