How can I find the transfer function of a lowpass filter using the Kaiser windowing method?

조회 수: 5 (최근 30일)
From the code given, how can I find the transfer function and the order of the numerator and denominator? I am having trouble on how to implement kaiserord and kaiser into the code.
% design parameters
wp=2000*pi;
ws=3000*pi;
f0=8000;
w0=2*pi*f0;
A=45;
% cut-off frequency
wc=0.5*(wp+ws);
% normalized cut-off frequency
wc_n=wc/(0.5*w0);
% delta cut-off frequency
del_wc=ws-wp;
% delta normalized cut-off frequency
del_wc_n=del_wc/(0.5*w0);
% beta
if(A<=21)
beta=0;
elseif(21<A & A<50)
beta=0.5842*(A-21)^0.4+0.07886*(A-21);
elseif(A>=50)
beta=0.1102*(A-8.7);
end
% order
M=(A-7.95)/(2.285*pi*del_wc_n);
M=ceil(M);
% filter coefficients
b=fir1(M-1,wc_n,'low',kaiser(M,beta));
% magnitude
[H,f]=freqz(b,1,256,f0);
% magnitude spectrum
figure,plot(f,20*log10(abs(H)),'Color',line_color,'LineWidth',line_width),grid
xlabel('f [Hz]','FontSize',font_size), ylabel('20log_{10}(H(f)) [dB]','FontSize',font_size)
title('Magnitude Spectrum','FontSize',font_size)
set(gca,'FontSize',font_size)
set(gca,'XLim',[0 4000]), set(gca,'XTick',[0:500:4000],'FontSize',font_size)
set(gca,'YLim',[-120 20]), set(gca,'YTick',[-120:20:20],'FontSize',font_size)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by