git-svn-id: http://moon:8086/svn/matlab/trunk@128 801c6759-fa7c-4059-a304-17956f83a07c
29 lines
575 B
Matlab
29 lines
575 B
Matlab
function [B,A] = boost(fs, fc, bw, gain, P);
|
|
%BOOST - Design a boost filter at given gain, center
|
|
% frequency fc, bandwidth bw, and sampling rate fs
|
|
% (default = 1).
|
|
%
|
|
% J.O. Smith 11/28/02
|
|
% Reference: Zolzer: Digital Audio Signal Processing, p. 124
|
|
|
|
Q = fs/bw;
|
|
wcT = 2*pi*fc/fs;
|
|
|
|
K=tan(wcT/2);
|
|
V=gain;
|
|
|
|
b0 = 1 + V*K/Q + K^2;
|
|
b1 = 2*(K^2 - 1);
|
|
b2 = 1 - V*K/Q + K^2;
|
|
a0 = 1 + K/Q + K^2;
|
|
a1 = 2*(K^2 - 1);
|
|
a2 = 1 - K/Q + K^2;
|
|
A(1,:) = [a0 a1 a2] /a0;
|
|
B(1,:) = [b0 b1 b2] /a0;
|
|
|
|
if nargout==0
|
|
freqz(B(1,:),A(1,:));
|
|
title('Boost Frequency Response')
|
|
end
|
|
|