Пример #1
0
def plot_from_range_dict(range_dict,pdf_path,nr_fft = 100, 
                                len_fft = 1024, nr_mel_bins = 100):
    """
    Plot the ranges in the range_dict in mel spectrum scale and save to file
    Parameters:
    -----------
    range_dict : dictionary
        Dictionary whose keys are the filenames and values are list of lists of start and end time
        for the training interval ranges.
    pdf_path : string
        Path to a location where a pdf file is created containing the plots for all
        ranges in range_dict  
    nr_fft : int
        The number of ffts in each stft calculation
    len_fft : int
        The length of each of the nr_fft fourier transforms for each stft 
    nr_mel_bins : int
        The number of bins in which the mel spectrum is to be divided in
    Results:
    --------
    None
    """
    X = intvpck.train_interval_mel_features(range_dict, nr_fft = nr_fft, 
                                len_fft = len_fft, nr_mel_bins = nr_mel_bins)
    plot_titles_lst = pckhlp.plot_titles_list_from_dict(range_dict)
    pckhlp.save_feat_in_pdf(X, (nr_mel_bins,nr_fft), pdf_path,plot_titles_lst)
    
    return None
Пример #2
0
def plot_from_range_dict(range_dict,
                         pdf_path,
                         nr_fft=100,
                         len_fft=1024,
                         nr_mel_bins=100):
    """
    Plot the ranges in the range_dict in mel spectrum scale and save to file
    Parameters:
    -----------
    range_dict : dictionary
        Dictionary whose keys are the filenames and values are list of lists of start and end time
        for the training interval ranges.
    pdf_path : string
        Path to a location where a pdf file is created containing the plots for all
        ranges in range_dict  
    nr_fft : int
        The number of ffts in each stft calculation
    len_fft : int
        The length of each of the nr_fft fourier transforms for each stft 
    nr_mel_bins : int
        The number of bins in which the mel spectrum is to be divided in
    Results:
    --------
    None
    """
    X = intvpck.train_interval_mel_features(range_dict,
                                            nr_fft=nr_fft,
                                            len_fft=len_fft,
                                            nr_mel_bins=nr_mel_bins)
    plot_titles_lst = pckhlp.plot_titles_list_from_dict(range_dict)
    pckhlp.save_feat_in_pdf(X, (nr_mel_bins, nr_fft), pdf_path,
                            plot_titles_lst)

    return None