Plotting in real frequency not normalized

조회 수: 2 (최근 30일)
Vinci
Vinci 2018년 10월 17일
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에서 Signal Generation and Preprocessing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by