sourcecode_fs.py
def FilterBand(audioData, freqDom, freqs, filtFreq, FALim, export):
    """
        Sets amplitudes in transform to 0 that are outside frequency range. Performs inverse tranform
        Calls PlotSignal

        ----------

        Parameters

        ----------

        audioData: array_like
            raw audio data

        processed: array_like
            fourier transformed data

        freqs: array_like
            frequencies for filtering and inversion

        filtFreq: array_like
            pair of frequencies representing filter band

        FALim: array_like
            pair of values representing x axis limits for analysis plot
    """
    # list comprehension alternative. Slower.
    # filteredTrans = [0 if (freqs[i] >= filtFreq[0]) and (freqs[i] <= filtFreq[1]) else freqDom[i] for i in range(len(freqDom))]

    # to store filtered transformed data
    # filteredTrans = np.zeros(len(freqDom))
    filteredTrans = freqDom.copy()
    for i in range(len(freqDom)):
        if ((freqs[i] >= filtFreq[0]) and (freqs[i] <= filtFreq[1])):
            filteredTrans[i] = 0

        if freqs[i] > filtFreq[1]: break

    # invert to filtered signal
    filteredSignal = irfft(filteredTrans)
    # slice out negatives
    filteredSignal = (filteredSignal[:int(len(filteredSignal)/2)])

    if export:
        exportWav(filteredSignal)

    PlotSignal(filteredSignal, filteredTrans, freqs, FALim)

        Sets amplitudes in transform to 0 that are outside frequency range. Performs inverse tranform
        Calls PlotSignal

        ----------

        Parameters

        ----------

        audioData: array_like
            raw audio data

        processed: array_like
            fourier transformed data

        freqs: array_like
            frequencies for filtering and inversion

        filtFreq: array_like
            pair of frequencies representing filter band

        FALim: array_like
            pair of values representing x axis limits for analysis plot
    
Sets amplitudes in transform to 0 that are outside frequency range. Performs inverse tranform
Calls PlotSignal



Parameters



array_like
raw audio data

array_like
fourier transformed data

array_like
frequencies for filtering and inversion

array_like
pair of frequencies representing filter band

array_like
pair of values representing x axis limits for analysis plot
Sets amplitudes in transform to 0 that are outside frequency range . Performs inverse tranform Calls PlotSignal Parameters array_like raw audio data array_like fourier transformed data array_like frequencies for filtering and inversion array_like pair of frequencies representing filter band array_like pair of values representing x axis limits for analysis plot
def FilterBand(audioData, freqDom, freqs, filtFreq, FALim, export):
    filteredTrans = freqDom.copy()
    for i in range(len(freqDom)):
        if ((freqs[i] >= filtFreq[0]) and (freqs[i] <= filtFreq[1])):
            filteredTrans[i] = 0
        if freqs[i] > filtFreq[1]: break
    filteredSignal = irfft(filteredTrans)
    filteredSignal = (filteredSignal[:int(len(filteredSignal)/2)])
    if export:
        exportWav(filteredSignal)
    PlotSignal(filteredSignal, filteredTrans, freqs, FALim)
def FilterBand ( audioData , freqDom , freqs , filtFreq , FALim , export ) : filteredTrans = freqDom . copy ( ) for i in range ( len ( freqDom ) ) : if ( ( freqs [ i ] >= filtFreq [ 0 ] ) and ( freqs [ i ] <= filtFreq [ 1 ] ) ) : filteredTrans [ i ] = 0 if freqs [ i ] > filtFreq [ 1 ] : break filteredSignal = irfft ( filteredTrans ) filteredSignal = ( filteredSignal [ : int ( len ( filteredSignal ) / 2 ) ] ) if export : exportWav ( filteredSignal ) PlotSignal ( filteredSignal , filteredTrans , freqs , FALim )
Sets amplitudes in transform to 0 that are outside frequency range.
Sets amplitudes in transform to 0 that are outside frequency range .
"""
        Sets amplitudes in transform to 0 that are outside frequency range. Performs inverse tranform
        Calls PlotSignal

        ----------

        Parameters

        ----------

        audioData: array_like
            raw audio data

        processed: array_like
            fourier transformed data

        freqs: array_like
            frequencies for filtering and inversion

        filtFreq: array_like
            pair of frequencies representing filter band

        FALim: array_like
            pair of values representing x axis limits for analysis plot
    """ # list comprehension alternative. Slower. # filteredTrans = [0 if (freqs[i] >= filtFreq[0]) and (freqs[i] <= filtFreq[1]) else freqDom[i] for i in range(len(freqDom))] # to store filtered transformed data # filteredTrans = np.zeros(len(freqDom)) # invert to filtered signal # slice out negatives
audioData
freqDom
freqs
filtFreq
FALim
export