bin_spectrum   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/spectral_meter.xtm

Implementation

;; take a frequency domain signal (freq_buffer) of length N, and return the
;; average magnitude in n bins (with n < N)
(bind-func bin_spectrum
  (let ((i:i64 0)
        (j:i64 0)
        (total 0.0))
    (lambda (spectrum:double* freq_buffer fft_window_size nbins)
      (let ((bin_width (/ (/ fft_window_size nbins) 2)))
        (dotimes (i nbins)
          (set! total 0.0)
          (dotimes (j (* i bin_width) bin_width)
            (set! total (+ total (magnitude_cpxd (pref-ptr freq_buffer j)))))
          (pset! spectrum i (* 1.0 (/ total (i64tod bin_width)))))))))


Back to Index

Similar Entries

  • LR_combine    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • Texture_bind_data    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Texture_bind_data    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Texture_bind_image    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_bind_and_draw_arrays    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_bind_attribute    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_bind_attribute    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • _playbin_bus_call:GstBusFunc    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mediaplayer.xtm
  • bind    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • bind    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • bind    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • bind-alias    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-closure    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-data    macro    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • bind-data-constructors    scheme    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • bind-data-deconstructors    scheme    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • bind-data-deconstructors-macros    scheme    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • bind-data-getters    scheme    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • bind-data-type    scheme    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • bind-data-type-constructor    scheme    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • bind-data-types    scheme    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • bind-dylib    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-ext-val    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-external-dylib-declarations    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-func    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-func-ipc    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-gl-proc    macro    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-getprocaddress.xtm
  • bind-glew    macro    /digego/extempore/tree/v0.8.9/libs/external/gl/glcore-glew.xtm
  • bind-lib    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-lib-func    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-lib-type    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-lib-val    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-lib-xtm-get-string    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-macro    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-method    macro    /digego/extempore/tree/v0.8.9/libs/core/xobject.xtm
  • bind-object    macro    /digego/extempore/tree/v0.8.9/libs/core/xobject.xtm
  • bind-poly    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-static    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-type    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-val    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind-wrapper    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bind_cube    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • bindfunc    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/aot-compilation.xtm
  • bindfunc_with_docstring    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/aot-compilation.xtm
  • bindfunc_with_zone_size    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/aot-compilation.xtm
  • bindfunc_with_zone_size_and_docstring    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/aot-compilation.xtm
  • binomial    macro    /digego/extempore/tree/v0.8.9/libs/contrib/cas.xtm
  • combinations    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • combinations    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • cpBBIntersects    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpBB.xtm
  • cpBBIntersectsSegment    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpBB.xtm
  • draw_spectrum_key    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/spectral_meter.xtm
  • godot_method_bind_call    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libgodot.xtm
  • godot_method_bind_get_method    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libgodot.xtm
  • godot_method_bind_ptrcall    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libgodot.xtm
  • impc:aot:insert-closure-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-ext-globalvar-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-gl-proc-binding-details    scheme    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-getprocaddress.xtm
  • impc:aot:insert-globalvar-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-namedtype-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-nativefunc-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-polyfunc-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-static-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-typealias-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-xtmacro-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-bind-func-details-to-log    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-binding-details-to-log    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-lib-binding-details-to-log    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:binary-arity    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:binary-arity    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:bind-dylib    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:bind-lib    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • ipc:bind-func    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • ipc:bind-xtmrender-vars    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • mag_spectrum    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/spectral_meter.xtm
  • match-result:bind    scheme    /digego/extempore/tree/v0.8.9/libs/base/pattern.xtm
  • multi-list-combination    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • multi-list-combination-2    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • nnsock_bind    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanomsg.xtm
  • playbin_bus_call    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo.xtm
  • playbin_bus_call:GstBusFunc    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • plet-make-bindings    scheme    /digego/extempore/tree/v0.8.9/libs/base/pattern.xtm
  • spectrum-animation    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/spectral_meter.xtm
  • spectrum_visualiser    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/spectral_meter.xtm
  • unbind    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • unbind    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • unbind    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • unbind-func    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • unbind_cube    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • unbind_cube    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm