def setLinParametric(self, f_start=0.001, f_stop=0.5, bw=0.2, stopGain=-20, fs=1.0): """ set linear spaced parametric filters from f_start to f_stop with a bandwidth of bw octaves and stopGain in the stop bands """ size = self.getSize() self.fc = N.linspace(f_start, f_stop, size) self.B = N.zeros((size, 3)) self.A = N.zeros((size, 3)) for n in range(size): self.B[n], self.A[n] = filtering.biquad(fs, self.fc[n], "BPF", BW=bw) for n in range(size): self.B[n], self.A[n] = filtering.biquad(fs, self.fc[n], "peakingEQ", BW=bw, dBgain=-stopGain) self.fc[n] /= fs # normalize parametric EQ to 0 dB g = 10 ** (-stopGain / 20.0) self.B = self.B / g
def setLinBPCutoffs(self, f_start=0.001, f_stop=0.5, bw=0.2, fs=1.0): """ set linear spaced bandpass filters from f_start to f_stop with a bandwidth of bw octaves """ size = self.getSize() self.fc = N.linspace(f_start, f_stop, size) self.B = N.zeros((size, 3)) self.A = N.zeros((size, 3)) for n in range(size): self.B[n], self.A[n] = filtering.biquad(fs, self.fc[n], "BPF", BW=bw) self.fc[n] /= fs
def setLinParametric(self, f_start=0.001, f_stop=0.5, bw=0.2, \ stopGain=-20, fs=1.): """ set linear spaced parametric filters from f_start to f_stop with a bandwidth of bw octaves and stopGain in the stop bands """ size = self.getSize() self.fc = N.linspace(f_start, f_stop, size) self.B = N.zeros((size, 3)) self.A = N.zeros((size, 3)) for n in range(size): self.B[n],self.A[n] = \ filtering.biquad(fs,self.fc[n],'BPF',BW=bw) for n in range(size): self.B[n],self.A[n] = \ filtering.biquad(fs,self.fc[n],'peakingEQ',BW=bw, \ dBgain=-stopGain) self.fc[n] /= fs # normalize parametric EQ to 0 dB g = 10**(-stopGain / 20.) self.B = self.B / g
def setLinBPCutoffs(self, f_start=0.001, f_stop=0.5, bw=0.2, fs=1.): """ set linear spaced bandpass filters from f_start to f_stop with a bandwidth of bw octaves """ size = self.getSize() self.fc = N.linspace(f_start, f_stop, size) self.B = N.zeros((size, 3)) self.A = N.zeros((size, 3)) for n in range(size): self.B[n],self.A[n] = \ filtering.biquad(fs,self.fc[n],'BPF',BW=bw) self.fc[n] /= fs
def setConstBPCutoffs(self, f=[0.1, 0.3], bw=0.2, fs=1.0): """ f is a list with bandpass centerfrequencies, bw the bandwidth in octaves """ size = self.getSize() nr = len(f) self.B = N.zeros((size, 3)) self.A = N.zeros((size, 3)) self.fc = N.zeros(size) for n in range(size): self.B[n], self.A[n] = filtering.biquad(fs, f[n % nr], "BPF", BW=bw) self.fc[n] = f[n % nr] / fs
def setConstBPCutoffs(self, f=[0.1, 0.3], bw=0.2, fs=1.): """ f is a list with bandpass centerfrequencies, bw the bandwidth in octaves """ size = self.getSize() nr = len(f) self.B = N.zeros((size, 3)) self.A = N.zeros((size, 3)) self.fc = N.zeros(size) for n in range(size): self.B[n],self.A[n] = \ filtering.biquad(fs,f[n%nr],'BPF',BW=bw) self.fc[n] = f[n % nr] / fs
def setLogParametric(self, f_start=0.001, f_stop=0.5, bw=0.2, \ stopGain=-20, fs=1.): """ set log spaced parametric filters from f_start to f_stop with a bandwidth of bw octaves and stopGain in the stop bands """ size = self.getSize() self.fc = N.logspace(N.log10(f_start), N.log10(f_stop), \ size, True) self.B = N.zeros((size,3)) self.A = N.zeros((size,3)) for n in range(size): self.B[n],self.A[n] = \ filtering.biquad(fs,self.fc[n],'BPF',BW=bw) for n in range(size): self.B[n],self.A[n] = \ filtering.biquad(fs,self.fc[n],'peakingEQ',BW=bw, \ dBgain=-stopGain) self.fc[n] /= fs # normalize parametric EQ to 0 dB g = 10**(-stopGain/20.) self.B = self.B / g
def setLogBPCutoffs(self, f_start=0.001, f_stop=0.5, bw=0.2, fs=1.): """ set log spaced bandpass filters from f_start to f_stop with a bandwidth of bw octaves """ size = self.getSize() self.fc = N.logspace(N.log10(f_start), N.log10(f_stop), \ size, True) self.B = N.zeros((size,3)) self.A = N.zeros((size,3)) for n in range(size): self.B[n],self.A[n] = \ filtering.biquad(fs,self.fc[n],'BPF',BW=bw) self.fc[n] /= fs
def setConstParametric(self, f=[0.1, 0.3], bw=1.0, stopGain=-20, fs=1.0): """ f is a list with bandpass centerfrequencies, bw the bandwidth in octaves, stopGain the gain in the stop bands """ size = self.getSize() nr = len(f) self.B = N.zeros((size, 3)) self.A = N.zeros((size, 3)) self.fc = N.zeros(size) for n in range(size): self.B[n], self.A[n] = filtering.biquad(fs, f[n % nr], "peakingEQ", BW=bw, dBgain=-stopGain) self.fc[n] = f[n % nr] / fs # normalize parametric EQ to 0 dB g = 10 ** (-stopGain / 20.0) self.B = self.B / g
def setConstParametric(self, f=[0.1, 0.3], bw=1., stopGain=-20, fs=1.): """ f is a list with bandpass centerfrequencies, bw the bandwidth in octaves, stopGain the gain in the stop bands """ size = self.getSize() nr = len(f) self.B = N.zeros((size, 3)) self.A = N.zeros((size, 3)) self.fc = N.zeros(size) for n in range(size): self.B[n],self.A[n] = \ filtering.biquad(fs,f[n%nr],'peakingEQ',BW=bw, \ dBgain=-stopGain) self.fc[n] = f[n % nr] / fs # normalize parametric EQ to 0 dB g = 10**(-stopGain / 20.) self.B = self.B / g