How can i create a cascade filter from the same 'a' and b' values as a direct filter.
2 views (last 30 days)
Show older comments
Hi there,
I am currently figuring out filters. I have created a 5th order elipse filter with a direct form implimentation. I am curious as to if there is a 'simple' way to impliment the same trasnfer function in a cascade form (and parallel)
Thanks!
clc, clear all, close all;
data = audioread('Example.wav');
sample_rate = 8000;
nyq = sample_rate/2;
num_samples = length(data);
dF = sample_rate/num_samples;
f = -nyq : dF : (nyq)-dF;
time = [];
for i = 0:5/length(data):5-(5/length(data))
time(end+1) = i;
end
fft_data = fftshift(fft(data));
figure(1);
plot(f, fft_data);
xlabel("Frequency (Hz)");
ylabel("Amplitude (uV)");
xlim([-4000 4000])
[b,a] = ellip(5,9.7,800,0.3);
for value = 1:length(b)
b_quan(end+1) = ((round(b(value)*b_quan_val))*(1/b_quan_val));
a_quan(end+1) = ((round(a(value)*a_quan_val))*(1/a_quan_val));
end
% %%%%%%%Direct realisation
output = filter(b,a,data);
audiowrite('Direct.wav', output, sample_rate);
figure(3);
plot(time, output);
xlim([0,1]);
0 Comments
Answers (0)
See Also
Categories
Find more on Digital Filter Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!