Plotting in real frequency not normalized

1 次查看(过去 30 天)
I'm playing around with this code. How would I plot the set of Bandpass filters in real frequency not normalized?
%CenterF = 697;
CenterF = [697 770 852 941 1209 1336 1477 1633];
L = 50;
Fs = 8000;
ww = ones(L,1)*ones(1,8);
n = 0:L - 1;
w = -pi:pi/2000:pi;
h1 = cos(0.2*pi*n);
H1 = freqz(h1,1,w);
A = 1/max(abs(H1));
for i = 1:length(CenterF)
sg = A*cos(2*pi*CenterF(i)*n/Fs);
ww(:,i) = sg(:);
end
for i = 1:length(ww(1,:))
HH = freqz(ww(:,i),1,w);
if i == 1
figure()
end
plot(w,abs(HH));
title('Set of Bandpass Filters');
grid on;
xlabel('Normalized Radian Frequency');
ylabel('Magnitude');
axis([0,pi,0,max(abs(HH))+0.05]);
set(gca, 'xlim', [0 pi]);
set(gca, 'xtick', [0:4]*pi/4);
set(gca,'XTickLabel',{'0','\pi/4','\pi/2','3/4\pi','\pi'});
hold on
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Digital and Analog Filters 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by