1
function [h2]=cheb1mag(n,omegac,epsilon,sample)
2
//<h2>=cheb1mag(n,omegac,epsilon,sample)
3
//Square magnitude response of a type 1 Chebyshev filter
5
//epsilon such that 1/(1+epsilon**2)=passband ripple
6
//sample vector of frequencies where the square magnitude
9
// omegac :Cut-off frequency
10
// epsilon :Ripple in pass band
11
// sample :Vector of frequency where cheb1mag is evaluated
12
// h2 :Chebyshev I filter values at sample points
20
Tn=chepol(n,'x'); //n-th Chebyshev polynomial
21
fr=freq(Tn,1,sample/omegac); //fr=Tn(sample/omegac)
22
h2=un./(un+epsilon*epsilon*fr.*fr) //magnitude