예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    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
예제 #4
0
    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
예제 #5
0
    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
예제 #6
0
    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
예제 #7
0
	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
예제 #8
0
	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
예제 #9
0
    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
예제 #10
0
    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