Module Import alias Import alias identifier Import alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Num Num NameLoad Num Str body Expr Str If BoolOpAnd CompareNotEq NameLoad Str CompareNotEq NameLoad Str body Raise NameLoad Str If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad BinOpDiv BinOpMult NameLoad AttributeLoad NameLoad attr Num If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Slice BinOpMult NameLoad AttributeLoad NameLoad attr orelse Assign NameStore SubscriptLoad NameLoad Slice BinOpMult NameLoad AttributeLoad NameLoad attr BinOpMult BinOpAdd NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad BinOpSub BinOpDiv BinOpMult Num AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad BinOpMult NameLoad SubscriptLoad NameLoad Slice BinOpDiv BinOpMult NameLoad NameLoad Num BinOpAdd BinOpDiv BinOpMult NameLoad NameLoad Num NameLoad Assign NameStore ListComp ListLoad NameLoad comprehension NameStore NameLoad orelse If CompareEq NameLoad Str body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Assign NameStore BinOpSub Num Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Str Assign NameStore BinOpSub Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num ListLoad Num Num Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult Num NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num For NameStore Call NameLoad NameLoad BinOpSub Call NameLoad NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad ExtSlice Slice BinOpSub NameLoad NameLoad BinOpAdd NameLoad NameLoad Slice BinOpSub NameLoad NameLoad BinOpAdd NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad keyword BinOpAdd BinOpDiv NameLoad Num Num Assign NameStore ListLoad If CompareEq NameLoad Str body For NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num If CompareGt NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Slice Call NameLoad BinOpDiv BinOpMult BinOpSub NameLoad NameLoad NameLoad Num Call NameLoad BinOpDiv BinOpMult NameLoad NameLoad Num Assign NameStore SubscriptLoad NameLoad Slice Call NameLoad BinOpDiv BinOpMult NameLoad NameLoad Num Call NameLoad BinOpDiv BinOpMult BinOpAdd NameLoad NameLoad NameLoad Num If CompareLt Call NameLoad NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp TupleLoad BinOpDiv BinOpMult SubscriptLoad NameLoad Index Num NameLoad Num SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareEq NameLoad NameLoad body Break Return ListComp SubscriptLoad NameLoad Index Num comprehension NameStore SubscriptLoad NameLoad Slice NameLoad orelse If CompareEq NameLoad Str body Assign NameStore SubscriptLoad NameLoad Index Str Return ListComp SubscriptLoad NameLoad Index Call NameLoad SubscriptLoad NameLoad Index Num comprehension NameStore SubscriptLoad NameLoad Slice NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str If CompareNotEq AttributeLoad NameLoad attr Num body Raise NameLoad Str If CompareLt AttributeLoad NameLoad attr NameLoad body Raise NameLoad Str If CompareLt NameLoad Num body Return NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad SubscriptLoad NameLoad Slice BinOpSub NameLoad Num Num Num NameLoad SubscriptLoad NameLoad Slice Num UnaryOpUSub NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpSub NameLoad Num Num Assign NameStore BinOpBitAnd SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad CompareGt SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad CompareGt SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad BinOpSub BinOpAdd Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice BinOpSub NameLoad NameLoad BinOpAdd NameLoad NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice BinOpSub NameLoad NameLoad BinOpAdd NameLoad NameLoad Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad attr Return SubscriptLoad NameLoad Index Call AttributeLoad UnaryOpUSub SubscriptLoad NameLoad ExtSlice Slice Index Num attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num keyword Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num
N/A N/A sys N/A numpy np N/A scipy utils RMS_energy novelty N/A N/A song k wlen_ms start duration nchangepoints feature N/A 64 100 0 None 5 rms N/A N/A Return points of high "novelty" in a song
    (e.g., significant musical transitions)

    :param song: Song to analyze
    :type song: :py:class:`radiotool.composer.Song`
    :param k: Width of comparison kernel (larger kernel finds coarser differences in music)
    :type k: int
    :param wlen_ms: Analysis window length in milliseconds
    :type wlen_ms: int
    :param start: Where to start analysis within the song (in seconds)
    :type start: float
    :param duration: How long of a chunk of the song to analyze (None analyzes the entire song after start)
    :type duration: float
    :param nchangepoints: How many novel change points to return
    :type nchangepoints: int
    :param feature: Music feature to use for novelty analysis
    :type feature: "rms" or "mfcc" (will support "chroma" eventually)
    :returns: List of change points (in seconds)
    :rtype: list of floats
     N/A N/A N/A feature rms N/A feature mfcc N/A N/A ValueError novelty currently only supports 'rms' and 'mfcc' features N/A N/A feature rms N/A N/A frames N/A N/A song all_as_mono N/A wlen_samples N/A int N/A N/A wlen_ms N/A song samplerate 1000 N/A N/A duration None N/A N/A frames N/A frames N/A N/A start N/A song samplerate N/A N/A frames N/A frames N/A N/A start N/A song samplerate N/A N/A start duration N/A song samplerate N/A hamming N/A N/A np hamming wlen_samples N/A nwindows N/A int N/A N/A N/A 2 N/A song duration wlen_samples 1 N/A energies N/A N/A np empty nwindows N/A i N/A range nwindows N/A N/A N/A energies N/A i N/A RMS_energy N/A hamming N/A frames N/A N/A N/A i wlen_samples 2 N/A N/A N/A i wlen_samples 2 wlen_samples N/A energies_list N/A N/A x N/A x energies N/A N/A N/A feature mfcc N/A N/A analysis N/A song analysis N/A energies_list N/A N/A np array N/A analysis N/A timbres N/A S_matrix N/A 1 N/A N/A N/A N/A scipy spatial distance squareform N/A N/A N/A N/A scipy spatial distance pdist energies_list euclidean N/A C_matrix N/A N/A N/A np kron N/A N/A np eye 2 N/A N/A np ones N/A k k N/A N/A np kron N/A N/A 0 1 N/A 1 0 N/A N/A np ones N/A k k N/A g N/A N/A N/A scipy signal gaussian N/A 2 k k N/A C_matrix N/A N/A np multiply C_matrix N/A N/A N/A np multiply outer N/A g T g N/A N_vec N/A N/A np zeros N/A N/A N/A np shape S_matrix N/A 0 N/A i N/A xrange k N/A N/A len N_vec k N/A N/A S_part N/A S_matrix N/A N/A N/A i k N/A i k N/A N/A i k N/A i k N/A N/A N_vec N/A i N/A N/A np sum N/A N/A np multiply S_part C_matrix N/A peaks N/A naive_peaks N_vec k N/A N/A k 2 1 N/A out_peaks N/A N/A N/A feature rms N/A N/A p peaks N/A N/A frame N/A p N/A 0 N/A N/A frame k N/A N/A left_frames N/A frames N/A N/A int N/A N/A N/A frame k wlen_samples 2 N/A int N/A N/A frame wlen_samples 2 N/A right_frames N/A frames N/A N/A int N/A N/A frame wlen_samples 2 N/A int N/A N/A N/A frame k wlen_samples 2 N/A N/A N/A RMS_energy left_frames N/A RMS_energy right_frames N/A N/A N/A N/A out_peaks append p N/A out_peaks N/A N/A N/A N/A N/A x N/A 0 wlen_ms 2000.0 N/A x N/A 1 N/A x out_peaks N/A N/A i p N/A enumerate out_peaks N/A N/A N/A i nchangepoints N/A N/A N/A N/A N/A x N/A 0 N/A x N/A out_peaks N/A nchangepoints N/A N/A N/A feature mfcc N/A N/A beats N/A analysis N/A beats N/A N/A N/A beats N/A N/A int N/A b N/A 0 N/A b N/A peaks N/A nchangepoints N/A smooth_hanning N/A N/A x size N/A 11 N/A N/A smooth a 1D array using a hanning window with requested size. N/A N/A N/A x ndim 1 N/A N/A ValueError smooth_hanning only accepts 1-D arrays. N/A N/A N/A x size size N/A N/A ValueError Input vector needs to be bigger than window size. N/A N/A size 3 N/A N/A x N/A s N/A N/A np r_ N/A N/A N/A x N/A N/A size 1 0 -1 x N/A x N/A -1 N/A size -1 N/A w N/A N/A np hanning size N/A y N/A N/A np convolve N/A w N/A N/A w sum s mode valid N/A y N/A naive_peaks N/A N/A vec k N/A 33 N/A N/A A naive method for finding peaks of a signal.
    1. Smooth vector
    2. Find peaks (local maxima)
    3. Find local max from original signal, pre-smoothing
    4. Return (sorted, descending) peaks
     N/A a N/A smooth_hanning vec k N/A k2 N/A N/A k 1 2 N/A peaks N/A N/A N/A np r_ N/A N/A True N/A N/A a N/A 1 N/A a N/A -1 N/A N/A np r_ N/A N/A N/A N/A a N/A -1 N/A a N/A 1 True N/A p N/A N/A np array N/A N/A N/A np where peaks N/A 0 N/A maxidx N/A N/A np zeros N/A N/A np shape p N/A maxvals N/A N/A np zeros N/A N/A np shape p N/A N/A i pk N/A enumerate p N/A N/A N/A maxidx N/A i N/A N/A N/A N/A np argmax N/A vec N/A N/A pk k2 N/A pk k2 pk k2 N/A N/A maxvals N/A i N/A N/A np max N/A vec N/A N/A pk k2 N/A pk k2 N/A out N/A N/A N/A np array N/A maxidx maxvals T N/A N/A out N/A N/A N/A N/A N/A out N/A N/A N/A 1 argsort N/A N/A N/A __name__ __main__ N/A N/A N/A novelty N/A N/A sys argv N/A 1 k N/A int N/A N/A sys argv N/A 2