MATLAB: 3db bandwidth of a low pass filter

3db bandwidth

Hi, I need to generate a low pass filter and find its 3db values. Do we have any matlab command to find 3db bandwidth? If so, can I plot it?

Best Answer

Another way is to get the magnitude response using freqz()
[B,A] = butter(10,0.1);
[H,W] = freqz(B,A);
magresp = 20*log10(abs(H));
maxresp = max(magresp);
[I,~] = find(magresp < maxresp-3,3,'first');
fprintf('3-dB point is %2.3f*pi radians/sample\n', W(I(1))/pi)
Wayne