예제 #1
0
#Transition Band
df = 0.3

#Passband && stopband tolerance
d = 0.15

#sampling rate
Fs = 48


def W(Fs, F):
    w = 2 * float(F) / Fs
    return w


N, R1, R2, ao, B, alp, als, ap1, ap2, as1, as2 = parameters(
    Fp2, Fp1, df, d, Fs)

e = 0.6197

w_bp = np.linspace(-0.5, 0.5, 200)

s = (1 - np.exp(-1j * w_bp * np.pi)) / (1 + np.exp(-1j * w_bp * np.pi))

s_L = (((s)**2) + ao**2) / (B * s)

H_bp = filt_design(N, e, alp, s_L)

wp1 = W(Fs, Fp1)
wp2 = W(Fs, Fp2)
ws1 = W(Fs, Fp1 + df)
ws2 = W(Fs, Fp2 - df)
예제 #2
0
from Gen_LPF_Coeff import filt_design

#Passband Cutoffs
Fp2 = 6.0
Fp1 = 7.2

#Transition Band
df = 0.3

#Passband && stopband tolerance
d = 0.15

#sampling rate
Fs = 48

N, R1, R2, alp = parameters(Fp2, Fp1, df, d, Fs)

e_array = np.linspace(R1, R2, 6)

Omga_L = np.linspace(0, 2, 200)

s = 1j * Omga_L

for e in e_array:
    b, a = filt_design(N, e, alp)

    H_lp = np.polyval(b, s) / np.polyval(a, s)

    plt.plot(Omga_L, abs(H_lp), label=round(e, 2))

plt.xlabel('$Frequency(\Omega)$')
예제 #3
0
from N_epsilon import parameters

#Passband Cutoffs
Fp2=6.0
Fp1=7.2

#Transition Band
df=0.3

#Passband && stopband tolerance
d=0.15

#sampling rate
Fs=48

N,R1,R2,ao,B = parameters(Fp2,Fp1,df,d,Fs)

e=0.37
e_2=e**2

Omga_L=np.linspace(0,2,200)
s=1j*Omga_L

h_spec=np.sqrt(1/(1+e_2*((8*(Omga_L**4)-8*(Omga_L**2)+1)**2)))
h_design=(0.3125)/(((s)**4)+(1.1068*(s)**3)+(1.6125*(s)**2)+(0.9140*s)+0.3366)
plt.plot(Omga_L,h_spec,label='specifications')
plt.plot(Omga_L,abs(h_design),'o',label='design')
plt.xlabel('$Frequency$')
plt.ylabel('$Magnitude$')
plt.legend()
plt.grid()
예제 #4
0
from N_epsilon import parameters

#Passband Cutoffs
Fp2 = 6.0
Fp1 = 7.2

#Transition Band
df = 0.3

#Passband && stopband tolerance
d = 0.15

#sampling rate
Fs = 48

N, R1, R2, ao, B, alp, als = parameters(Fp2, Fp1, df, d, Fs)

print R1, "<= e <=", R2

print "N>=", N  # order of the filter