def get_block_size(num_antennas=1,
                   tchans_per_block=128,
                   num_bits=8,
                   num_pols=2,
                   num_branches=1024,
                   num_chans=64,
                   fftlength=1024,
                   int_factor=4):
    """
    Calculate block size, given a desired number of time bins per RAW data block 
    `tchans_per_block`. Takes in backend parameters, including fine channelization
    factors. Can be used to calculate reasonable block sizes for raw voltage recording.
    
    Parameters
    ----------
    num_antennas : int
        Number of antennas
    tchans_per_block : int
        Final number of time bins in fine resolution product, per data block
    num_bits : int
        Number of bits in requantized data (for saving into file). Can be 8 or 4.
    num_pols : int
        Number of polarizations recorded
    num_branches : int
        Number of branches in polyphase filterbank 
    num_chans : int
        Number of coarse channels written to file
    fftlength : int
        FFT length to be used in fine channelization
    int_factor : int, optional
        Integration factor to be used in fine channelization
    
    Returns
    -------
    block_size : int
        Block size, in bytes
    """
    obsnchan = num_chans * num_antennas
    bytes_per_sample = 2 * num_pols * num_bits // 8
    T = tchans_per_block * fftlength * int_factor
    block_size = T * obsnchan * bytes_per_sample
    return block_size