# How do I convert a transfer function of a low pass filter to bandpass?

20 views (last 30 days)
Marian Vides on 26 Oct 2020 at 3:42
Edited: Rik on 28 Oct 2020 at 18:21
This question was flagged by Star Strider
I obtained the transfer function like this:
syms s;
N=4;
for k=1:N
w=((2*k+N-1)/(2*N))*pi;
Skr(k) = cos(w);
Ski(k) = sin(w);
end
Sk=complex(Skr,Ski);
Sknum=prod(-Sk)
Skdem=(poly(Sk))
Hs=tf(Sknum, Skdem)
And now I need to replace s for the expression Op*(s^2+ Oi*Os)/s*BW, in where BW is the bandwith (Os- Oi)
I need help to find the new transfer function for the bandpass filter and to plot it like this:
%freqs(Sknum, Skdem);
%[Hs,w]=freqs(Sknum, Skdem);
%figure,
%plot(w, 20*log10(abs(Hs)))
Thanks!

#### 1 Comment

Rik on 28 Oct 2020 at 18:20

Star Strider on 26 Oct 2020 at 4:10
If you want to use the Signal Processing Toolbox functions, this works:
syms s;
N=4;
for k=1:N
w=((2*k+N-1)/(2*N))*pi;
Skr(k) = cos(w);
Ski(k) = sin(w);
end
Sk=complex(Skr,Ski);
Sknum=prod(-Sk)
Skdem=(poly(Sk))
Hs=tf(Sknum, Skdem)
figure
bode(Hs)
Hs_ss = ss(Hs);
Wo = 25; % Centre Frequency
Bw = 10; % Bandwidth
[At,Bt,Ct,Dt] = lp2bp(Hs_ss.A, Hs_ss.B, Hs_ss.C, Hs_ss.D, Wo, Bw);
Hs_ss_bp = ss(At,Bt,Ct,Dt);
figure
bode(Hs_ss_bp)
.