Plotting in real frequency not normalized
2 次查看(过去 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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Generation and Preprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!