Plotting in real frequency not normalized

2 Ansichten (letzte 30 Tage)
Vinci
Vinci am 17 Okt. 2018
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

Antworten (0)

Kategorien

Mehr zu Signal Generation and Preprocessing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by