Is there a function to find the product of a transfer function array?
2 次查看(过去 30 天)
显示 更早的评论
I have a transfer function array created, for example, by
%sample number of biquads
numBQs = 20;
%preallocate transfer function
BQtfs = tf(zeros(1,1,numBQs));
Fs = 12000; %Hz
%loop over each biquad to create discrete transfer function
for i1 = 1:numBQs
%create discrete transfer function
BQtfs(:,:,i1) = tf([1 -1.5 0.9], [1 -0.9 0.9], 1/Fs);
end
The biquad filter coefficients are typically coming from matrices containing the numerator (and denominator) coefficients in a row such that the transfer function array would be filled by something that looks like
BQtfs(:,:,i1) = tf(BQ_b(i1,:),BQ_a(i1,:), 1/Fs);
If I now want to combine my biquad filters into a single filter, I create the product of the transfer functions. Is there a function or a better way to combine them than a simple loop such as
BQtf = BQtfs(:,:,1);
for i1 = 2:lenBQs
BQtf = BQtf*BQtfs(:,:,i1);
end
The end game is simply to be able to plot the individual filters and the combined filter.
bode(BQtfs)
can be used to efficiently plot the transfer function array, but I'm not sure if there is a better way than this to plot the combined filter.
0 个评论
回答(1 个)
Star Strider
2018-12-17
2 个评论
Star Strider
2018-12-17
If I understand correctly what you want to do, I would do something like this:
Fs = 12000; %Hz
sys = tf([1 -1.5 0.9], [1 -0.9 0.9], 1/Fs);
sys1 = 1;
%sample number of biquads
numBQs = 20;
%loop over each biquad to create discrete transfer function
for i1 = 1:fix(numBQs/2)-1
%create discrete transfer function
sys1 = series(sys1,sys);
end
figure
bode(sys1)
This produces a tf object as ‘sys1’.
You will likely have to experiment with it to get the result you want.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!